Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql server backup table

SELECT * INTO BackupTable FROM Table
Comment

sql table backup

CREATE TABLE actor_backup SELECT * FROM actor;
Comment

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)
Comment

PREVIOUS NEXT
Code Example
Sql :: bigquery javascript 
Sql :: mysql extract days 
Sql :: flask sqlalchemy session delete 
Sql :: adonisjs ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client 
Sql :: How to Remove milliseconds from Date time 
Sql :: how to format tables in sqlplus 
Sql :: xamarin sql lite create table if not exist 
Sql :: stored procedure to change name of column for all dependent tables and views 
Sql :: Error in connection_import_file(conn@ptr, name, value, sep, eol, skip) : RS_sqlite_import: test.csv line 2 expected 11 columns of data but found 1 
Csharp :: unity delete all children 
Csharp :: lockstate untiy 
Csharp :: c# random float between two numbers 
Csharp :: c sharp how to read a text file 
Csharp :: c# delete files older than 10 days 
Csharp :: loop through an enum c# 
Csharp :: c# remove crlf from string 
Csharp :: how to convert float to int in c# unity 
Csharp :: unity 2d how to set an object or the mouse position 
Csharp :: c# random enum 
Csharp :: unity player look at mouse 
Csharp :: c# print to console 
Csharp :: get string last character vb.net 
Csharp :: stream to byte array c# 
Csharp :: unity 2d detect click on sprite 
Csharp :: how to convert angle to vector in c# 
Csharp :: dotnet dev-certs https --clean 
Csharp :: get datacontext of parent wpf 
Csharp :: how to make rb.addforce 2d 
Csharp :: c# require administrator permissions 
Csharp :: how to check if a number is even in c# 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =