Search
 
SCRIPT & CODE EXAMPLE
 

SQL

SQL BACKUP DATABASE Statement

BACKUP DATABASE my_db
TO DISK = 'C:my_db_backup.bak';
Comment

backup a table in sql

CREATE TABLE backup_table SELECT * FROM table_to_be_backed_up;
Comment

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 :: display first three characters sql 
Sql :: Drop check constraint in ms sql 
Sql :: copy from one table to another postgres using matching column 
Sql :: union postgresql 
Sql :: alter table drop partition hive 
Sql :: count weekend days between two dates sql 
Sql :: dump multiple tables mysql 
Sql :: xampp mysql command to import a large database 
Sql :: postgres copy command 
Sql :: open postgresql.conf in centos 
Sql :: difference between in and between in sql 
Sql :: sql select data type of query 
Sql :: create-table 
Sql :: install mysql 
Sql :: SQL Server Splitting a string column into multiple rows, while repeating ID column 
Sql :: connect to mysql server mac terminal 
Sql :: view acl table oracle 
Sql :: mysql grouping functions 
Sql :: mysql join same table multiple times group by 
Sql :: how to join multiple table in mysql 
Sql :: npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! sqlite3@4.2.0 install: `node-pre-gyp install --fallback-to-build` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the sqlite3@4.2.0 install script. 
Sql :: mysql pass command from command line 
Sql :: Failed to process SQL command - ORA-28014: cannot drop administrative user or role 
Sql :: insert into table using openquery 
Sql :: number(10 2) in sql means 
Sql :: flask sqlalchemy remove duplicates 
Sql :: sql constraint to check date less than current date 
Sql :: show broken table mysql 
Sql :: sql subquery 
Sql :: snowflake insert select 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =