declare @time varchar(30) select @time= CONVERT(varchar(12),getdate(),112) set @time=right(@time,6) print @time
create table VehicleTrail+@time ( Sim varchar(11) not null, TraceTime datetime not null, Longitude float not null, Latitude float not null, Direction float not null, Speed float not null, MonitorType char(5) null, GPSStatus bit not null )
declare @sql varchar(4000) set @sql = 'create table VehicleTrail' + @time + '(Sim varchar(11) not null,TraceTime datetime not null,Longitude float not null,Latitude float not null,Direction float not null,Speed float not null,MonitorType char(5) null,GPSStatus bit not null)' exec (@sql)