Answers for "how to backup table data in sql server"

SQL
2

sql server backup table

SELECT * INTO BackupTable FROM Table
Posted by: Guest on October-14-2021
-1

backup table mssql

declare @name varchar(100) = 'tableName'

declare @timestamp varchar(100) =  
 replace(cast(convert(varchar, getdate(), 126) as varchar(10)), '-', '') + '_' 
 + RIGHT('00' +cast(datepart(hour, getdate()) as varchar), 2)
 + RIGHT('00' + cast(datepart(minute, getdate()) as varchar), 2) + '_' 

declare @query varchar(MAX) = 'select * into backup_' + @timestamp + @name  + ' from ' + @name

--select @query
exec(@query)
Posted by: Guest on September-21-2021

Code answers related to "how to backup table data in sql server"

Code answers related to "SQL"

Browse Popular Code Answers by Language