Showing posts with label sysobjects. Show all posts
Showing posts with label sysobjects. Show all posts

Sunday, March 11, 2012

Declare Variable As Table

hi all
how can I Declare Variable As Table Like Cursor
DECLARE parameter_cursor CURSOR FOR
SELECT top 1 c.name, t.name
FROM sysobjects o
JOIN syscolumns c on c.id = o.id
JOIN systypes t on c.xtype = t.xtype
WHERE o.name like 'Test'
order by o.name, c.colid
TanksYou cannot declare a table variable like a cursor, however you can declare a
table variable and then insert the data into the table variable. It will be
available for all the operations within the given scope.
Anith