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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Multiple OpenRowset Views

Author  Topic 

Kyriakos
Starting Member

13 Posts

Posted - 2007-11-05 : 10:29:38
I have a large list of table names and want to create a database, and a view for each of the tables with openrowset. There are no constrains no keys nothing. Is there a fast way to achieve that?

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-11-05 : 10:34:50
Why OPENROWSET? Is it remote database?

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

Kyriakos
Starting Member

13 Posts

Posted - 2007-11-05 : 20:44:59
yes it is a remote -non sqlserver db- and the tables should be created as views in sqlserver
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-11-05 : 21:19:48
Using liked server is easier.
Go to Top of Page

Kyriakos
Starting Member

13 Posts

Posted - 2007-11-07 : 08:58:51
it might be easier using linked servers but it's also out of the question.
The way I'm thinking it, it should involve a loop with a create view statement containing the name of the table from a subselect (select distinct(tablename) from tables) passed as a variable
Go to Top of Page
   

- Advertisement -