Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / database / SQL-Server / SQL-Server-2008

SMO Tutorial 3 of n - Scripting

5.00/5 (1 vote)
24 Jan 2016CPOL 9.6K   127  
This is an alternative for SMO Tutorial 3 of n - Scripting

Changes

  • Added FormLogin allowing Windows Authentication or SQL Server Authentication
  • Added Keys, indexes and constraints
  • Added SQL Server 2008 R2 support
  • Fixed syntax coloring
  • Updated solution to VS2013

Points of Interest

When using the generated scripts on different SQL Server versions, be sure to edit the CREATE DATABASE statement. The simplest way to make sure this works is to change it to:

SQL
CREATE DATABASE [name]

(without any of the complex file name options).

Tested on Windows 7 / Windows Vista, SQL Server 2008 R2 / 2012.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)