Programmatically generate script for all objects in a database

前端 未结 5 686
情歌与酒
情歌与酒 2020-12-10 21:06

For an automated setup build that generates the setup for an application which uses Microsoft SQL Server, I am currently evaluating whether the following is possible:

<
相关标签:
5条回答
  • You should be able to do it in managed code using SMO

    0 讨论(0)
  • 2020-12-10 21:11

    Microsoft has also released a tool called 'mssql-scripter'. It can be found here: mssql-scripter

    0 讨论(0)
  • 2020-12-10 21:20

    I wrote SMOscript, a command line tool to script all objects into a single file, or one file for all objects.

    The Generate Scripts function of MSSQL typically does not consider references and dependencies to determine the sequence of objects (at least that was the case with 2000 and 2005)

    0 讨论(0)
  • 2020-12-10 21:20

    I used http://www.codeplex.com/ScriptDB with great success.

    0 讨论(0)
  • 2020-12-10 21:27

    You could invoke a standard select clause (using ADO.NET for example) over the sysobjects view.

    0 讨论(0)
自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题