Showing posts with label enterprise. Show all posts
Showing posts with label enterprise. Show all posts

Friday, March 23, 2012

How to Setup Merge replication with sql express

I have a Windows Mobile aplication that uses merge replication to synchronize between sql compact and full sql Enterprise edition and It works great. Instantiating the SqlCeReplication object setting it's properties and calling Synchronize on it is pretty simple assuming everything is setup properly at the publisher.

For the life of me I can't figure out how to do this on the desktop (Programatically setup a subscription and create a database using objects in the System.Replication Namespace and hopefully call Synchronize on it).

Someone please point me in the right direction.

Thanks,


Patrick

See topic "Programming with Replication Management Objects", http://msdn2.microsoft.com/en-us/library/ms146869(SQL.90).aspx.

|||

Look at the MergeSynchronizationAgent class.

Here is some sample code in C#:

Code Snippet

_mergeAgent = newMergeSynchronizationAgent();

_mergeAgent.Publication = _publication;

_mergeAgent.Publisher = _publisher;

_mergeAgent.PublisherDatabase = _publisherDB;

_mergeAgent.PublisherSecurityMode = SecurityMode.Integrated;

_mergeAgent.Distributor = _distributor;

_mergeAgent.DistributorLogin = _distributorLogin;

_mergeAgent.DistributorPassword = _distributorPassword;

_mergeAgent.DistributorSecurityMode = SecurityMode.Standard;

_mergeAgent.Subscriber = _subscriber;

_mergeAgent.SubscriberDatabase = _subscriberDB;

_mergeAgent.SubscriberLogin = _subscriberLogin;

_mergeAgent.SubscriberPassword = _subscriberPassword;

_mergeAgent.SubscriberSecurityMode = SecurityMode.Standard;

_mergeAgent.SubscriptionType = SubscriptionOption.Pull;

_mergeAgent.LoginTimeout = _LoginTimeOut;

_mergeAgent.QueryTimeout = _QueryTimeOut;

_mergeAgent.Synchronize();

Hope this helps!

Monday, March 19, 2012

How to set up a central store for server registration information (Enterprise Ma

I tried this, all i can get from my central server is SQL
Registrations Groups, i can't get the registered servers
I.E. i set up a group named MAIN
under main, i registered servers APP01,APP02,APP03
when i remotely connect to my central server thru
Enterprise manager, all i get is MAIN, i can't get the
servers registrations
any one ever had this problem ?
TIA
JL
Books online article :
>To set up a central store for server registration
>information on a remote server

>Click the server, and then on the Tools menu, click
>Options.
>On the General tab, clear the Read/Store user independent
>check box.

>Use SQL Server Enterprise Manager to create server groups
>and register servers.
>To set up a central store for server registration
>information on a local server

>Click the server, and then on the Tools menu, click
>Options.

>On the General tab, click Read from remote.

>In the Server name box, type the name of the remote
>server from which you want to use registration
>information.
Have you logged in with the same Windows account, as the one with which you
registered the servers in EM?
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"JL Gervais" <anonymous@.discussions.microsoft.com> wrote in message
news:d19f01c439ca$fbe5e0a0$a401280a@.phx.gbl...
I tried this, all i can get from my central server is SQL
Registrations Groups, i can't get the registered servers
I.E. i set up a group named MAIN
under main, i registered servers APP01,APP02,APP03
when i remotely connect to my central server thru
Enterprise manager, all i get is MAIN, i can't get the
servers registrations
any one ever had this problem ?
TIA
JL
Books online article :
>To set up a central store for server registration
>information on a remote server

>Click the server, and then on the Tools menu, click
>Options.
>On the General tab, clear the Read/Store user independent
>check box.

>Use SQL Server Enterprise Manager to create server groups
>and register servers.
>To set up a central store for server registration
>information on a local server

>Click the server, and then on the Tools menu, click
>Options.

>On the General tab, click Read from remote.

>In the Server name box, type the name of the remote
>server from which you want to use registration
>information.
|||the Exact same NT account on both. i actually solved my
problem, i developped something using SQLDMO
but still, it would be useful if i could share my SQL
registrations with other users.
with SQL 7, exporting registry keys to other users was
possible, but it looks like it's not working with SQL2K.
Actually, i get the exact same behavior exporting registry
keys with SQL2K (i only get Groups, i do not get servers
registrations)
thanks
JL

>--Original Message--
>Have you logged in with the same Windows account, as the
one with which you
>registered the servers in EM?
>--
>HTH,
>Vyas, MVP (SQL Server)
>http://vyaskn.tripod.com/
>Is .NET important for a database professional?
>http://vyaskn.tripod.com/poll.htm
>
>"JL Gervais" <anonymous@.discussions.microsoft.com> wrote
in message
>news:d19f01c439ca$fbe5e0a0$a401280a@.phx.gbl...
>I tried this, all i can get from my central server is SQL
>Registrations Groups, i can't get the registered servers
>I.E. i set up a group named MAIN
>under main, i registered servers APP01,APP02,APP03
>when i remotely connect to my central server thru
>Enterprise manager, all i get is MAIN, i can't get the
>servers registrations
>any one ever had this problem ?
>TIA
>JL
>Books online article :
>
>
>
>.
>

How to set the recovery mode to SIMPLE?

How to set the recovery mode to SIMPLE on the Enterprise
Manager? If not, what is the SQL commend that could set
the Recovery mode to simply and bring it back? Tks!In the Enterprise Manager, you right click on the database, select
properties, then select the options tab, then select sinple in the recover
options drop down list.
To set the database to simple recovery in t-sql, use the alter database
command, eg:
alter database [mydb] set recovery simple
Regards,
Greg Linwood
SQL Server MVP
"KL" <anonymous@.discussions.microsoft.com> wrote in message
news:00c401c3c746$2e42be30$a601280a@.phx.gbl...
> How to set the recovery mode to SIMPLE on the Enterprise
> Manager? If not, what is the SQL commend that could set
> the Recovery mode to simply and bring it back? Tks!

Sunday, February 19, 2012

how to set a database to readwrite mode

Database was copied to another location in read only mode using enterprise manager. how can you reverse this using query analyzer in the new location?master.dbo.sp_dboption N'<DB Name>', N'read only', N'false'