简体   繁体   中英

Install database without automated schema

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?

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;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM