SQL Server CE Replication: Integrity Error, But Not At All
Aug 30, 2006
Error information:
NativeError: 28549
HRESULT: -2147217873
Message: OrdersHeader,Delete,{0503BF00-BB05-11C6-8000-36BC4ADEE342}
Description: The row update or insert cannot be reapplied due to an integrity violation.
Server side: SQL Server 2000 or MSDE
Client side: SQL Server CE or SQL Mobile
This error is usually caused because of an error on the filters. But not in this case, i think.
I assume it's not a filter error because if I delete the SDF and run the sync it works.
The error occurs when I delete some rows in the server (parent(OrdersHeader) and child(OrderLines) tables) and the PocketPC stills have this rows.
On the next synchronization It seems that replication process tries to delete the OrdersHeader rows before the OrderLines rows.
Is there any way to control the synchronization updating order? Or Is there any know issue about this?
It doesn't occur always but it occurs often. And I still haven't found the way to replicate the error.
I have created a simple package to load an Excel Spreadsheet into a SQL Server table. There is a one to one relationship between the columns in the .xls file and the columns in the DB record. I am getting integrity constraint errors when I try to load all numeric data from the spreadsheet (defined as Category General in excel, not defined as numeric but consisting of all numeric characters) into a column defined as (nvarchar(20), not null) in SQL Server Management Studio. There are no constraints on the column.
I have been able to temporarily bypass the offending rows, but I do need to load them into SQL Server. The problem column has a mixture of data, two examples would be: N255, 168050. It's the 168050 value that's causing the Task to bomb. How can I get this loaded into my table ?
I am running the package from within MS Visual Studio 2005 Version 8, Excel is version 2003 (11.8120.8122) SP2
I created a job to check the integrity of my databases every week using SQL Server Maintenance Plan Wizard. The job is failing every time... For tb_basico database it works fine, but with the other one (tb_cep) it doesn't work...
Does someone have an idea to solve this problem?
The message is:
[1] Database tb_basico: Check Data and Index Linkage...
** Execution Time: 0 hrs, 0 mins, 11 secs **
[Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 5070: [Microsoft][ODBC SQL Server Driver][SQL Server]Database state cannot be changed while other users are using the database 'tb_cep' [Microsoft][ODBC SQL Server Driver][SQL Server]ALTER DATABASE statement failed. [Microsoft][ODBC SQL Server Driver][SQL Server]sp_dboption command failed. [2] Database tb_cep: Check Data and Index Linkage... [Microsoft SQL-DMO (ODBC SQLState: 42000)] Error 7919: [Microsoft][ODBC SQL Server Driver][SQL Server]Repair statement not processed. Database needs to be in single user mode.
The following errors were found:
[Microsoft][ODBC SQL Server Driver][SQL Server]Repair statement not processed. Database needs to be in single user mode. ** Execution Time: 0 hrs, 0 mins, 1 secs **
I tried to do the merge replication between SQL 2000 database and the SQL mobile server on PDA with SQL server management studio from SQL 2005 and I have already successfully synchronized my PDA with one small SQL server database file. However when I tried to synchronized my PDA with another larger SQL server database file, I got the error on PDA as following: €œThe row operation cannot be reapplied due to an integrity violation. Check the publication filter. [Table = AuditCriterion, operation = Insert, RowGuid = {1ee9321d-f00d-410c-8d5b-08d4220d2627}]€?. I have keep checking the size of sdf file during synchronization, I found after the size of the sdf file stop increasing for about 20 mintues, then I got the error above. Morever, AuditCriterion table have a foreign key with another table AuditElement and I have not used publication filter at this stage.
I met a very strange problem recently. I set up a database integrity check maintenance plan. But this job failed every time. I looked into the logs, the error message was that Databases that have a compatibility level of 70 (SQL Server version 7.0) will be skipped. I used the sp_helpdb to check the version of the databases included in my maintenance plan. The sp result shows that all the databases are above version 80....
Even more strange, i can successfully run the dbcc check query on each database.
Any comment and suggestion will be very appreciated.
Where should tests for data integrity be done, a few examples:
Inserting data but the underlying data has changed?
Adding data, say an order item row, but since going to that screen the order (and as a result all its order items as well) have been deleted?
It's just I'm starting to see even the simplest of stored procedures as being quite complicated. What puzzles me is a I see lots of INSERT stored procedures with none of this checking in, or returning error codes?
SQL Server replication requires the actual server name to make a connection to the server. Connections through a server alias, IP address, or any other alternate name are not supported. Specify the actual server name, 'xxxxxx'. (Replication.Utilities)
I've been trying to convert an application to use the CF 2.0, and of course to SQL Server Mobile. There have been some kinks along the road, but I've worked all of them out except an error on replication. When I call the SqlCeReplication's Synchronize() method, the connection goes fine, it works for about 20-30 seconds, and then comes up with the following error:
Error code: 0x80004005 Message: The data types cannot be converted implicitly. [ Source data type = nvarchar,Destination data type = image ] Native error: 25932 Source: Microsoft SQL Server 2005 Mobile Edition Error Param: nvarchar Error Param: image
I've tried upgrading from SQL Server 2000 to 2005 to see if that helped, but got the same result. I even tried running this from a fresh install of SQL Server 2005, hoping that'd integrate better with SQL Server Mobile, but that didn't help either.
I found a knowledge base article about error code 0x80004005: http://support.microsoft.com/kb/912428 However, none of my tables are even remotely close to having 127 columns, so that can't be it.
I do have an image data type column in one of my tables, but why is a column being converted from nvarchar to image? Both SQL Server 2005 and SQL Server Mobile support the image data type, so I don't understand how that could be causing a problem in the first case.
Any ideas? I've run out of things to try and would appreciate any feedback.
Hi Friends, I am Ravi, I need a help. My case is like.. i need to upload data from csv file into sql server 2005 data table. but before that I need to check integrity of data for example: let us say csv data is like ISD CODE,STATE,NAME,QUALIFICATION 91,AP,KIRAN,MCA 01,MC,MIKE,MS
here i have to check that, wether there is an entry in ISD codes table for 91 and 01 (india and us) similarly AP , MC (Andhra Pradesh and MISSICippi) please suggest me a nice approach, no of records in ISD codes and States will 350-450 records.
I am thinking about moving some backups from the local machine to a remote server. Right now, I am using Ola Hallengren script for backups. The script performs checksum on the backup while it's being written on the disk. I am going to move the files using Robocopy utility. How do I check the data integrity once the backups are transferred to the remote server?
I'm getting this, after upgrading from 2000 to 2005.Replication-Replication Distribution Subsystem: agent (null) failed.The subscription to publication '(null)' has expired or does notexist.The only suggestions I've seen are to dump all subscriptions. Sincewe have several dozen publications to several servers, is there adecent way to script it all out, if that's the only suggestion?Thanks in advance.
I have set up replication on two SQL Servers (6.5), SP5a, on NT 4.0 (SP3). The Distribution Task is failing with the following error:
08001[Microsoft][ODBC SQL Server Driver][dbnmpntw]Specified SQL Server not found.
I am using standard security in a workgroup environment. I have my trusted connection setup and I am using named pipes. I had this process working on our test servers but when I tried to implement it into production I received the above message.
One thing I noticed is that in the SQL EM on the Publisher I am not able to register to the Subscriber unless I use an Advance Connection with TCPIP Sockets in the Client Configuration Utility. The same applies in the SQL EM on the Subscriber I am not able to register to the Publisher unless I use an Advance Connection with TCPIP Sockets in the Client Configuration Utility. Please give me some advice. Thanks.
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.
I have a SQL server scheduled to replication. This works fine if it has to do that one the sever on the same mechine. If it has to be done to another server, the replication fails with the following error message.
08001[Microsoft][ODBC SQL Server Driver][dbnmpntw]Connectionopen(Createfile())
I'd appreciate any help i can get here. I'm working with an MS SQL Server 2005 SP2 db on a Windows 2003 OS. I set up replication from an Oracle 10g instance a few months ago, and everything was working until i installed SP2 for SQL Server.
2007-06-06 16:06:22.488 The agent is running. Use Replication Monitor to view the details of this agent session.
2007-06-06 16:06:23.082 Status: 0, code: 1008, text: 'ORA-01008: not all variables bound '.
2007-06-06 16:06:23.082 ORA-01008: not all variables bound
2007-06-06 16:06:23.082 Status: 0, code: 22037, text: 'Heterogeneous Logreader encountered an error in call to LoadReplCmds when processing state 'PROCESSSYNCDONE'.'.
I can get snapshot replication to work just fine, but transactional replication throws up the error above.
"The merge process could not retrieve identity range resource for table..."
then after solving this error we again started syncing of servers manually then we got some other error like
"the process could not enumerate changes to the subscriber".
We tried our best to solve this problem but some error appears each time like
"The process could not deliver the snapshot to the Subscriber."
"The schema script 'sync -t"Design" -o"dbo" -d"\ECOSYSTEMD$FTPMSSQLEcoSystemftpECOSYSTEM_MLEcosystem_MLEcosystem20060619204802Design_1337.bcp" -hORDER( [intDesignId] ASC)' could not be propagated to the subscriber"
again identity erroe emerges and agin we do the same process.
I've been running the Ola Hallengren maintenance script for the last five months without missing a beat. Today I find an error stating the UserDatabase Integrity check job failed last night. This is running on SQL Server 2014 BI edition w/64 Gigs.
I ran a DBCC CHECKDB on each database manually and all worked until I tried it on the biggest one that is about 18 gbs. It just keeps running and I eventually stopped it so I'm guessing it is memory, but doesn't make sense considering it has 64 gbs. I have it set to 64/4 max / min. Again, this was never an issue until last night.I've been looking up all morning, but not seeing much on this error "The operating system returned error 1453"?
I installed SQL Server 2005 Enterprise, then SP1 and then SP2, Maintenance Plan worked. But if I installed SQL Server 2005 Enterprise and then SP2 directly (skipping SP1), the Check Database Integrity in Maintenance Plan was not working. The error message is as follows:
Executed as user: DomainSqlServiceAccount. Microsoft (R) SQL Server Execute Package Utility Version 9.00.3042.00 for 64-bit Copyright (C) Microsoft Corp 1984-2005. All rights reserved. Started: 10:56:21 AM Could not load package "Maintenance PlansTest Plan" because of error 0xC0014062. Description: The LoadFromSQLServer method has encountered OLE DB error code 0x80004005 (Login failed for user ''. The user is not associated with a trusted SQL Server connection.). The SQL statement that was issued has failed. Source: Started: 10:56:21 AM Finished: 10:56:21 AM Elapsed: 0.047 seconds. The package could not be loaded. The step failed.
Other tasks like Rebuild Index seem to be fine. SP2 is supposed to be inclusive. Does anyone have any ideas on why this is happening.
Hello,I'm getting the following error message when I try add a row using aStored Procedure."The identity range managed by replication is full and must be updatedby a replication agent".I read up on the subject and have tried the following solutionsaccording to MSDN without any luck.(http://support.Microsoft.com/kb/304706 )sp_adjustpublisheridentityrange (http://msdn2.microsoft.com/en-us/library/aa239401(SQL.80).aspx ) has no effectFor Testing:I've reloaded everything from scratch, created the pulications from byrunning the sql scripts generated,created replication snapshots andstarted the agents.I've checked the current Identity values in the Agent Table:DBCC CHECKIDENT ('Agent', NORESEED)Checking identity information: current identity value '18606', currentcolumn value '18606'.I check the Table to make sure there will be no conflicts with theprimary key:SELECT AgentID FROM Agent ORDER BY AgentID DESC18603 is the largest AgentID in the table.Using the Table Article Properties in the Publications PropertiesDialog, I can see values of:Range Size at Publisher: 100,000Range Size at Subscribers: 100New range @ percentage: 80In my mind this means that the Publisher will assign a new range whenthe Current Indentity value goes over 80,000?The Identity range for this table cannot be exhausted! I'm not surewhat to try next.Please! any insight will be of great help!Regards,Bm
I have few databases with SAME database structure in SQL Server 2000 in different locations. Data will be updated in different places with different sets of data. Basically, i need to synchronize the data especially to the headquarters database periodically (may be everyday at night).
DB : SQL Server 2000 OS : Both are running on Windows XP for testing purposes. Situation : Now i have 2 database from 2 different estates. Now, need to be synched into 1.
Have 2 publisher namely TH1, TH2 1 subscriber : THFinal
I've created 2 individual publications using "Create Publication" and published database namely TH1 and TH2. Publication type : Merge publication
Default table article properties setting are as follows : a. When merging from different sources : "Treate changes to the same column as a conflict (changes to different columns in the same row will be merged)".
Snapshot i Choose "DELETE DATA IN THE EXISTING TABLE that matches the ROW FILTER statement".
Resolver : I checked "yes" for - Allow Subscribers to resolve conflicts interactively during on-demand synchronizations".
Now, when i sync the TH1, all the records from TH1 goes to the subscriber database "THFinal". When i sync the TH2, all the records which was synched earlier (from TH1) being DELETED. and all the records from TH2 goes to the subscriber database "THFinal".
Basically, i WANT to retain the ALL THE data from in "THFinal" which came from TH1 database since the primary key is different. Also, all the database contains running no (Identity increment = 1) .
Identity : Yes (Not For Replication) (Identit seed=1)
=================================================== PROBLEM : 1ST (TH1) database can be synched. when I try to replicate the 2nd (TH2) database, the following ERROR displayed : The process could not drop one or more tables because the tables are being used by other publications.
The process could not drop one or more tables because the tables are being used by other publications. (Source: Merge Replication Provider (Agent); Error number: -2147200976)
Hi I am trying to complete sql server compact edition book online walkthrough "Creating a Mobile Application with SQL Server Compact Edition". I am successful to complete it as guided using all default settings (e.g. anonymous access, windows authenticaion etc.) and the sample run on both emulator and my pocket pc svc5000. I have following configuration..
Windows 2000 professional sp4 Sql server 2005 standard edition sp1 VS 2005 profesional edition (sp1 not installed) Sql server compact edition Sql server compact edition server tools
But the problem is that in production environment i will not be able to connect to the sql server using named instance (e.g machine_nameinstance_name). i have to use ip address in that situation. so i tried to modify the sample to use ip address in place of named instance and then the problem starts.. I have configued my sql server to allow remote connections using tcp/ip and named pipes using sql surface area config tool.
When using named instance i used following code to Synchronize with sqlserver 2005 with and it worked perfectly :
Dim filename As New String("Program FilesTestTest.sdf") Dim repl As New SqlCeReplication() repl.InternetUrl = http://machine_name/Test/sqlcesa30.dll repl.Publisher = "machine_nameinstance_name" repl.PublisherDatabase = "Test" repl.PublisherSecurityMode = SecurityType.NTAuthentication repl.Publication = "Test" repl.Subscriber = "Test" repl.SubscriberConnectionString = "Data Source='" + filename + "';Password='';Max Database Size='128';Default Lock Escalation ='100';" Try repl.AddSubscription(AddOption.CreateDatabase) repl.Synchronize() Catch err As SqlCeException MessageBox.Show(err.ToString) End Try
When i tried to do replication using ip address it shows following error:
System.Data.SqlServerCe.SqlCeException was unhandled HResult=-2147467259 Message="Failure to connect to SQL Server with provided connection information. SQL Server does not exist, access is denied because the IIS user is not a valid user on the SQL Server, or the password is incorrect." NativeError=29061 Source="Microsoft SQL Server Compact Edition" StackTrace: at System.Data.SqlServerCe.SqlCeReplication.Synchronize() at TEST.MainModule.Sync() at Test.MainModule.Main()
I am using following code to connect using ip address:
Dim repl As New SqlCeReplication() repl.InternetUrl = http://XXX.XXX.XXX.XXX/test/sqlcesa30.dll repl.PublisherNetwork = NetworkType.TcpIpSockets repl.PublisherAddress = "XXX.XXX.XXX.XXX,XXXX" repl.Publisher = "SQL2005" 'instance name of sql in sql2005 repl.PublisherSecurityMode = SecurityType.NTAuthentication repl.PublisherDatabase = "Test" repl.Publication = "Test" repl.Subscriber = "Test" repl.SubscriberConnectionString = "Data Source='" + filename + "';Password='';Max Database Size='128';Default Lock Escalation ='100';" repl.AddSubscription(AddOption.CreateDatabase) repl.Synchronize()
I have give rights to iuser_manchine_name in the public access list of publication and on database also.
I don't have any idea on where i am wrong... Please help soon.. Many thanks in advance..
I've got two databases on the same server and replicate some tables from one database to another.The replication is configured so not to drop the table if it exists, but to delete the data based on the filter if one exists. There are two tables on the subscriber that have some extra columns.
I get "field size too large" error when trying to replicate them. Is there a workaround without having to make the publisher and the subscriber tables identical by schema?
Using the new referential integrity constraints that will be made available, will it allow us to manually define the relationships between entities even if there is no true foreign key constraints setup in the database?
Lets say we deleted the FK_Orders_Customers in Northwind between orders and customers.
Hi!I´m trying to create a merge replication publication for a SQL MobileApplication .Everything works fine creating the publication and I'm able to dothehttp://xxx.xxx.xxx.xxx/aaaaaaa/sqlcesa30.dll, and it display's the"sql server mobile server agent 3.0".But when I run the application on the PDA and it´s doing thereplication it appears the following error:'Failure to connect to SQL Server with provided connectioninformation . SQL Server does not exist , access is denied becausetheIIS user is not a valid user on the SQL Server , or the password isincorrect' .any idea of which could be the reason...?Thanks in advance!!!
I have merge replication configured over VPN and the replication is failing to connect to the subscriber through Named pipes with the error Named Pipes Provider, error: 40 - Could not open a connection to SQL Server ......
Actually , I am having issues with Named pipes connection from publisher to subcriber. I have enabled the protocols and also enabled the remote connections using both tcp/ip and named pipes. I have created the client network alias using named pipes
Also, due to security reasons only few ports have been released on the subscriber. Please provide me some information on the following. 1) Does any port specifically be released for listening on named pipes? i am able to connect using tcpip with out any issues as 1433 has been released. 2) How to configure the replciation to use tcpip and not named pipes (guess by default it will use named pipes)?
I have setup merge replication which successfully synchronizes with a group of desktop users using SQL Compact Edition.
However now I have setup Article Filters and when I attempt to regenerate the snapshot I get the following error:
Invalid column name 'rowguid'.
Failed to generate merge replication stored procedures for article 'AssignedCriteria'.
When I look at publication properties at the Articles page.. All my tables have the rowguid uniqueidentifier successfully added to tables and selected as a compulsory published column, apart from the table above "AssignedCriteria".. Even when I attempt to select this column in the article properties page and press ok, when I come back it is deselected again. ( The Rowguid column is however physically added to the table)
I have scripted the publication SQL and then totally reinstalled from scratch, including the database but for some reason it doesn't like this table. I remove the article filters, but still this "rowguid" is never "selected" in article properties.
We are using Uniqueidentifiers in other columns as well for historical reasons, but this doesn't appear to be a problem in other tables..
I am administering several SQL Servers running SQL Server 2005 SP2 Build 3042. I have a common maintenance plan that runs on each of the servers. The maintenance plan runs fine on all the servers except for one. On the one server the Database Integrity check fails with the following error:
Check Database integrity on Local server connection Databases: <list of databases> Include indexes Task start: 2008-02-21T00:05:42. Task end: 2008-02-21T00:05:46. Failed0) Alter failed for Server €˜XYZ€™
I created a test maintenance plan to just do the integrity check and selected one database only and this also failed with the same error message. I ran this test maintenance plan and configured it for each of the databases in question and it failed each time. If I run the DBCC manually against the databases they all report fine.
I read some of the post that talked about the €œAllow Updates€? being set incorrectly but that does not apply to my problem since my configured and run values are set to 0.
DBCC OPENTRAN shows "REPLICATION" on a server that is not configured for replication. The transaction log is almost as large as the database (40GB) with a Simple recovery model. I would like to find out how the log can be truncated in such a situation.