I have problem that replace function does not work
DECLARE @Tabela nvarchar(25)
DECLARE @query nvarchar(max)
SET @Tabela = '_#tmp_tt2_POS_racuni_'
SET @query = 'SELECT * INTO '+@Tabela+((replace(convert(varchar(10), getdate(),121),'''-''',''''))+'-'+(replace(convert(nvarchar(10),getdate(),108),''':''','''')))+'NP'+' FROM _tabels'
print @query
SELECT * INTO _#tmp_tt2_POS_racuni_2021-12-21-11:15:27NP FROM _tabels Completion time: 2021