Jump to content

[Help] SQL SERVER – Combined Multiple .SQL files into One Single File


Trong
 Share

Recommended Posts

DB1:

CREATE TABLE [dbo].[Item](
    [ItemID] [nchar](10) NOT NULL,
    [Money] [bigint] NOT NULL,
 CONSTRAINT [PK_Item] PRIMARY KEY CLUSTERED 
(
    [ItemID] ASC
) ON [PRIMARY]
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[Account](
    [Index] [int] IDENTITY(1,1) NOT NULL,
    [AccountID] [nchar](10) NOT NULL,
    [AccountName] [int] NOT NULL,
    [ItemList] [int] NOT NULL,
) ON [PRIMARY]
GO


CREATE TABLE [dbo].[Money](
    [AccountID] [nchar](10) NOT NULL,
    [Money] [bigint] NOT NULL,
 CONSTRAINT [PK_Money] PRIMARY KEY CLUSTERED 
(
    [AccountID] ASC
) ON [PRIMARY]
) ON [PRIMARY]
GO

 

DB2:

CREATE TABLE [dbo].[Item](
    [ItemID] [nchar](10) NOT NULL,
    [Money] [bigint] NOT NULL,
    [ItemName] [bigint] NOT NULL,
    [MoneyType] [bigint] NOT NULL,
 CONSTRAINT [Item] PRIMARY KEY CLUSTERED 
(
    [ItemID] ASC
) ON [PRIMARY]
) ON [PRIMARY]
GO


CREATE TABLE [dbo].[Account](
    [Index] [int] IDENTITY(1,1) NOT NULL,
    [AccountID] [nchar](10) NOT NULL,
    [AccountName] [int] NOT NULL,
    [ItemList] [int] NOT NULL,
) ON [PRIMARY]
GO


CREATE TABLE [dbo].[Money](
    [AccountID] [nchar](10) NOT NULL,
    [Money] [bigint] NOT NULL,
    [MoneyType] [bigint] NOT NULL,
 CONSTRAINT [Money] PRIMARY KEY CLUSTERED 
(
    [AccountID] ASC
) ON [PRIMARY]
) ON [PRIMARY]
GO

 

Compare and merge database.

alter table [Item] add [ItemName] bigint not null default(0)
alter table [Item] add [MoneyType] bigint not null default(0)
alter table [Money] add [MoneyType] bigint not null default(0)

Please help automate code AutoIt to generation new code for large sql file.
Thanks

Regards,
 

Link to comment
Share on other sites

  • Moderators

You're asking for help on your AutoIt code, but I see no AutoIt code. What have you tried?

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Moderators

Ok, well that is pretty confusing based on this line in your OP:

 

1 hour ago, Trong said:

Please help automate code AutoIt to generation new code for large sql file.

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...