SQL Server: Declaring variable type based on a column type

Posted by Bernard Dy on Stack Overflow See other posts from Stack Overflow or by Bernard Dy
Published on 2010-04-21T14:16:34Z Indexed on 2010/04/21 14:23 UTC
Read the original article Hit count: 206

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?

I searched but could not find a duplicate for this question. If there is one, please let me know and I'll refer to it and delete this.

© Stack Overflow or respective owner

Related posts about sql-server

Related posts about variables