declare @table varchar(20)
set  @table='salesfact'+rtrim(year(getdate()))
declare @sql varchar(1000)
set @sql='
if exists(select 1 from sysobjects where name='''+@table+''' and xtype=''u'')
 drop table ['+@table+']

 create table ['+@table+']
(
a int,
b char(4),
c int
)'
exec(@sql)

相关文章:

  • 2021-10-23
  • 2021-12-04
  • 2021-05-18
  • 2021-09-08
  • 2021-06-19
  • 2021-08-07
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-20
  • 2022-03-01
  • 2022-12-23
  • 2022-12-23
  • 2021-06-12
  • 2021-09-16
相关资源
相似解决方案