Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Run Multiple Scripts
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01394631
Message ID:
01394634
Vues:
43
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform