Solved

username instead of dbo while creating the table

Posted on 2011-03-02
9
657 Views
Last Modified: 2012-05-11
http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/Q_26855708.html

This is on continuation to the Q that the link refers to:
When the user is trying to create a table..it is showing as [username].[tablename] instead of [dbo].[tablename]
0
Comment
Question by:anilkullam
  • 5
  • 2
  • 2
9 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 250 total points
Comment Utility
you have to specify
CREATE TABLE dbo.tablename
to get dbo as owner.
other wise, it will be the username as default.

unless the username has the db_owner role, in that case, the default is dbo indeed, and not the username
0
 

Author Comment

by:anilkullam
Comment Utility
yeah i did conveyed the same to the user, but since they are running DTS packages wherein some tables are created (it is here that the schema is becoming a problem) and when comparing it with tables with dbo schema the dts is failing....previously when the users complained that they were not able to see jobs in the server, I have added the user under msdb targetserverrole n nothing else...
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
so, in the DTS, they have to prefix the table names also by the schema name ...
0
 
LVL 50

Expert Comment

by:Lowfatspread
Comment Utility
what have you got the users default schema set to?

0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:anilkullam
Comment Utility
nothing...they were existing users on the server....prefixing the names to the DTS i think no...they were just executing them and no inputs and it is after getting the error  that they can get to know that something is wrong
0
 

Author Comment

by:anilkullam
Comment Utility
how do I change schema for this particular user in sql server 2000.
starting 2005 we will be able to do this the following way but I need to do it in SQL Server 2000... help guys
USE AdventureWorks2008R2;
ALTER USER Mary51 WITH DEFAULT_SCHEMA = Purchasing;
GO
0
 

Author Comment

by:anilkullam
Comment Utility
@lowfatspread:Im not sure if we can set default schema in sql server 2000 since schema is introduced in 2005, however can u pls share ur views on the same

Also sorry for the extended delay
0
 
LVL 50

Assisted Solution

by:Lowfatspread
Lowfatspread earned 250 total points
Comment Utility
sql 2000 no i don't think you can either...

what are your users creating tables for?

why give them that ability?
0
 

Author Closing Comment

by:anilkullam
Comment Utility
finally I gave admin rights since they were also part of the group and guess it fixed the prob since they didnt complain further and also with sa rights the schema will be default as dbo even in sql server 2000.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now