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 |
Initiaters
Starting Member
4 Posts |
Posted - 2010-05-07 : 08:31:46
|
Hello All,I have created a database having different schemas like dbo.table1 and mohit.table2.Now i have created a user and giving DB Roles as public and db_owner.now i am opening sql analyser and logged in by the user created and trying to access table1 AND table2 without using there schema (i.e. dbo and mohit)but i am unable to access mohit.table2...Please help..!!!regardsMohit |
|
apodemus
Starting Member
30 Posts |
Posted - 2010-05-07 : 08:38:16
|
what is the problem using schema before table name?apodemus |
 |
|
tosscrosby
Aged Yak Warrior
676 Posts |
Posted - 2010-05-07 : 11:41:12
|
If schema owner is not specified, it defaults to dbo (see link below about default schema). In 2005 (and I guess 2008), you can change the schema default by user. Personally, use the schema owner in the script so your certain which table you are accessing, leave the guess-work to someone else.http://msdn.microsoft.com/en-us/library/ms190387.aspxTerry-- A word to the wise ain't necessary - it's the stupid ones that need the advice. -- Bill Cosby |
 |
|
Initiaters
Starting Member
4 Posts |
Posted - 2010-05-08 : 02:31:20
|
let me clear my requirement..why not to use schemaWe are building web application in which we are fetching data from diferent-different tables having different schemas and it is more preferable that do not use schema before table name while running query..!!!plz help... |
 |
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2010-05-08 : 05:47:41
|
You must ensure that when you set up schemas - tables , that your app can manage the requirement to create the queries with schema_name.table. Note: comments made by tosscrosby aboveJack Vamvas--------------------http://www.ITjobfeed.com |
 |
|
|
|
|