Schema (dbo) not scripted to all script files
jamal
Posts: 47 Bronze 3
I ran a comparison between a live database object and that same object in a script folder (that sql compare scripted out earlier). Both objects are owned by dbo. The scripted file's create command is:
Create Procedure dbo.ProcName
They compare the same when there are no other differences. However, when there are other differences between the server and the script file, the object name is marked as a difference. My biggest problem is if I script from the server to the script file, the dbo. is removed from the script file. Then, with our security setup, if I try to push that newly generated file to the same server it was scripted from the server forces the owner of the object to my windows account:
[Domain\userName].ProcName
Why is Sql Compare removing the dbo. from the scripted procedure name? Is there an option I haven't found to force this to stick?
Create Procedure dbo.ProcName
They compare the same when there are no other differences. However, when there are other differences between the server and the script file, the object name is marked as a difference. My biggest problem is if I script from the server to the script file, the dbo. is removed from the script file. Then, with our security setup, if I try to push that newly generated file to the same server it was scripted from the server forces the owner of the object to my windows account:
[Domain\userName].ProcName
Why is Sql Compare removing the dbo. from the scripted procedure name? Is there an option I haven't found to force this to stick?
James
Comments
We've attempted to apply solutions to this a few times, but we're rather wary of actually editing people's stored procedures (which is what fixing this would basically be doing) because we don't want to assume that people didn't mean to create them like that...
Redgate Software
There are many cases where you can create/alter an object, then use GUI tools to change that objects owner. Would this still script as the original owner and not the current owner?
I think this should be an option in SQL Compare. It is the default for how SSMS scripts objects.[/i]
I've added a link to this post to the existing feature request for such an option, so it's possible we'll pick it up to implement in future versions.
Redgate Software