x

dbo schema not showing for tables when tables are created with SQL login

I create a table in sql server 2005 database table_1 with sql login "abc" and the table name appears as abc.Table_1, while if I create table on other 2005 server it appears as dbo.Table_1.

Is there any specific reason for this different behaviour.

sql logins at both the server has dbowner right.

more ▼

asked Apr 30, 2010 at 12:28 PM in Default

avatar image

Bhaskar
333 17 19 24

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

On the first server the default schema for your user 'abc' is 'abc'.

On the second server the default schema for your user is 'dbo', (this is always the case when the user is the database owner).

more ▼

answered Apr 30, 2010 at 12:34 PM

avatar image

Kev Riley ♦♦
64k 48 61 81

It is considered a dangerous practice not to specify schema when creating tables. If you would do the right thing then there will never be any ambiguity. In other words, the statement creating a table should look like create table [JO_SCHEMA].[JO_TABLE] rather than create table [JO_TABLE] – Oleg 0 secs ago

Apr 30, 2010 at 12:49 PM Oleg
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x2018
x38
x5

asked: Apr 30, 2010 at 12:28 PM

Seen: 3246 times

Last Updated: May 02, 2010 at 05:06 AM

Copyright 2016 Redgate Software. Privacy Policy