Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Add a new field to all tables
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00690526
Message ID:
00690646
Views:
12
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
Previous
Reply
Map
View

Click here to load this message in the networking platform