Chad
Chad

Reputation: 24699

Declare @MyVar SameAs [Table].[Column]

In the latest version of T-SQL, which I presume is SQL 2008 R2, can one declare a variable and specify that its type is to be the same as a specified table.column rather than hard coding a specific data type/length?

I'm guessing that T-SQL still doesn't have it but I wanted to be sure.

Upvotes: 1

Views: 311

Answers (1)

gbn
gbn

Reputation: 432712

No. You can't.

It has been requested though on MS Connect. Vote it up. And asked for twice too.

Upvotes: 3

Related Questions