SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SQL Replication - Missing Stored Procedure Comment Header


SQL Replication - Missing Stored Procedure Comment Header

Author
Message
sudonjn
sudonjn
SSC Rookie
SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)

Group: General Forum Members
Points: 40 Visits: 220
I have recently started using replication in SQL 2012 SP1. When a stored procedure is altered on the source, the changes are replicated to the subscribers; however, the comment headers are removed at the subscribers. Due to the vast number of stored procedures I have, I do not want to move the comments below the Create Procedure statement. Are there any other ways to have comment header move with the stored procedures?

Here is what I am experiencing

Source SP

-- =============================================
-- Author: User
-- Create date: now
-- Description: here
-- =============================================
ALTER PROCEDURE [dbo].[SPTest]
AS
BEGIN
SELECT GETDATE()
END


Destination SP


ALTER PROCEDURE [dbo].[SPTest]
AS
BEGIN
SELECT GETDATE()
END
slammi
slammi
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 423
Did you ever find a resolution to this issue? I have the same problem.
SQLBlimp
SQLBlimp
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1126 Visits: 500
sudonjn (7/25/2013)
I have recently started using replication in SQL 2012 SP1. When a stored procedure is altered on the source, the changes are replicated to the subscribers; however, the comment headers are removed at the subscribers. Due to the vast number of stored procedures I have, I do not want to move the comments below the Create Procedure statement. Are there any other ways to have comment header move with the stored procedures?

Here is what I am experiencing

Source SP

-- =============================================
-- Author: User
-- Create date: now
-- Description: here
-- =============================================
ALTER PROCEDURE [dbo].[SPTest]
AS
BEGIN
SELECT GETDATE()
END


Destination SP


ALTER PROCEDURE [dbo].[SPTest]
AS
BEGIN
SELECT GETDATE()
END


Sorry, the only way to get what you want is to place the comments after the CREATE/ALTER STORED PROCEDURE statement.

JT.
free_mascot
free_mascot
Hall of Fame
Hall of Fame (4K reputation)Hall of Fame (4K reputation)Hall of Fame (4K reputation)Hall of Fame (4K reputation)Hall of Fame (4K reputation)Hall of Fame (4K reputation)Hall of Fame (4K reputation)Hall of Fame (4K reputation)

Group: General Forum Members
Points: 3989 Visits: 2235
Replication will take care of all the SP and not the part of the SP. It is good that initial information comments to track the changes. If replication do this than it will be intigrity issue and most of DBA won't like this.

I do not think with replication it is possible.

Can you pl. specify why you would like to do this? What happen if comments are there?

HTH

---------------------------------------------------
"Thare are only 10 types of people in the world:
Those who understand binary, and those who don't."
Cody Konior
Cody Konior
SSC-Addicted
SSC-Addicted (433 reputation)SSC-Addicted (433 reputation)SSC-Addicted (433 reputation)SSC-Addicted (433 reputation)SSC-Addicted (433 reputation)SSC-Addicted (433 reputation)SSC-Addicted (433 reputation)SSC-Addicted (433 reputation)

Group: General Forum Members
Points: 433 Visits: 1105
Move the comment header to between the lines ALTER/CREATE PROC and AS.
free_mascot
free_mascot
Hall of Fame
Hall of Fame (4K reputation)Hall of Fame (4K reputation)Hall of Fame (4K reputation)Hall of Fame (4K reputation)Hall of Fame (4K reputation)Hall of Fame (4K reputation)Hall of Fame (4K reputation)Hall of Fame (4K reputation)

Group: General Forum Members
Points: 3989 Visits: 2235
Cody K (3/26/2014)
Move the comment header to between the lines ALTER/CREATE PROC and AS.

What if 1000 PROC is replicating? Need to edit 1000 PROC?

---------------------------------------------------
"Thare are only 10 types of people in the world:
Those who understand binary, and those who don't."
Cody Konior
Cody Konior
SSC-Addicted
SSC-Addicted (433 reputation)SSC-Addicted (433 reputation)SSC-Addicted (433 reputation)SSC-Addicted (433 reputation)SSC-Addicted (433 reputation)SSC-Addicted (433 reputation)SSC-Addicted (433 reputation)SSC-Addicted (433 reputation)

Group: General Forum Members
Points: 433 Visits: 1105
What if 1000 PROC is replicating? Need to edit 1000 PROC?


Yep.
slammi
slammi
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 423
Thanks for those who responded. I have not found any resolution. We are using replication for the short term in preparation for migrating all databases to a virtual server running SQL. We have decided to take this opportunity to review all stored procedures for accurate and usefull comments and modify only those where that comment adds value. In larger organizations this probably is not practical but for us it will work. I will script out alll stored procedures and save a copy of the original just to be safe and will not stress about any where the comments go missing.

I have to say it would have been a handy piece of information to have been highlighted before we got this far down the road but once explained I get it.

Thanks again
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search