0

I'm looking to generate the SQL scripts for table creation programmatically based on class definitions in my DAL similar to SQL Server Management Studio.

So, when I right click on a table in MS SMS, and tell it to script table as > Create to > new query window, it generates some very understandable code. However, I'm not sure why they generate a few of the following lines:

  • SET ANSI_NULLS ON
  • SET QUOTED_IDENTIFIER ON
  • SET ANSI_PADDING ON
    • {TABLE DEF GOES HERE}
  • SET ANSI_PADDING OFF

I have looked these statements in the product documentation, and understand what they are for, but am not sure why they are generated around each table declaration.

4

1 に答える 1

1

これらの設定は、テーブルまたはコード定義とともに保存されます。これらストアドプロシージャに設定すると、実行時に無視されます。

したがって、テーブルをスクリプト化する場合は、設定もスクリプト化する必要があります。特に、列などを計算した場合も同様です。

于 2009-11-01T17:14:58.283 に答える