Wednesday, March 28, 2012
Replication setup via VB.NET
replication. I am getting an error (A severe error has occured) on the
sp_addmergepubliction command.
I did setup a profiler and notice one area:
sp_adddistributor was found in the text of this event, the text has been
replaced with this comment for security reasons.
My entire text, before the sp_addmergepulication does:
use master
exec sp_replicationdboption @.dbname='InWare',etc
exec dbo.sp_helpditributor @.rpcsrvname=@.distributor OUTPUT
if @.distributor is null
begin
declare @.xpath varchar (255)
select @.xpath=substring(filename,1,charindex('InWare_data ',filename)-1)
FROM master..sysdatabases where name='inware'
exec sp_adddistributor @.distributor=@.@.servername
exec sp_adddistributiondb @.database='inxsqlDIST',etc
exec sp_adddistpublisher @.publisher=@.@.servername, etc
end
exec sp_replicationdboption @.dbname='InWare',@.optname='merge
publish',@.value='true'
I guess, now that I see Profiler has the line sp_adddistributor
commented out, this could cause the problem. What is commenting it out -
SQL or VB.NET?
I want to use VB (my program) to have the user setup replication so they
don't have to use the enterprise manager, and it allows me to control
the setup.
Thanks.
Darin
Darin
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!
Darin wrote:
> I want to use VB (my program) to have the user setup replication so they
> don't have to use the enterprise manager, and it allows me to control
> the setup.
How about using SQL-DMO through COM Interop?
|||Profiler is removing it because the command contains the keyword "password".
Profiler won't display anything that includes that keyword to eliminate a
security hole. The command is still likely being run, just not displayed in
Profiler.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
"Darin" <darin_nospam@.nospamever> wrote in message
news:exGVx28KFHA.2596@.TK2MSFTNGP10.phx.gbl...
>I have a VB.NET program that is executing the SQL commands to setup
> replication. I am getting an error (A severe error has occured) on the
> sp_addmergepubliction command.
> I did setup a profiler and notice one area:
> sp_adddistributor was found in the text of this event, the text has been
> replaced with this comment for security reasons.
> My entire text, before the sp_addmergepulication does:
> use master
> exec sp_replicationdboption @.dbname='InWare',etc
> exec dbo.sp_helpditributor @.rpcsrvname=@.distributor OUTPUT
> if @.distributor is null
> begin
> declare @.xpath varchar (255)
> select @.xpath=substring(filename,1,charindex('InWare_data ',filename)-1)
> FROM master..sysdatabases where name='inware'
> exec sp_adddistributor @.distributor=@.@.servername
> exec sp_adddistributiondb @.database='inxsqlDIST',etc
> exec sp_adddistpublisher @.publisher=@.@.servername, etc
> end
> exec sp_replicationdboption @.dbname='InWare',@.optname='merge
> publish',@.value='true'
> I guess, now that I see Profiler has the line sp_adddistributor
> commented out, this could cause the problem. What is commenting it out -
> SQL or VB.NET?
> I want to use VB (my program) to have the user setup replication so they
> don't have to use the enterprise manager, and it allows me to control
> the setup.
> Thanks.
> Darin
> Darin
> *** Sent via Developersdex http://www.codecomments.com ***
> Don't just participate in USENET...get rewarded for it!
|||Any idea what could be causing the error:
A severe error occured .... Any results should be discarded
on the exec sp_addreplication @.publication='InWareMerge'
when it works find on QA?
Darin
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!
|||If you script a publication in EM, it assumes you have the publisher,
distributor, and subscribers already set up for all servers involved in
replication. If that is not the case, then creating a publication will
fail.
GNH
"Darin" <darin_nospam@.nospamever> wrote in message
news:ukmK5P9KFHA.3992@.TK2MSFTNGP15.phx.gbl...
> Any idea what could be causing the error:
> A severe error occured .... Any results should be discarded
> on the exec sp_addreplication @.publication='InWareMerge'
> when it works find on QA?
> Darin
> *** Sent via Developersdex http://www.codecomments.com ***
> Don't just participate in USENET...get rewarded for it!
|||My problem is all of my script run from the VB.NET program work fine
until that command.
Whereas if I take all of the script and paste it into a QA window it all
works perfectly.
Darin
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!
Friday, March 23, 2012
Replication Question
Me and another developer are working on a .NET application that uses SQL 2k. Since we are the only two developers, and we both work from home, we spend a lot of time working remotely, so we each have a copy of SQL on our laptops. While this plan works fine for the most part, we are finding that keeping our systems synchronized to be more painful than one would think it should be. Initially, we tried just using DTS packages to copy tables and data from one system to the other, but this would cause one person's data they had to be lost (not a bad thing, but a real pain if you are testing a specific scenario and have to have the data setup a certain way).
We then tried using SQL merge replication, but since the tables are still in active development, modifying, adding, or changing tables is next to impossible (I did find the way to disable the replication temporarily and then re-enable it, but it takes too long just to add a column or something else simple). I would be fine with the replication scenario if someone could suggest a way to easily modify the table schemas with the replication enabled.
I am pretty sure there has to a simple way to do what we are doing, its just that neither of us are familiar with SQL enough to really see how to do it. Is there a way to syncronize each row's data before pushing new schema elements to other servers using DTS, or is there an easy way to enable the replication and still be able to have access to the table's schema?It sounds to me like you are describing Merge replication for existing tables, and a bit of DTS (then establishing a new merge publication for ongoing changes) for new tables.
-PatP|||Exactly. For the normal, day-to-day stuff that we do the merge replication is fine because we are connected over a network (VPN or local LAN), so that works beautifully, I would like to keep it if possible. The pain starts when I have to make an update to the tables or add a new table (which at this point in development is VERY frequent, at least one new table a week and slight modifications to all as time and testing goes along). Unfortunately, we do not have the luxury of working off a plan, so the tables tend to be rather "from the hip", which compounds this problem even more.
I suppose I am more accustomed to LDAP replication (I am learning SQL the hard way), which replicates the schema objects in addition to the data. I am looking for something along those lines, where the master (or in this case Publisher) not only defines the data objects to the subscribers, it defines the schema to be used. I don't see why it would be that much different in SQL.
If I could just get a nod in the right direction, or even a 'it would be possible to do it, but watch for this and that' I would be eternally grateful, this is driving me nuts.sql
Wednesday, March 21, 2012
Replication problem
Hi.
I am using SQL Server 2005 at the back-end, with a database published for merge replication; Windows Mobile-based handheld devices running a .NET 2.0 CF application, and SQL Mobile 2005.
Intermittently, when initialising the subscription on a device, the app cycles through the tables multiple times, or even endlessly.
Can anyone shed some light on why this is happening?
Try to check the Replication Monitor (server side) for status, including number of records submitted. There are some issues with merge replication in the SQL Server 2005 RTM, that have been fixed in SQL Server 2005 SP2.|||Thanks for the response.
I checked the replication monitor as a matter of course - no problems there, everything looks fine.
Interesting what you say about SP2 - the box in question is running RTM, so maybe updating it will help. Is there anywhere that goes into detail on what these issues that you mention were, and if/how they have been addressed in SP2?
|||There are various merge/SQL Compact fixes, all documented at: http://support.microsoft.com/default.aspx?scid=kb;en-us;921896
Amongst others:
Erik,
Thanks for that. I am recommending to my client that they upgrade to SP2, and will post back here with the results.
|||My client is hoping to install SP2 in a couple of weeks. In the meantime, they applied the hotfix, but the problem still exists.
They applied the hotfix to the server running the instance of SQL 2005, but not to the machine with the SQL Mobile server tools (and SQL 2005 client components). Is this correct?
I am hoping that, despite the failure of the hotfix to resolve the issue, the full SP2 update will make a difference...
|||Erik,
SP2 has now been applied to both servers, and the problem is now resolved.
Thanks very much for your help.
|||We are facing the same problem... so suggested client to apply for Sp2.... still the problem pesrsists,,,,
Any idea as how to resolve it... please let me know if anything need to be changed after applying Sp2...
Waiting for an answer..
|||It is important to apply SP2 on all servers, including IIS (web) servers (replication components)|||How to apply SQL server 2005 Service pack 2 on IIS web servers...
I really didnt understand this..can u please telll me what is it
|||If you are running IIS on a separate server, you need to update the replciation components to SP2, see this for info http://msdn2.microsoft.com/en-us/library/ms172937.aspx|||I will update the replication componets on IIS servers, but what abt the "SQLCSA30.dll" contained in the virtual directory... HOw to update this dll with Service pack 2....
Please correct me if i am using the wrong concepts.. I am new to these concepts..
|||I will update the replication componets on IIS servers, but what abt the "SQLCESA30.dll" contained in the virtual directory... HOw to update this dll with Service pack 2....
Please correct me if i am using the wrong concepts.. I am new to these concepts..
|||Thank You Erik...
My Problem solved after applying SP2
GOKI
Replication problem
Hi.
I am using SQL Server 2005 at the back-end, with a database published for merge replication; Windows Mobile-based handheld devices running a .NET 2.0 CF application, and SQL Mobile 2005.
Intermittently, when initialising the subscription on a device, the app cycles through the tables multiple times, or even endlessly.
Can anyone shed some light on why this is happening?
Try to check the Replication Monitor (server side) for status, including number of records submitted. There are some issues with merge replication in the SQL Server 2005 RTM, that have been fixed in SQL Server 2005 SP2.|||Thanks for the response.
I checked the replication monitor as a matter of course - no problems there, everything looks fine.
Interesting what you say about SP2 - the box in question is running RTM, so maybe updating it will help. Is there anywhere that goes into detail on what these issues that you mention were, and if/how they have been addressed in SP2?
|||There are various merge/SQL Compact fixes, all documented at: http://support.microsoft.com/default.aspx?scid=kb;en-us;921896
Amongst others:
Erik,
Thanks for that. I am recommending to my client that they upgrade to SP2, and will post back here with the results.
|||My client is hoping to install SP2 in a couple of weeks. In the meantime, they applied the hotfix, but the problem still exists.
They applied the hotfix to the server running the instance of SQL 2005, but not to the machine with the SQL Mobile server tools (and SQL 2005 client components). Is this correct?
I am hoping that, despite the failure of the hotfix to resolve the issue, the full SP2 update will make a difference...
|||Erik,
SP2 has now been applied to both servers, and the problem is now resolved.
Thanks very much for your help.
|||We are facing the same problem... so suggested client to apply for Sp2.... still the problem pesrsists,,,,
Any idea as how to resolve it... please let me know if anything need to be changed after applying Sp2...
Waiting for an answer..
|||It is important to apply SP2 on all servers, including IIS (web) servers (replication components)|||How to apply SQL server 2005 Service pack 2 on IIS web servers...
I really didnt understand this..can u please telll me what is it
|||If you are running IIS on a separate server, you need to update the replciation components to SP2, see this for info http://msdn2.microsoft.com/en-us/library/ms172937.aspx|||I will update the replication componets on IIS servers, but what abt the "SQLCSA30.dll" contained in the virtual directory... HOw to update this dll with Service pack 2....
Please correct me if i am using the wrong concepts.. I am new to these concepts..
|||I will update the replication componets on IIS servers, but what abt the "SQLCESA30.dll" contained in the virtual directory... HOw to update this dll with Service pack 2....
Please correct me if i am using the wrong concepts.. I am new to these concepts..
|||Thank You Erik...
My Problem solved after applying SP2
GOKI
Replication problem
Hi.
I am using SQL Server 2005 at the back-end, with a database published for merge replication; Windows Mobile-based handheld devices running a .NET 2.0 CF application, and SQL Mobile 2005.
Intermittently, when initialising the subscription on a device, the app cycles through the tables multiple times, or even endlessly.
Can anyone shed some light on why this is happening?
Try to check the Replication Monitor (server side) for status, including number of records submitted. There are some issues with merge replication in the SQL Server 2005 RTM, that have been fixed in SQL Server 2005 SP2.|||Thanks for the response.
I checked the replication monitor as a matter of course - no problems there, everything looks fine.
Interesting what you say about SP2 - the box in question is running RTM, so maybe updating it will help. Is there anywhere that goes into detail on what these issues that you mention were, and if/how they have been addressed in SP2?
|||There are various merge/SQL Compact fixes, all documented at: http://support.microsoft.com/default.aspx?scid=kb;en-us;921896
Amongst others:
|||
Erik,
Thanks for that. I am recommending to my client that they upgrade to SP2, and will post back here with the results.
|||My client is hoping to install SP2 in a couple of weeks. In the meantime, they applied the hotfix, but the problem still exists.
They applied the hotfix to the server running the instance of SQL 2005, but not to the machine with the SQL Mobile server tools (and SQL 2005 client components). Is this correct?
I am hoping that, despite the failure of the hotfix to resolve the issue, the full SP2 update will make a difference...
|||Erik,
SP2 has now been applied to both servers, and the problem is now resolved.
Thanks very much for your help.
|||We are facing the same problem... so suggested client to apply for Sp2.... still the problem pesrsists,,,,
Any idea as how to resolve it... please let me know if anything need to be changed after applying Sp2...
Waiting for an answer..
|||It is important to apply SP2 on all servers, including IIS (web) servers (replication components)|||How to apply SQL server 2005 Service pack 2 on IIS web servers...
I really didnt understand this..can u please telll me what is it
|||If you are running IIS on a separate server, you need to update the replciation components to SP2, see this for info http://msdn2.microsoft.com/en-us/library/ms172937.aspx|||I will update the replication componets on IIS servers, but what abt the "SQLCSA30.dll" contained in the virtual directory... HOw to update this dll with Service pack 2....
Please correct me if i am using the wrong concepts.. I am new to these concepts..
|||I will update the replication componets on IIS servers, but what abt the "SQLCESA30.dll" contained in the virtual directory... HOw to update this dll with Service pack 2....
Please correct me if i am using the wrong concepts.. I am new to these concepts..
|||Thank You Erik...
My Problem solved after applying SP2
GOKI
Tuesday, March 20, 2012
Replication Problem
all the branches will require to share some data and in some places all the data may be required coz the director of the company may wanna see the whole data.
so i am planning to use sql data relication.but i don't know what are the things i need to have on server on net ,and how to configure the whole architechture .
if anyone of you can help me plz do that i am new to Replication i can give more information about my requrements and stuff i needed.
actually i am making the ms sql server as publisher and distributor and rest of the node mysql server as subscribers.i am using mysql DSN to make the subscriber but while i run the snapshot Relication the distribution agent give an error "Invalid Cursor State"
i don't know what to do
do you sujest some way other than replication in my scenario
i am waiting for some sujetions plz help me
Thanx i advace,any comments will be greate help to me
Regargs
DeepakYou need to re-apply the latest snapshot file from the publisher and copy it to the subscriber.|||Thanx for reply
i have tried to create snapshot files many times but distribution agent gives the same error
can u please give me solution in detail coz i am new to sql replication
Thanx
Replication Problem
I did the replication like it is quoted in my .NET CF Programming with C# -
Book and on this
<a
href=http://msdn.microsoft.com/SQL/SQLCE/default.aspx?pull=/msdnmag/issues/03/09/datapoints/default.aspx> ReplicationExample</a>
site, because i want to go through the sample of this site.
But it were to good to be true if all would be work, when i deploy the
sample application from this site on the Emulator and presses the
Synch-Button of the application, the following error occurs in a message box
on the display:
Error #1 of 2
Error Code: -2147467259
Message: SQL Server CE encountered problems in opening the SQL Server CE
database. [,,,Database name,,]
Minor Err.: 28559
Source: Microsoft SQL Server 2000 Windows CE Edition
Error #2 of 2
Error Code: -2147467259
Message: There is a file sharing violation. A different process might be
using the file. [,,,,]
Minor Err.: 25035
Source: Microsoft SQL Server 2000 Windows CE Edition
Error Paramter :\program files\CF\Inventory\TestDB1.sdf
I have changed the replication properties of the replication in the
sample application in that way:
SqlCeReplication oRpl = null;
try
{
Cursor.Current = Cursors.WaitCursor;
btnSynchronize.Enabled = false;
//Set up the Replication properties
oRpl = new SqlCeReplication();
oRpl.Publisher = "MachineName";
oRpl.PublisherLogin = "Username";
oRpl.PublisherPassword = "password of the user";
oRpl.InternetUrl = "http://MachineName/sqlce/sscesa20.dll"; // I do not know
if this path is correct.
oRpl.InternetLogin = "iusr_MachineName";
oRpl.InternetPassword = "";
oRpl.Subscriber = "CESubscriberTest";
oRpl.Publication = "NorthwindPub";
oRpl.PublisherDatabase = "Northwind";
oRpl.SubscriberConnectionString =
"Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;Dat a Source=" + this.m_sDataSource;
....
The strange thing is that in this code sample there is no method or anything
else for subscription..?
Do you know any ideas that this application would work without these problems?
regards
patrick
Hello,
I still work on the sample from this site
http://www.msdn.microsoft.com/SQL/SQ...s/default.aspx to get work on my local machine and on my PocketPc.
I have now changed the sample code once more a little bid in that way:
//Set up the Replication properties
oRpl = new SqlCeReplication();
oRpl.Publisher = "ACHATSCHITZ";//achatschitz is my MachineName
oRpl.PublisherLogin = "sa"; //sa is the user to gain access to a database of
the SQL Server with the sa as passwod.
oRpl.PublisherPassword = "sa";
oRpl.InternetUrl = "http://ACHATSCHITZ/pat/sscesa20.dll"; //pat is the alias
of my created virtual directory.
oRpl.InternetLogin = "iusr_ACHATSCHITZ";
oRpl.InternetPassword = "";
oRpl.Subscriber = "CESubscriberTest";
oRpl.Publication = "NorthwindPub";
oRpl.PublisherDatabase = "Northwind";
oRpl.SubscriberConnectionString =
"Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;Dat a Source=" +
this.m_sDataSource;
DialogResult oResponse = DialogResult.Yes;
But i still receive two errors when i execute the application:
Error #1 of 2
Error Code: -2147467259
Message: A call to SQL Server Reconciler failed.[,,,,]
Minor Err.: 29006
Source: Microsoft SQL Server 2000 Windows CE Edition
Error #2 of 2
Error Code: -2147201001
Message: The process could not deliver the snapshot to the Subscriber.
Minor Err.: 0
Source: Merge Replication Provider
I looked already in the msdn for these errors but i did not find something
useful. Hopefully anybody can help me because i think i will not able to work
it out without any help from here.
regards
patrick
PS: The only settings for the Replication i made were the creation of the
virtual directory and the creation of the publication, as quoted in your
doc-file and in the quoted url at the top of my posting.
|||I get it!!! Now it works, i had to add the IUSR_Achatschitz to the
Adminstratoren group.
Which files or directories actually do i consider in the context of the
replication? - means which files or directories are created or updated in
context of replication?
regards
patrick
|||When your PocketPC connects with the web server it executes an isapi dll. I
believe it only needs read and execute permission on this virtual directory
and the underlying files and folders.
You also have an option on where to place your snapshot and the sharename
for the snapshot. Here you need read and list permissions.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"pat" <pat@.discussions.microsoft.com> wrote in message
news:6E6F647D-BA12-4045-B8ED-29E2227B6A50@.microsoft.com...
> I get it!!! Now it works, i had to add the IUSR_Achatschitz to the
> Adminstratoren group.
> Which files or directories actually do i consider in the context of the
> replication? - means which files or directories are created or updated in
> context of replication?
> regards
> patrick
>
|||Okay thank you very much. Can you please explain me what additional things i
have to do when i want to synchronise my PocketPc SQL Server Ce Database with
a SQL Server Database on the Desktop via WLAN?
thanks in advance.
regards
patrick
|||You need to build an app to do the pull. This app has to be configured to
download the publication.
You have to build your publication and enable it for anonymous pull, and for
SQL CE subscribers. You have to configure your IIS Server to have a snapshot
share which is accessible by the SQL CE device. You also have to configure
the publication to deposit the snapshot files in this location.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"pat" <pat@.discussions.microsoft.com> wrote in message
news:A7A03E23-83CB-499D-B0A0-544B1627D704@.microsoft.com...
> Okay thank you very much. Can you please explain me what additional things
i
> have to do when i want to synchronise my PocketPc SQL Server Ce Database
with
> a SQL Server Database on the Desktop via WLAN?
> thanks in advance.
> regards
> patrick
Monday, March 12, 2012
Replication Performance
I made a vb.net application that create a subscriber and subscribe it to an
article that I have created.
Yesterday when I start this application it took 2 minutes to create the
subscriber and copy the database from the publisher to the subscriber
Today I start the same application but on another laptop for another
subscriber and after 55 minutes the process was not finish. I stop the
application and I delete all the objects that was create in the replication
for that new subscriber.
Because of that, users that use another application that queries the same
database
get a connection timeout.
Do you have any idea of where should I look to find the nature of the problem?
Thanks in advance!
Can you figure out at what part of the process does it stall? Creating the
database, connecting with the publisher/subscriber, deploying the snapshot?
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"GC" <GC@.discussions.microsoft.com> wrote in message
news:D747B6EE-9078-4FC6-8CF5-ABCB148164ED@.microsoft.com...
> Hi,
> I made a vb.net application that create a subscriber and subscribe it to
> an
> article that I have created.
> Yesterday when I start this application it took 2 minutes to create the
> subscriber and copy the database from the publisher to the subscriber
> Today I start the same application but on another laptop for another
> subscriber and after 55 minutes the process was not finish. I stop the
> application and I delete all the objects that was create in the
> replication
> for that new subscriber.
> Because of that, users that use another application that queries the same
> database
> get a connection timeout.
> Do you have any idea of where should I look to find the nature of the
> problem?
> Thanks in advance!
|||sp_who2
Find out who is generating a block.
Mike
http://www.solidqualitylearning.com
Disclaimer: This communication is an original work and represents my sole
views on the subject. It does not represent the views of any other person
or entity either by inference or direct reference.
"GC" <GC@.discussions.microsoft.com> wrote in message
news:D747B6EE-9078-4FC6-8CF5-ABCB148164ED@.microsoft.com...
> Hi,
> I made a vb.net application that create a subscriber and subscribe it to
> an
> article that I have created.
> Yesterday when I start this application it took 2 minutes to create the
> subscriber and copy the database from the publisher to the subscriber
> Today I start the same application but on another laptop for another
> subscriber and after 55 minutes the process was not finish. I stop the
> application and I delete all the objects that was create in the
> replication
> for that new subscriber.
> Because of that, users that use another application that queries the same
> database
> get a connection timeout.
> Do you have any idea of where should I look to find the nature of the
> problem?
> Thanks in advance!
|||The Process is not stall, there still activity.
When I go on the subscription of the subscriber I can see that the
subscription is running. If I do a refresh I can see that some row are
download to the subscriber
because the amount of rows that are downloaded differ each time I do a refresh
May be my problem is the way I create my Articles.
I am a beginner in replication so I dont expect to have the best strategie
the first time.
By the way I want to thank you for all the support that you do to all of us
It is appreciated.
"Hilary Cotter" wrote:
> Can you figure out at what part of the process does it stall? Creating the
> database, connecting with the publisher/subscriber, deploying the snapshot?
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
> "GC" <GC@.discussions.microsoft.com> wrote in message
> news:D747B6EE-9078-4FC6-8CF5-ABCB148164ED@.microsoft.com...
>
>