zzxap

为数据库里每个表都增加一个字段

declare @sql varchar(max)

set @sql=\'\'

select @sql=@sql+\' alter table \'+[name]+\' add DbName nvarchar(30) \'

from sys.tables

exec(@sql)

 

exec sp_msforeachtable \'alter table ? add DbName nvarchar(30)\'

分类:

技术点:

相关文章:

  • 2021-06-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-15
  • 2022-12-23
  • 2021-12-31
  • 2022-12-23
猜你喜欢
  • 2021-11-11
  • 2021-11-11
  • 2021-08-15
  • 2021-10-15
  • 2021-08-15
  • 2021-11-11
相关资源
相似解决方案