Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to alter fields of all the tables
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2008
Application:
Desktop
Miscellaneous
Thread ID:
01449660
Message ID:
01449661
Views:
37
>Hi !
>
>Pls help me to alter the data type of a field of all the tables exist in the SQL Database.
>
>Thanks In Advance
>Ravi

In ALL tables you have the same field?
Try this:
USE YourDataBase
GO
EXEC sp_MSForEachTable 'ALTER TABLE ? ALTER COLUMN TheNameOfTheColumn (rest of the ALTER COLUMN syntax)'
GO
NOT TESTED!
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform