July 25, 2013 at 1:31 pm
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
March 18, 2014 at 10:02 am
Did you ever find a resolution to this issue? I have the same problem.
March 25, 2014 at 2:43 pm
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.
March 26, 2014 at 12:14 am
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."
March 26, 2014 at 12:35 am
Move the comment header to between the lines ALTER/CREATE PROC and AS.
March 26, 2014 at 12:55 am
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."
March 26, 2014 at 5:01 am
What if 1000 PROC is replicating? Need to edit 1000 PROC?
Yep.
March 26, 2014 at 6:13 am
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
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply