动态创建表名
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)
长期招聘java,有找工作可以联系我,微信:caozhenhua1563