SS2005 Replication: Can You Replicate Constraints Without Reinitializing?
Jan 11, 2007
We have a two SQL Server 2005 databases set up using Transactional Replication. My manager has asked me to set it up to replicate constraints (default, fk, et) on the tables in the main publication. I said sure, I can do it, but I will have to re-initialize the subscription. He said there was a way to do it without re-initializing the subscription. I cannot find anything in my research to indicate that there is a method to do so (via call sp_ functions, etc). Is it indeed possible to replicate constraints on replicated tables without re-initializing the who subscription? The reason he does not want me to perform a re-initialization is that we are a few weeks before moving into production, and a full re-initialization takes 1.5 days, which would impact system availability.
Thanks in advance for any advice.
View 1 Replies
ADVERTISEMENT
Mar 23, 2004
Hi all,
I'm admitedly a bit new to the world of replication, so please bear with me. I've got two SQL Server 2000 servers running in different locations. Server A does transactional replication over a push subscription to server B. If I need to make a minor change to one of the replicated tables (for example, dropping a no longer used column or changing a varchar field's length) do I need to drop the subscription, make the changes and then re-initialize the schemas and data?
For minor changes, I really hate having to knock out the site runnign off server B while the subscription is re-initialized and data is bulk copied back over. If I want to just make the changes manually on both servers will that cause problems down the line?
Any help is greatly appreciated.
tia.
-m
View 2 Replies
View Related
Jan 24, 2007
I am using SQL 2000. How can I get my transactional replication reinitialized after it has failed with several attempts.
I know one way of doing it through enterprise manager and specifying the subscription to reinitialize. But this will apply the snapshot and will take long time.
Is there a fast way of doing it?
-Nipul
View 1 Replies
View Related
Nov 1, 2007
Hi,
We are implementing push transaction replication from Production SQL Server 2000 database to SQL Server 2005 reporting server and SQL Server 2000 Test server.
SQL Server 2000 PROD to 2000 Test is simple but from SS2000 to SS2005 I have following questions:
Is it feasible to create push subscription from SQL Server 2000 to SQL Server 2005 database?
When I am trying to setup publisher/subscription properties, It only give me options to pick SQL Server 7.0 or 2000 or heterogeneous databases.
When I am trying to register SQL Server 2005 database in EM of SS2000 it don't allow me to add it and through exception that I need to use Management studio, Is there any alternate way to register?
Thanks
--rubs
View 1 Replies
View Related
Jun 22, 2006
I am executing sp_dropmergesubscription, but the rows are still in dbo.msmerge_subscriptions, and are still shown in the replication monitor as expired; the last synch dates were in april (expiration is set to 10 days). The 'expired subscription clean up' job appears to be running okay. I need to remove these subscriptions from the publisher as the subscribers are mobile devices, which sometimes are lost.
View 5 Replies
View Related
Nov 29, 2006
Hi, has anyone got the following error message before? It seems like it occurred when the snapshot creation agent reached the UDF fn_getOwner():
StartIndex cannot be less than zero.
Parameter name: startIndex
Error messages:
Message: StartIndex cannot be less than zero.
Parameter name: startIndex
Command Text:
select 'number' = convert(int, 0), 'definition' = definition
from sys.sql_modules
where object_id = object_id(@qualified_object_name)
union all
select 'number' = convert(int, procedure_number), 'definition' = definition
from sys.numbered_procedures
where object_id = object_id(@qualified_object_name)
Parameters: @qualified_object_name = [dbo].[fn_getOwner]
Stack: at Microsoft.SqlServer.Replication.AgentCore.ExecuteWithOptionalResults(CommandSetupDelegate commandSetupDelegate, ProcessResultsDelegate processResultsDelegate, Int32 queryTimeout, CommandBehavior commandBehavior)
at Microsoft.SqlServer.Replication.AgentCore.ExecuteWithOptionalResults(CommandSetupDelegate commandSetupDelegate, ProcessResultsDelegate processResultsDelegate, CommandBehavior commandBehavior)
at Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.TextModeOnObjectScripter.Script()
at Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.GenerateNonTableArticleSchScript(Scripter scripter, BaseArticleWrapper articleWrapper, SqlSmoObject smoObject, Boolean quotedIdentifierOn, Boolean ansiNullsOn, Boolean textMode)
at Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.GenerateFunctionArticleScripts(ArticleScriptingBundle articleScriptingBundle)
at Microsoft.SqlServer.Replication.Snapshot.TransSmoScriptingManager.GenerateArticleScripts(ArticleScriptingBundle articleScriptingBundle)
at Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.GenerateObjectScripts(ArticleScriptingBundle articleScriptingBundle)
at Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.DoScripting()
at Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.DoScripting()
at Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.GenerateSnapshot()
at Microsoft.SqlServer.Replication.SnapshotGenerationAgent.InternalRun()
at Microsoft.SqlServer.Replication.AgentCore.Run() (Source: MSSQLServer, Error number: 52006)
Get help: http://help/52006
Source: mscorlib
Target Site: System.Text.StringBuilder Remove(Int32, Int32)
Message: StartIndex cannot be less than zero.
Parameter name: startIndex
Stack: at System.Text.StringBuilder.Remove(Int32 startIndex, Int32 length)
at Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.TextModeOnObjectScripter.ProcessGetObjectScriptResult(SqlDataReader dataReader)
at Microsoft.SqlServer.Replication.AgentCore.ExecuteWithOptionalResults(CommandSetupDelegate commandSetupDelegate, ProcessResultsDelegate processResultsDelegate, Int32 queryTimeout, CommandBehavior commandBehavior) (Source: mscorlib, Error number: 0)
Get help: http://help/0
Here's the function:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
/* various comments here. */
ALTER
FUNCTION [dbo].[fn_getOwner] (@moduleID integer, @FY char(4))
RETURNS varchar(5)
AS
BEGIN
declare @tin char(9),
@owner varchar(5),
@ownerCount integer
-- Get owner via ModuleID
select @owner = owner
from tblControlPage
where moduleid = @moduleID and AuditFY = @FY;
-- Get owner via ATIN (This is when the moduleId is not on control page or no owner.
-- Check to see if the ATIN is on control page and use ATIN's Owner)
if @owner is null
begin
-- get module's TIN.
select @tin = tin from tblModule where moduleid = @moduleID
-- count the number of owners by ATIN those owner is not null via entity association.
select @ownerCount = count(*) from
(
select owner from vwControlPage c inner join vwEntityAssociation e
on c.tin = e.atin and e.tin = @tin
and auditfystart <= @FY and @FY < auditfyend
where owner is not null
group by owner
) owners
if @ownerCount = 1
begin
-- good, there's only one owner, get the ATIN owner.
select top 1 @owner = owner from vwControlPage c inner join vwEntityAssociation e
on c.tin = e.atin and e.tin = @tin
and auditfystart <= @FY and @FY < auditfyend
where owner is not null
group by owner
end
-- else there are multiple owners, set owner value to 'Multi'
if @ownerCount > 1
begin
set @owner = 'Multi'
end
end
-- Get owner via TIN if @owner is still null
if @owner is null --or len(@owner) = 0
begin
-- get TIN of module (Commented out the following because it was retrieved on prior "if" condition)
-- select @tin = tin from tblModule where moduleid = @moduleID
-- count number of owners by that TIN those not null.
select @ownerCount = count(*) from
(
select owner from vwControlPage
where tin = @tin and auditFY = @FY and owner is not null
group by owner
) owners
if @ownerCount = 1
begin
-- good, there's only one owner.
select top 1 @owner = owner from vwControlPage
where tin = @tin and auditFY = @FY and owner is not null
group by owner
end
-- else there are multiple owners, set owner value to 'Multi'
if @ownerCount > 1
begin
set @owner = 'Multi'
end
end
return @owner
end
View 1 Replies
View Related
Jul 8, 2004
Ok, I'm knee-deep in replication-hell.
I'm trying to set up snapshot replication between two SQL Server 2000 databases over the internet. Both servers run Windows 2000 server edition and SQL server 2000. The idea is to send certain local information, stored in database tables to a database from which the information is published on a website.
I've set up the distribution database (with the original name: distribution) and connected a publisher to it (let's call that one "source_database") using the sp_adddistpublisher stored procedure. No problems there...
Next step, I added a publication, the tables in source_database, and a subscriber, the website database. I've opened up port 1433 on both servers, but still it won't send anything from the source_database to the website database....
It gives no errors, but just doesn't do anything...
Now, I've looked for possible problems and I think these problems might be able to cause problems:
- The initial snapshot is not reaching the subscriber
- I've made a push subscription which may has to become a pull subscription
- The RPC's aren't available, because both servers are highly secured
- The wrong serverpack is installed (this one is a wild guess)
Does anybody have any idea on how I can get my distribution working or solve any of the problems above, cause I'm running out of idea's....
(P.S. I'm a bit of a noobie to replication, I've set it up in a test environment before and it just worked perfectly, but the real thing isn't)
View 4 Replies
View Related
Jan 19, 1999
I am having two NT/SQL Server 6.5 and i tried to replicate the database on SQL Server from One Server to another Server.
When i try to replicate from Server A[Publisher] to Server B[Subscriber] it is giving error on Distribution History Log on Manage Scheduled Task Dialog.
The Error is like this :
08001 [ODBC SQL Server Driver] [dbnmpntw] ConnectionOpen (Createfile()).
and it is trying again and again by using retry option.
Kindly guide me by mentioning the reason for this error.
Email to : rsraja@sfl.soft.net
Regards
R. Suseendran Raja.
View 1 Replies
View Related
Nov 13, 2015
I have some issue when replicating a view (transactional replication).I have following objects on publisher:
Table: [Metadataschema].[Entity]
View: [dbo].[EntityLogicalView]
the view definition is:
create view [dbo].[EntityLogicalView] as (SELECT * FROM [Entity] WHERE OverwriteTime = 0)
this is what I get when I run "Script View as Create". The same query is used by the replication.Unfortunately this query fails on the subscriber "Unable to replicate a view or function because the referenced objects or columns are not present on the Subscriber". I cannot even runt his query manually on the subscriber, it only works when I change it like this:create view [dbo].[EntityLogicalView] as (SELECT * FROM [Metadataschema].[Entity] WHERE OverwriteTime = 0) Is there any way to get this working? Can I change the creation scripts used by the replication or force publisher to include schema names in all objects?
View 5 Replies
View Related
Mar 20, 2007
Hello,
I setup the transactional replication to replicate remote database that has 50 tables.
Two of the tables with huge columns.
I splitted the columns by creating several views before running the initial snapshot.
Questions:
1. Can the database replication copy the views.?
2. Where the view will be stored at the subscriber database?
Thank you.
Edwin
View 3 Replies
View Related
Jun 16, 2015
I'm trying to replicate client data from multiple databases into a single table. So database A, B and C replicate client data to a table in database Z. There is a settings table on A, B and C that holds the businessID and I use a function in a computed column to add this to the client table. At the moment I have just database A and Z as a test and what happens is the computed column gets replicated as a computed column with the formula.Â
Can I change this so that I can replicate the computed value (at db A,B,C) of this column?
I don't really want to add a businessID to the table if possible as I'm going to need to add a number of other tables to this replication which will each need to have the businessID, a computed column would be much easier and save updating a load of scripts.
If the above is not possible is there some other solution available so I can identify which database the records came from in the table on database Z?
View 4 Replies
View Related
Jan 19, 2007
hi all,
Could we configure a merge replication such as replicate the master table and its all related tables (relation deep could be 1.)
We dont want to manually find master table relations and configure replication for the related tables.
please help for that configuration
kinds
View 5 Replies
View Related
Oct 22, 2015
Replicate ddl setting is not working if multiple subscribers are used...
View 2 Replies
View Related
May 16, 2007
Hi!
i have a problem with my replication.
I have two SQL 2005 SP2 Server and want to use the transaction replication with updateable subscriber. Now the problem is that i can do any changes on the master server. But if i want to change a record on the subscriber which contains a ntext, text, oder image column - then i geht the error that the field will be NULL on the master.
Is there any solution to fix this problem? I dont wan`t to change the datatype vom ntext to varchar(max) !!
greetings
Holger
View 3 Replies
View Related
Oct 18, 2007
Hi Experts
we have a merge replication in place between 2 databases.
User A has created a constraint between a replicated table "R" and the non replicated "NR"
And the replication started failing
The error comes up like 'the Schema Script could not be propagated to the Subscriber'
i tried deleting the constraint but the replication still fails
Should i remove the schema script
Vic
View 1 Replies
View Related
Aug 29, 2015
there are several remote locations where sql is running, my company has asked me to find a way to collect all the data from the remote locations to a central location automatically,for example day to day data should be synced at night time from 2am to 7 am and it should be compressed automatically before data transfers to the central location. NOTE there is no domain only standalone workstations
View 3 Replies
View Related
Sep 2, 2015
We need to replicate multiple databases (publications) to one central subscriber. The schema of those articles are identical in all publications and also the primary keys in publications do not have any overlap.
Is this possible?If yes is there any specific thing that I should consider for it's implementation? Should each publication has it's own dedicated distributor or all of them can share one distributor?
View 2 Replies
View Related
Oct 15, 2015
Is it possible to replicate data from 3 publishers to a single/central subscriber transactionally? In other words I have Server A, Server B, Server C with databases A,B,C respectively. I need to replicate 2 articles from A,2 from B and 2 from C to a central Server D that hosts database D. D will have only 6 articles. The replication is Transactional Replication.
If it is possible what will be the drawbacks of such implementation? (if one server goes down will the whole replication break?) If not possible then what is the best way of implementing this?
View 3 Replies
View Related
Jan 5, 2007
I have tables that are replicated using transactional and merge replication. As a result I am unable to use automatic identity management as transactional replication doesn€™t seem to understand it.
Therefore I have implemented a version of the automatic mechanisms that seems to work in a hybrid environment. It is based on a central table that holds the maximum identity for each table that has been issued to date. Valid identity ranges are issued to each publisher and subscriber as needed in a similar way to the automatic mechanisms and tables are reseeded as needed.
I want to enforce the ranges in a similar way to the automatic mechanism using a check constraint similar to this:
alter table [dbo].[test1] with NOCHECK add CONSTRAINT repl_identity_range_48DF13ED_D503_4F5C_AED9_4E504D03E752 check NOT FOR REPLICATION (([id] > 10001 and [id] <= 20001) or ([id] > 50001 and [id] <= 70001))
This works OK on a client subscriber, but if the change is made on the publisher, then the alter statement itself is replicated out to all clients €“ which is not what is wanted. I have traced the automatic mechanisms using profiler and they issue an alter statement as above €“ following dropping of the constraint €“ but the check constraint isn€™t replicated. I can't see how this is achieved.
How do I stop the check constraint being replicated?
The article property schema option can be set to stop replicating check constraints, but this seems to have no effect. If the publication property replicate_ddl is set to 0 then I do see the behaviour that I want. However, I do need to be able to replicate most schema changes due to upgrades etc €“ so this doesn€™t look like a viable option €“ except possibly for the transactional publication.
Any help would be much appreciated
Thanks
aero1
View 4 Replies
View Related
Sep 23, 2015
I want to replicate the  foreign keys to secondary.I changed the value Copy foreign key constraints value is to True.
I changed this value at pub properties - Articles -
And then it is asking for MARK for reinitialization with the new snapshot.I clicked ok.
When I checked sync status it has given the message like initial snapshot is not yet available.I started the snapshot and the subscription started replication records.When check at pup properties the value Copy foreign key constraints again false.
After changing the value  to true it is showing as False.
View 3 Replies
View Related
Feb 26, 2006
This is to do with SQL 2005 merge replication (HTTPS if it matters)
Is there any difference between marking a subscription for reinitalizing via Snapshot Monitor, and having the subscriber mark it for reinitialization ?
Thanks
Bruce
View 1 Replies
View Related
Sep 7, 1999
Using SQL 7.0 I'd like to replicate just schema from DB on server A to DB on server B, then be able to replicate data only form DB on server B to DB on server A. I need help!!
Thanks for ANY information you can give me...
~Jepadria
View 2 Replies
View Related
Aug 27, 2007
Hi,
I'm doing merge sync between SQL Compact on mobile devices and SQL Server 2005. I recently made a schema change on the server and noticed that it caused an error on the subscribers when syncing. I fixed the schema problem, and did a reinitialize all subscriptions with a new snapshot. On the mobile devices I forced a reinitialisation (upload changes first). I'm still getting the same error message, which relates to a schema change which is no longer relevant to the server db and snapshot. For some reason the subscriber dbs are trying to reapply the original problem schema change even though they're supposed to be reinitializing to a new snapshot. I've even tried dropping the affected tables from the publication, and reinitializing all subscriptions with a new snapshot, but still the same error on the subscribers. Does anyone know why the subscriber dbs are still trying to apply a now defunct schema change (on tables which no longer exist in the publication)? Is there any way to flush this from the subscribers so they correctly pick up the new snapshot?
Regards,
Greg McNamara
View 2 Replies
View Related
Aug 16, 2007
Let say I've 4 server with MS SQL 2000 installed and I want all of them having the same data. So I'm using merge replication by assign one of them as publisher/distributor.
The problem is when ( let say ) server that have been assign as publisher/distributor down then all the other server cannot make replication.
My idea was to make it replicate to other available server ( among them ) if replication to main server failed.
Is it possible ?
If possible how to do it ?
Thanks.
View 1 Replies
View Related
Aug 22, 2007
we had setup merge replication on 2 db servers. For some reason, the subscription started failing a month back with the error " invalid object sysmergexxxx on the subscriber. I did a reinitialize and now all the changes on the subscriber which werent synced got deleted. I have tried all 3 log recovery tools with no luck. Is there any hope of recovering data. the last backup on the subscriber was a month ago.
View 1 Replies
View Related
Jan 9, 2007
I know this is probably a flick of a switch but I cannot figure out which switch. Setup is SQL Server / Stored Procedures / DAL / BLL(skipped for testing) / PL. The stored procedure queries from only one table and two columns are ignored because they are being phased out. I can run the stored procedure and preview the data in the DAL but when I create a page with an ODS linked to the DAL and a GridView I get this error. I checked every column that does not allow nulls and they all have values. I checked unique columns (ID is the only unique and is Identity=Yes in the table definition). I checked foreign-key columns for values that are not in the foreign table and there are none. Any ideas why do I get this?
Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
View 3 Replies
View Related
Jan 17, 2008
Hi,
I am getting the above error when trying to load a report into my Web Application, I have tracked the error down to one specific field in my database. Even though this field is a NVarChar field and is of size 30 it would seem that there is an issue returning the value from the field. I can write it into the database no problems but when I try to get it out of the database it returns the above error.
e.g
MOB 401.908.804 - Fails
0401.907.324 - okay
8239 9082 (pager) - fails
Anyone got an idea on how to fix this????
Regards..
Peter.
View 7 Replies
View Related
Sep 4, 2007
From the SSMS GUI it is possible to re-initialize one or all subscriptions to a merge publication. This is done at the publisher.
How can I achieve these operations programmatically?
In particular, how do I initialize a single merge subscription from the publisher?
I have looked at the documentation for sp_reinitmergepullsubscription but it says that this proc must be run at the subscriber - which isn't much use when subscribers are disconnected for the majority of the time
I have a large number of merge subscribers and want to reinitialize all except one
aero1
View 3 Replies
View Related
Sep 13, 2007
I have SS 2005 express* working(yrs) on a XP home ver. laptop. I got a new Acer w/ Vista hm/premium and I registered/can't get SS 2005 express* to download from MSDN.
Norton's gives a file block, I click the 'download file' and nothing happens. No dialog, hd drv activity, nothing - just 'Done'
on IE7 status. I have Visual Web Developer beta v2 2008** running on the Acer and don't want to trash the install.
.NET fwrk v2.0 is listed required for SS2005, but .NET fwrk v3.5 says it includes v2.0 + WCF,...(right? - install both?)
I need a SS for VWD 2008. I've ask/tried several times. What am I doing wrong?
Mark
View 1 Replies
View Related
Jun 19, 2006
I downloaded the DVD image to a PC and the DVD drive fails.
Now, when I try to download the executable for install instead, nothing downloads.
Is SQL SVR 2005 eval limited to one download?
View 3 Replies
View Related
Apr 30, 2007
I have MS SQL Server 2005 Developer Ed. and try to make a database diagram of remote MS SQL Server2000 database in MS SQL Server Management Studio.
I receive an error "Database diagram support objects cannot be installed because this database does not have a valid owner. To continue, first use the Files page of the Database Properties dialog box or the ALTER AUTHORIZATION statement to set the database owner to a valid login, then add the database diagram support objects."
View 1 Replies
View Related
Feb 14, 2007
Hello,
I have installed SSs2005 - Standard Edition.
During this installation, also Visual Studio is installed.
I do not understand what i can do with this Studio version.
I mean, i understand that with SS2005 there is a connectivity between sql server and visual studio. For example i could create store procedures with Visual Studio. (clr applications).
But when i start the Viual Studio screen i can only select Business Inteligence Projects.
What do i need, when i want to create functions, stored procedures and what do i need to develop SMO applications?
Please give me some light on this matter.
View 1 Replies
View Related
Nov 14, 2007
Every time a transaction log is dumped we see the following message in the log file:
BackupDiskFile:penMedia: Backup device '\s-sqlbkups-1g$myserverlogmy_databasemydatabase_backup_200711071430.trn' failed to open. Operating system error 2(The system cannot find the file specified.).
Source spid139
Message
Error: 18204, Severity: 16, State: 1.
And yet, the actual log dump appears fine and the file is found on the share. The dump is done with a maintenance plan.
Any ideas?
View 2 Replies
View Related