Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
akshayaarora
Starting Member
1 Post |
Posted - 2005-08-03 : 16:36:52
|
| How to add a column (one particular column) to all the existing user defined tables in a database in SQL Server 2000?Thanks |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2005-08-03 : 16:38:31
|
| Loop through INFORMATION_SCHEMA.TABLES and use dynamic SQL to execute ALTER TABLE ADD ColumnName...Tara |
 |
|
|
Hunglech
Starting Member
16 Posts |
Posted - 2005-08-04 : 03:58:11
|
| SELECT 'ALTER TABLE ' + name + ' ADD ColumnName Type' FROM sysobjects WHERE type = 'U' |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-08-04 : 04:09:19
|
| It is better to avoid using system tablesAs Tara said, use thisSelect 'Alter table '+table_name+' add columname Type' from information_Schema.tables where table_type='Base Table'MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|