In Oracle's PL-SQL, you can declare a variable and define its type based on a table column:
declare var1 table.column%TYPE;
Is it possible to do something similar in MS SQL Server?
No you can't do this. The closest equivalent is User-Defined Data Types. This will give you a layer of abstraction that may help, but it is not the same as deriving a type from a column.
User-Defined Data Types
2.1m questions
2.1m answers
60 comments
57.0k users