Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SQL Replication - Missing Stored Procedure Comment Header Expand / Collapse
Author
Message
Posted Thursday, July 25, 2013 1:31 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, August 5, 2014 6:28 AM
Points: 22, Visits: 200
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
Post #1477704
Posted Tuesday, March 18, 2014 10:02 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, August 21, 2014 10:22 AM
Points: 2, Visits: 270
Did you ever find a resolution to this issue? I have the same problem.
Post #1552293
Posted Tuesday, March 25, 2014 2:43 PM


SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: 2 days ago @ 2:59 PM
Points: 653, Visits: 324
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.
Post #1554689
Posted Wednesday, March 26, 2014 12:14 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, July 21, 2014 2:56 AM
Points: 2,603, Visits: 2,061
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."
Post #1554781
Posted Wednesday, March 26, 2014 12:35 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Monday, August 25, 2014 4:31 PM
Points: 215, Visits: 843
Move the comment header to between the lines ALTER/CREATE PROC and AS.
Post #1554785
Posted Wednesday, March 26, 2014 12:55 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, July 21, 2014 2:56 AM
Points: 2,603, Visits: 2,061
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."
Post #1554791
Posted Wednesday, March 26, 2014 5:01 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Monday, August 25, 2014 4:31 PM
Points: 215, Visits: 843
What if 1000 PROC is replicating? Need to edit 1000 PROC?


Yep.
Post #1554882
Posted Wednesday, March 26, 2014 6:13 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, August 21, 2014 10:22 AM
Points: 2, Visits: 270
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
Post #1554906
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse