December 25, 2010 at 12:30 pm
Comments posted to this topic are about the item SQL Script to generate columns for triggers
December 27, 2010 at 3:46 pm
SELECT CASE WHEN column_id = MIN(column_id) OVER(PARTITION BY 1) THEN 'INSERT INTO ' + OBJECT_NAME(object_id) + ' (' ELSE ' ' END + name + CASE WHEN column_id = MAX(column_id) OVER(PARTITION BY 1) THEN ')' ELSE ', ' END FROM sys.columns WHERE object_id = OBJECT_ID('TableName') ORDER BY column_id
January 4, 2011 at 5:25 pm
Or, Just drag the Columns node from the object browser into the Query editor.
Mark
Just a cog in the wheel.
January 14, 2011 at 5:01 pm
read many time still don't understand what are you talking about. Which is your resutls ? copy paste what???
May 17, 2016 at 12:52 pm
Thanks for the script.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply