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 Administration
 permissions issue

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..!!!


regards
Mohit



apodemus
Starting Member

30 Posts

Posted - 2010-05-07 : 08:38:16
what is the problem using schema before table name?

apodemus
Go to Top of Page

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.aspx

Terry

-- A word to the wise ain't necessary - it's the stupid ones that need the advice. -- Bill Cosby
Go to Top of Page

Initiaters
Starting Member

4 Posts

Posted - 2010-05-08 : 02:31:20
let me clear my requirement..why not to use schema

We 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...
Go to Top of Page

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 above

Jack Vamvas
--------------------
http://www.ITjobfeed.com
Go to Top of Page
   

- Advertisement -