Thursday, March 22, 2012

Creating tables within my application.

I am having the following problem and any help would be GREATLY
appreciated:

In an application I am developing, at some points we create a new
table. When I create this table on another users box, I can not access
it from my box. In sql server I am dbo, but the table created by my
application when run on a different box has an owner of : "FC\xxxx". I
have sent permissions on this thing to public, but I am still getting
an error when I try to query this thing from my application. And I can
not get query analyzer to recognize this thing. I can see it in
Enterprise manager. I would think there is a way to handle this sort
of thing. If anyone out there has done anything like this I would be
much obliged for any ideas. Thanks.
Sincerely,
Ed Hawkes
olaamigoquepasa@.nospamplease-hotmail.comEd Hawkes (olaamigoquepasa@.hotmail.com) writes:
> I am having the following problem and any help would be GREATLY
> appreciated:
> In an application I am developing, at some points we create a new
> table. When I create this table on another users box, I can not access
> it from my box. In sql server I am dbo, but the table created by my
> application when run on a different box has an owner of : "FC\xxxx". I
> have sent permissions on this thing to public, but I am still getting
> an error when I try to query this thing from my application. And I can
> not get query analyzer to recognize this thing. I can see it in
> Enterprise manager. I would think there is a way to handle this sort
> of thing. If anyone out there has done anything like this I would be
> much obliged for any ideas. Thanks.

If you are logged into SQL Server as FC\ABC and this user is not dbo,
the the tables will be owned by FC\ABC. For other users to refer to
this table, they would have to say

SELECT * FROM [FC\ABC].tbl

That is they must specify the owner. If this is not desireable, you would
have to say:

CREATE TABLE dbo.tbl (...)

and the table will be owned by dbo. This may require more privledges
than you have granted today.

Generally, having users creating tables is nothing you would normally
do. Chances are, that there is some basic flaw in your design. But since
I don't know anything about your system, I may be completely wrong on
that point.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

No comments:

Post a Comment