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 |
|
Kyriakos
Starting Member
13 Posts |
Posted - 2007-11-30 : 07:42:46
|
| Hi I have a table like:LIB TABLENAME TABLEDESCR FIELDNAME FIELDDESCRBISxxSET ALPA0A sometable BS12A0 somefieldBISxxSET ALPA0A sometable PERCA0 somotherfieldBISxxSET ALPA1A someothertable CMPNA1 somefield2BISxxSET ALPA1A someothertable MERIA1 someotherfield2BISFFBUA ALPA1A anothertable PAARS somefield3and would like to create views for each distinct table, using openrowset.An added complexity is that the library name depends on the company code (i.e. BISxxSET.ALPA0A turns to BIS03SET.ALPA0A for company 03 whereas BSFFBUA.ALPA1A remains intact).Thanks in advanceKyriakos |
|
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2007-12-02 : 00:18:12
|
| Why create views using openrowset? The table is on remote sql server? |
 |
|
|
Kyriakos
Starting Member
13 Posts |
Posted - 2007-12-03 : 02:52:49
|
| Yes the table is on a remote server - DB2 server actually. |
 |
|
|
Kyriakos
Starting Member
13 Posts |
Posted - 2007-12-04 : 07:50:05
|
| Could I use variable name when creating the view?Is CREATE VIEW @VAR1 acceptable? |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-12-04 : 07:56:17
|
quote: Originally posted by Kyriakos Could I use variable name when creating the view?Is CREATE VIEW @VAR1 acceptable?
Not possible until you use Dynamic sqlRead about Linked Server in sql server help fileMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|