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
Post a Comment