好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

SQLServer获取临时表所有列名或是否存在指定列名的方法

获取临时表中所有列名

select name from tempdb.dbo.syscolumns where id=object_id( '#TempTB')

判断临时表中是否存在指定列名

if col_length('tempdb.dbo.#TempTB','columnName') is not null
  print '存在'
else
  print '不存在'
 

查看更多关于SQLServer获取临时表所有列名或是否存在指定列名的方法的详细内容...

  阅读:56次