问题描述
我想备份数据库,因此有没有什么SQL脚本可以使用,例如我们如何使用sql脚本以"SELECT * FROM tblname"的形式获取表内容,
I want to take data base back up, so is there any sql script to take that, like how we use the sql script to get table content as "SELECT * FROM tblname" ,
预先感谢
推荐答案
就像在谈论SQL Server 2008.
Looks like hes talking about SQL Server 2008.
要对文件/查询进行完整的数据库备份,可以使用数据库上的生成脚本..."选项.
To do a full database backup to File/Query you can use the 'Generate Scripts...' option on the Database.
打开SQL Server Management Studio,右键单击数据库,然后选择任务->生成脚本..."
Open SQL Server Management studio, right click on the database and choose 'Tasks->Generate Scripts...'
然后使用向导备份数据库.您可以编写整个数据库或部分数据库的脚本.两个重要的选择:在高级"部分,您可能需要确保备份类型='模式和数据'并且'脚本统计信息'处于启用状态.
Then use the wizard to backup the database.You can script the whole database or parts of it.Two important options: In the 'Advanced' section, you will probably want to ensure 'Type of backup = 'Schema and Data' and the 'Script Statistics' is on.
这将产生一个* .sql文件,您可以将其用作备份.
This will produce a *.sql file that you can use as a backup.
这篇关于用于以"SELECT * FROM tblname"的形式获取表内容的SQL脚本;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!