sql server - Declare a Table Variable Based on Select Statement -


i want declare table variable , fill select, without having explicitly define columns. t-sql allow this:

declare @people table() select * persons; 

hypothetically, above statement match column types identically, , fill @people table variable @ same time. :)

you can't table variable since variable has declared before can used, use temp table instead.

select * #people persons; 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -