Reputation: 2227
I don't really know where this question should go so I've added all that I feel apply.
I have SQL Server 2016 installed on WS 2012 with IIS. Create an empty database (No tables) and a SQL user and password. I host a site in IIS built with ASP .Net and go to its admin webpage. This consists of selecting the database I created above. Everything runs successfully.
The problem I am coming across is each table adds a schema in the format "IIS AppPool\DatabaseUsername.Tablename" so IIS_AppPool\MyUser.Customers.
I don't know why it does it so I have tried, running the site from the server, from a network PC, adding permissions to Network Service and other accounts but no matter what I do, the database tables all have this schema attached to it. How could I stop it from adding it?
Upvotes: 0
Views: 24
Reputation: 46231
It looks like the scripts do not schema-qualify object names. In that case, objects created by that user are created in the user's default schema. You can specify the desired default schema for an individual user with T-SQL statement:
ALTER USER [IIS AppPool\DatabaseUsername] WITH DEFAULT_SCHEMA = dbo;
Upvotes: 1