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 |
|
venkath
Posting Yak Master
202 Posts |
Posted - 2006-12-01 : 00:59:18
|
| Hi allI need to create around 50 views bases on another database as followsCREATE VIEW addressAS SELECT *FROM a2pdb.dbo.address CREATE VIEW carrierAS SELECT *FROM a2pdb.dbo.carrierk....how can i execute all those commands in a one shot..Thanks |
|
|
Kristen
Test
22859 Posts |
Posted - 2006-12-01 : 03:25:10
|
| [code]SELECT 'CREATE VIEW ' + TABLE_NAME + 'AS SELECT *FROM a2pdb.dbo.' + TABLE_NAME + CHAR(13) + CHAR(10) + 'GO'FROM INFORMATION_SCHEMA.TABLES[/code]Not good for performance to use SELECT * though.Kristen |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-12-01 : 04:24:21
|
| Do you want to get different resultsets or one resultset having all data?MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|