Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Run Multiple Scripts
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01394631
Message ID:
01394634
Views:
41
>>How do I run multiple table generation scripts all together as one?
>
>Just put everything in one long script and have GO between some statements and run from SSMS.

I have table generation scripts in separate files, such as:
EXEC sp_DropTable 'bm_Addresses'

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE bm_Addresses
	(AddressKey	int	IDENTITY	NOT NULL,
	 AddressTypeKey      int		NOT NULL,
	 Street1		varchar(40)		NOT NULL,
	 Street2		varchar(40),			
	 City		varchar(40)		NOT NULL,
	 State		char(2)		NOT NULL,
	 PostalCode	char(10)		NOT NULL)

-- Add the Primary Key
ALTER TABLE bm_Addresses WITH NOCHECK 
	ADD CONSTRAINT [PK_bm_Addresses] 
	PRIMARY KEY NONCLUSTERED (AddressKey)
I have 30 or so scripts, and I want to run them all at once
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform