本文介绍了在SQL Server Management Studio中生成脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 如果我在SQL Server中有一个数据库中的数据表,我如何生成一个脚本创建表并添加数据?If I have a table with data in a database in SQL Server, how can I generate a script that will create the table and add the data too?如果我右键单击表,然后选择脚本表为>创建到> File ,它会生成一个脚本来创建没有数据的表。我需要的是一个脚本,创建表并添加已经存在于表中的数据或2个单独的脚本,一个创建表和一个添加数据。If I right click on the table then select Script Table As > Create to > File, that generates a script to just create the table without the data. What I need is a script that creates the table and adds the data that is already existing in the table or 2 separate scripts, one that creates the table and one that adds the data.推荐答案这里你要做什么: 右键单击数据库)并选择任务 - >生成脚本 下一步 - >选择所需的表/表(来自选择特定数据库对象) 点击高级 - >数据类型到脚本=模式和数据 接下来完成right click the database (not the table) and select tasks --> generate scriptsNext --> select the requested table/tables (from select specific database objects)next --> click advanced --> types of data to script = schema and datanext and finish 这篇关于在SQL Server Management Studio中生成脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-21 08:41