declare @sql nvarchar(1000)
declare @t nvarchar(10)=convert(nvarchar(10),getdate(),23)
declare @t1 nvarchar(10)=N'_'+Replace(@t,'-','')
declare @tab nvarchar(40)=concat('Detailxx',@t1)
--print @tab
set @sql='SELECT * into '+@tab+' FROM Detailxx where date>=''2024-06-01''';
print @sql
EXEC sp_Executesql @sql;