Saturday, February 25, 2012

Problem with default schema

Hi

I have a user database say Solumina. There is a login defined on the instance of sql 2005 server , say XYZ. There is also a user defined XYZ in the database mapped to the login 'XYZ' with the default schema as 'sfmfg' (Assume that 'sfmfg' schema already exists).

My question when I try to create a random table with the following syntax it gets created in the dbo schema instead of the sfmfg schema (I am using sfmfg login credentials).

create table t1(id int)

Can some 1 please help out.

Regards

Imtiaz

Is sfmfg a member of db_owner role? It is always safer to use 2-part names in your objects so that you know explicitly the schema for the object.

No comments:

Post a Comment