1.常用的数据库备份表语句
SELECT * INTO tableNameNew FROM tableName
2.动态备份表,且备份表名称后面增加三位随机字符和当前日期
1 DECLARE @bakTbl VARCHAR(MAX) 2 SET @bakTbl = ' 3 DECLARE @bakTbl VARCHAR(200) 4 SET @bakTbl=''tableName''+LEFT(NEWID(),3)+CONVERT(varchar(100), GETDATE(), 112) 5 EXEC(''SELECT * INTO ''+ @bakTbl +'' FROM tableName'') 6 ' 7 EXEC(@bakTbl)