sql - Why are tables created with default schema dbo although I specified a different schema? -
if run sql script in sql server 2005 ssms (version 9.00.4035.00) like
create table xxx.mytable
the table created dbo.mytable although schema xxx exist! no error message!
the user i'm using run script permissions (tested windows user , sql user server role sysadmin)
what's wrong?
you have 2 tables now
- xxx.mytable
- dbo.mytable
to check:
select schema_name(schema_id), name, create_date, modify_date sys.objects name = 'mytable'
don't rely on ssms object explorer: needs refreshed (right click on tables node, refresh).
or wrong database, wrong server etc.
we use schemas , never had problems
edit: check databases
exec sp_msforeachdb ' use ? select schema_name(schema_id), name, create_date, modify_date sys.objects name = ''mytable'' '
Comments
Post a Comment