| Author |
Topic  |
|
|
bwakefield
 1 Posts |
Posted - 09/10/2009 : 12:52:50
|
Hello. I have an issue trying to create a "shell" database from scripts (Database Builder version 5.0.0.1092). Most of the objects do get created, but there are some stored procedures which have problems. The error is similar to below: Error in C:\xxx\Stored Procedures\dbo.up_MyProc.sql Msg 15151, Level 16, State 1, Line 1 Cannot find the user 'joe', because it does not exist or you do not have permission.
The stored proc script is a pretty standard format with an “If exist/drop” in the beginning, and the “Grant execute” at the bottom. The user does exist on the database, but isn’t scripted out and under the the .\Logins folder as having permissions to the new db. In the past, the object would still get created, just with the exclusion of the user permissions. With this newer version, the object isn’t created at all. Almost like the whole stored procedure script is in a transaction and is rolled back on any error.
We often would deploy to many different environments (dev, test, uat, production, etc.) and we don’t have all the same users with all the same permissions in every environment.
Has anybody experienced this before? And, any suggestions on how to better work around this?
Thanks, Bruce
|
|
|
dbghost

13 Posts |
Posted - 09/11/2009 : 06:20:22
|
Hi Bruce,
If you uncheck the "Include Permissions" option the Sproc scripts will not include the GRANT stmts. This will allow the object to be created without the error.
I am assuming you have deliberately chosen not to script out the logins and users.
Hope this helps you. |
 |
|
| |
Topic  |
|
|
|