[EMAIL PROTECTED] wrote: > All, > > I'm using SQL Server and we login in under an account other than dbo > When I do my cfquery's, they won't work select * from tablename unless > I use select * from username.tablename. > > Why is this and do I want to use fully qualified objects? > > Thanks. > > D
If an object is not qualified, then SQL Server will try to find that object... Assume the user is: bob SELECT foo FROM bar SQL Server first looks for bob.bar and then for dbo.bar, and uses whichever one it finds first. If the object is owned by betty (betty.bar), then user bob will not find it without qualifying. This can be an issue if you are used to creating objects as dbo, and then inadvertently create one as another user... In the above example, you had inadvertently created both a bob.bar and a dbo.bar..and you are really looking for the data from dbo.bar...if you run the query without qualifying the object, it is going to return data from bob.bar, and may cause you some confusion till you look in enterprise manager, and see two objects named bar. So it is probably good practice to qualify your objects...especially when creating through query analyzer...if you are logged on as bob and do a CREATE TABLE foo..., then that table will be created as bob.foo, where you may really want it as dbo.foo. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:255721 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

