all groups > sql server replication > december 2004 >
You're in the

sql server replication

group:

Snapshot Rep of SP's changes [ ]'s to quotes


Snapshot Rep of SP's changes [ ]'s to quotes weluvpaul NO[at]SPAM hotmail.com
12/13/2004 7:32:00 AM
sql server replication:
Hi, I am currently running SQL Server SE with SP3 on all of our
servers. I recently set up snapshot replication of stored procedures
from our main server to all of it's satellites. The SP's are being
altered though because on the subscriber, the [ ]'s have been changed
to quotes, as in this example:

CREATE PROCEDURE [dbo].[Time_Lookup] @Personnel as smallint, @TimeDate
as smalldatetime AS

CREATE PROCEDURE "Time_Lookup" @Personnel as smallint, @TimeDate as
smalldatetime AS

As you can see it is also dropping the owner, I'm assuming it defaults
to dbo but I would like my stored procedures to remain consistent from
server to server. Any ideas what causes this and what needs to be
changed to make stored procedures rep out as is?
Another thing that we have had problems with is that the SP's lose
their permissions when replicated and we have to run a post-snapshot
script to grant execute on them to the necessary role. So if you know
Re: Snapshot Rep of SP's changes [ ]'s to quotes Paul Ibison
12/13/2004 8:12:30 PM
Have a look at the article properties tab - there is the option to set the
owner of objects to be other than dbo. As for the permissions they don't get
replicated by design. I used to have post-snapshot scripts, but as I have
the same users on the subscriber, and a rapidly changing environment, I use
the script I posted up on www.replicationanswers.com to automatically
generate a permissions script and run it whenever anything changes.
HTH,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

Re: Snapshot Rep of SP's changes [ ]'s to quotes Paul T.
12/14/2004 7:01:03 AM
Thanks Paul, I specified the owner in the article and that seems to work
great. I will definetly look into that script to grant permissions, that
sounds awesome. The only problem that is unresolved now is that the
replication is converting [ ] s in my stored procedures to quotes. Any idea
why this is?

[dbo][my_stored_proc] ---> "dbo" "my_stored_proc"
Re: Snapshot Rep of SP's changes [ ]'s to quotes Paul Ibison
12/14/2004 9:12:09 AM
Quick question: Why is this a problem? if
Quoted_Identifiers is set to on, they will be equivalent.
Rgds,
Re: Snapshot Rep of SP's changes [ ]'s to quotes Paul T.
12/14/2004 9:57:03 AM
Well, its not a big problem because like you say it still runs the same. I
just find them more readable with the []'s and then they are consistent with
what we have on our publishing server. If there is no way to do it, I can
live with that, but I thought if anyone does have an answer, then thats even
better. Thanks for your help thus far Paul.

[quoted text, click to view]
Re: Snapshot Rep of SP's changes [ ]'s to quotes Raymond Mak [MSFT]
12/17/2004 2:21:10 PM
Hi Paul T.,

For a long while, the SQL Replication team had a very strong focus on
supporting non-SQL Server subscribers, and since using [] for quoting
identifiers is not something generally understood\accepted by other dbms, we
(or someone) came up with the idea of converting all the [] to " on the fly.
That sort of got stuck as it is easy to break something obscure when one of
us tries to change it. Perhaps we will have a chance to clean this up in the
future.

-Raymond

--
This posting is provided "as is" with no warranties and confers no rights.


[quoted text, click to view]

AddThis Social Bookmark Button