Print list of comma seperated columns *******/ SELECT ',' + QUOTENAME() FROM sys.columns WHERE object_id=object_id('' + + '') Order By In order to remove union all from the last row */ *Need to check either top No of record is less than record count Print sp_executesql = INT OUTPUT', = OUTPUT SET N'SELECT FROM ' + + (CASE WHEN '' THEN ' Where ' + ELSE '' END) SET + '.' + need to find the record count in order to remove Union ALL from the last row*/ Now, you need to create this procedure to generate “insert into statement” from table data. Let me explain this issue demonstrating simple example.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |