Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Add a new field to all tables
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00690526
Message ID:
00690646
Vues:
11
This should work...
ALTER TABLE dbo.mytable ADD
	corporateID int NOT NULL DEFAULT 0

ALTER TABLE dbo.mytable ADD CONSTRAINT
	PK_mytable PRIMARY KEY CLUSTERED 
	(corporateID) ON [PRIMARY]
>I need to add a field called corporateID (Integer) with a default value of 0 to every table in my sql database. But I have never actually coded an Alter command. I know I can get a list of all tables with one of the sql() commands in VFP, then I could just scan through those and issue the alter. I was hoping someone could help me format the alter command.
>
>Thanks
>Kirk
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform