Get Metadata Information of Table Variable


  
 
 DECLARE @ColMapTable TABLE (ColumnName varchar(300),ColumnDataType varchar(300),Lengths varchar(10))
/*
---your other code
*/

SELECT c.name as COLUMN_NAME 
FROM  tempdb.sys.columns c 
where  c.object_id=(select top 1 id  from tempdb..sysobjects
  where type ='U'
  order by crdate desc)

 

https://social.msdn.microsoft.com/Forums/en-US/bf666d9a-1972-4145-b218-ec47da344872/getting-error-in-sql-server?forum=transactsql

Advertisements


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s