SQL Server 2005: When copy table structure to other database "CONSTRAINT" keywords lost
- by StreamT
Snippet of original table:
CREATE TABLE [dbo].[Batch](
[CustomerDepositMade] [money] NOT NULL
CONSTRAINT [DF_Batch_CustomerDepositMade] DEFAULT (0)
Snippet of copied table:
CREATE TABLE [dbo].[Batch](
[CustomerDepositMade] [money] NOT NULL,
Code for copy database:
Server server = new Server(SourceSQLServer);
…