其他分享
首页 > 其他分享> > 获取某个表的全部表名,并转换成字符串作比较使用

获取某个表的全部表名,并转换成字符串作比较使用

作者:互联网

Select  @CompareCol1 = STUFF((select ',' + COLUMN_name from INFORMATION_SCHEMA.columns where TABLE_NAME = @TableName1
									and COLUMN_NAME not in (''''+ @ExceptCol +'''')
									FOR XML PATH('')), 1, 1, '') 
select STUFF((select ',' + COLUMN_name from INFORMATION_SCHEMA.columns where TABLE_NAME = 'emp'
									and COLUMN_NAME not in (' ')
									FOR XML PATH('')), 1, 1, '') 

标签:转换成,NAME,COLUMN,表名,字符串,PATH,TABLE,select,SCHEMA
来源: https://www.cnblogs.com/1241187306qq/p/16554642.html