sql server replication:
I am new to SQL Server replication. For some reason, in Microsoft SQL
Server Management Studio (for SQL Server 2005), if I run an "alter function"
statement, "alter procedure" statement, or "alter view" statement, for an
object that is an article in a merge publication, the command never
finishes. Last night I left an "alter function" statement running, and it
was still "executing query" this morning. An "alter table table_1 add
newColumn varchar(10) null" works for a table that is an article in a merge
publication.
This issue occurs even with a SQL Server 2005 database with just one table,
one view, and one UDF. I created a merge publication that only had one
article in it -- for the UDF. When I run the following
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER FUNCTION [dbo].[UDF1] ( @param1 nvarchar(15), @param2 nvarchar(15) )
RETURNS nvarchar(46)
AS
BEGIN
RETURN @param1 + ' ' + @param2
END
it just says "Executing query..." and never finishes.
If in the publication properties I set "Replicate schema changes" to False,
then the "alter function" statement finishes.
The publication doesn't currently have any subscribers. (The same issue
occurs when there is a subscriber.)
According to
http://msdn2.microsoft.com/en-us/library/ms152562(SQL.90).aspx,
tables, views, procedures, UDF's, and triggers that are in publications can
be modified using "alter". I was able to make such changes in the past when
doing some earlier testing, but now it isn't working. (I don't remember if
I used the "alter" statements then or made schema changes by some other
means.) I researched Agents for a while, brainstorming that perhaps there
were some failed jobs in a queue from the past that maybe SQL Server Agent
was trying to run. That didn't seem to be related, because I disabled all
jobs listed under SQL Server Agent / Jobs in the Object Explorer in
Microsoft SQL Server Management Studio, and the "alter function" statement
still hung.
Nels