I'm trying to get a user to create tables in a schema that is set as their default schema and they are set as the owner of the schema.
When I run this command, even though their default schema isn't [dbo]
, it still creates the table under the [dbo]
schema
EXECUTE AS USER = 'test'
CREATE TABLE TEST (T VARCHAR(10))
REVERT
The reason I'm looking to do this, is because the program that we're using, by default, uses the [dbo] schema to replicate data. It states in the documentation that tables will use the schema prefix of which user is running the stored procedure.
Is this possible? Any new tables created by this user, I want it to use their default schema instead of [dbo]
EXECUTE AS
? I would have thought it would use their default schema here