| Author |
Topic |
|
dr223
Constraint Violating Yak Guru
444 Posts |
Posted - 2009-06-24 : 11:02:16
|
| Hallo, I have 2 tables in my SQL database as dbo.o_prac and and dbo.o_pat. Is there anyway I can change the names to o_prac and o_pat only. i.e, the schema to be empty. Or is there any other way the tables can be read as o_prac and o_pat. The tables need to be set to o_prac and o_pat as an entire application depends on the table name as so, before making an ODBC connection Any help please!! Thanks |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2009-06-24 : 12:09:32
|
| If you're using SQL 2005, check out SYNONYMS.Jim |
 |
|
|
blindman
Master Smack Fu Yak Hacker
2365 Posts |
Posted - 2009-06-24 : 12:19:28
|
| You should not need to include the schema name when referencing them if that is the default schema for your login.________________________________________________If it is not practically useful, then it is practically useless.________________________________________________ |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-06-24 : 12:40:44
|
quote: Originally posted by dr223 Hallo, I have 2 tables in my SQL database as dbo.o_prac and and dbo.o_pat. Is there anyway I can change the names to o_prac and o_pat only. i.e, the schema to be empty. Or is there any other way the tables can be read as o_prac and o_pat. The tables need to be set to o_prac and o_pat as an entire application depends on the table name as so, before making an ODBC connection Any help please!! Thanks
you can neglect the schema name provided the objects are only present in that schema |
 |
|
|
dr223
Constraint Violating Yak Guru
444 Posts |
Posted - 2009-06-25 : 06:27:31
|
| Please can you tell me the process I can neglect the schema? Both tables are in the same schema dbo.I just want them to be o_prac and o_pat and not dbo_o_prac and dbo_o_pat... Thanks |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-06-25 : 06:40:18
|
If "dbo" is the default schema, yes then you don't need to reference the schema.But the query will be a little slower since the algebrizer in the query engine has to do an extra lookup. E 12°55'05.63"N 56°04'39.26" |
 |
|
|
dr223
Constraint Violating Yak Guru
444 Posts |
Posted - 2009-06-25 : 06:54:30
|
| Anyway I can afford that as am working with millions of records at one go Thanks |
 |
|
|
dr223
Constraint Violating Yak Guru
444 Posts |
Posted - 2009-06-25 : 06:57:25
|
| sorry for one record it has taken so far 5 minutes and no data has been pulled yet!!any other method please |
 |
|
|
dr223
Constraint Violating Yak Guru
444 Posts |
Posted - 2009-06-25 : 06:59:49
|
| Peso Is there anyway my table can read o_prac rather than dbo.o_prac?Please advise |
 |
|
|
blindman
Master Smack Fu Yak Hacker
2365 Posts |
Posted - 2009-06-25 : 10:38:12
|
| No. Every object, including tables, has to belong to a schema.________________________________________________If it is not practically useful, then it is practically useless.________________________________________________ |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-06-25 : 13:08:01
|
quote: Originally posted by dr223 Peso Is there anyway my table can read o_prac rather than dbo.o_prac?Please advise
does o_prac exist in more than 1 schema? |
 |
|
|
|