I am using the publish to provider feature in .net 2008 to produce a database creation script.
In the script exists the following line:
/****** Object: Role [srvTTAS] Script Date: 01/20/2010 09:14:14 ******/
IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = N'srvTTAS')
BEGIN
IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = N'srvTTAS' AND type = 'R')
CREATE ROLE [srvTTAS]
This causes a problem as I have a USER called "srvTTAS" setup in my database, and not a role. So when I run this script I have to manually delete the role in order to create a user of the same name. This means the script produced does not create a exact copy of the database in question, is there a way to make publish to provider create a user? (as I have specified in the database?)