获取临时表中所有列名

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

 

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

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

相关文章:

  • 2021-07-28
  • 2022-12-23
  • 2021-07-27
  • 2021-09-18
猜你喜欢
  • 2021-05-29
  • 2022-12-23
  • 2021-10-25
  • 2022-12-23
  • 2021-07-21
  • 2021-10-13
相关资源
相似解决方案