T-SQL's equivalent of Oracle's %TYPE opera

2019-04-06 17:44发布

When writing a procedure in PL/SQL, I can declare a parameter's type as myTable.myColumn%TYPE so that when I alter myColumn's type from say varchar2(20) to varchar2(50) I don't have to change the procedure's parameter type. Is there something similar in T-SQL?

2条回答
做自己的国王
2楼-- · 2019-04-06 17:52

No, there is no equivalent in T-SQL.

查看更多
一夜七次
3楼-- · 2019-04-06 18:06

The best that you could do would be to create a user-defined data type, then you could change the underlying UDT and it would take effect in both places.

This would affect it everywhere that you use it, so if you used the type in multiple tables it would affect them all if you changed it.

查看更多
登录 后发表回答