Re: **different place for creating a new table**
From: Dan Guzman (danguzman_at_nospam-earthlink.net)
Date: 06/06/04
- Next message: tracy: "Re: getting order position"
- Previous message: Lloyd Sheen: "Re: Data Retrieval From Online Database - Paid Consultant Required"
- Maybe in reply to: Uri Dimant: "Re: **different place for creating a new table**"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 6 Jun 2004 10:02:45 -0500
Both the Enterprise Manager and Query Analyzer tools allow you to specify
the desired owner when you create a table. The difference is that EM always
specifies the owner explicitly in its internally generated script but QA
lets you enter free-form DDL. Since you omitted the owner in the script you
executed in QA, the SQL Server default owner was used.
If you want to create the tables using QA the same way EM does, specify the
desired owner explicitly like the example below. This is a good practice
since it avoids the ambiguity you've encountered.
CREATE TABLE dbo.T1
(
MyColumn int NOT NULL
)
--
Hope this helps.
Dan Guzman
SQL Server MVP
"RM" <m_r1824@yahoo.co.uk> wrote in message
news:opr85w1bwihqligo@msnews.microsoft.com...
> so when I use a dbowner "L1" login in query analyzer,
> why my table saves with the name of "L1.T1"?
> if the member of db_owner can create table with
> their names or with static name called dbo,it should
> be the same in these 2 enviroments (Query Analyzer,Enterprise manager)
> isn't it logic?
>
> On Sun, 6 Jun 2004 09:38:55 +0200, Uri Dimant <urid@iscar.co.il> wrote:
>
> > RM
> > BOL says:
> > Only objects created by members of the sysadmin fixed server role (or by
> > the
> > dbo user) belong to dbo. Objects created by any other user who is not
> > also a
> > member of the sysadmin fixed server role (including members of the
> > db_owner
> > fixed database role):
> >
> > a.. Belong to the user creating the object, not dbo.
> >
> >
> > b.. Are qualified with the name of the user who created the object.
> > "RM" <m_r1824@yahoo.co.uk> wrote in message
> > news:opr85p4f08hqligo@msnews.microsoft.com...
> >> hi
> >>
> >> I want to create a new table "T1" in my database called "db1" in SQL
> >> server 2000 with a db_owner user,("L1","U1")
> >> I did it successfully in 2 ways ,but there was a difference in result:
> >> 1) I created in enterprise manager
> >> as I logined with L1 ,and when I saw T1 in
> >> query analyzer table list in db1 it was in shape
> >> of "dbo.t1".
> >> 2) I created it programatically as I logined
> >> with L1 in query analyzer and the shape of
> >> result appearred in table list of db1 in left
> >> window of query analyzer was "L1.t1".
> >> why??????
> >> what's the difference?
> >> why when I logined in enterprise manager as
> >> L1,it saved my table as dbo?
> >>
> >> any help would be greatly appreciated.
> >
> >
>
- Next message: tracy: "Re: getting order position"
- Previous message: Lloyd Sheen: "Re: Data Retrieval From Online Database - Paid Consultant Required"
- Maybe in reply to: Uri Dimant: "Re: **different place for creating a new table**"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|