Mike
Mike

Reputation: 5509

How can I create SQL Server Users based on build configuration using SSDT?

I am new to SSDT so hopefully this is an easy one. I would like to script different users based on build configuration in my database project. Is the only way to accomplish that by using SQLCMD variables and Post Deployment Scripts?

Upvotes: 0

Views: 149

Answers (1)

Peter Schott
Peter Schott

Reputation: 4681

Mike, as far as I know the only easy-ish way to do this is with SQLCMD variables and post-deploy scripts. You could probably code something that would parse the generated script and tweak it for each environment, but using the post-deploy scripts will be far easier in the long run.

I've blogged about this, building on Jamie Thomson's idea. http://schottsql.blogspot.com/2013/05/ssdt-setting-different-permissions-per.html

Upvotes: 1

Related Questions