Saturday, September 7, 2013

SSMS Limitations

When performing admin tasks or development tasks, some people like to use SQL Server Management Studio (SSMS) while some are like to use scripts. As many of you know, SSMS has limitations when it comes to perform some tasks. I found such instance while setting up replication for a testing purpose.

The requirement is simple, I wanted to setup a replication for a table. The uncommon factor here is, the publisher and subscriber databases are same. I used a AdventureWorks2008R2 as the database.

I first created the publication and then I used “New Subscriptions…” wizard in SSMS to add the subscription. See below screen;

image

The subscription database in this case is “AdventureWorks2008R2”. However I can not proceed further due to the information message shown bottom of dialog box.

You have selected the Publisher as a Subscriber and entered a subscription database that is the same as the publishing database. Select another subscription database

This leaves me only the scripting option to perform the required task. So I’ve used the below script for to create the subscription.

use [AdventureWorks2008R2]
exec sp_addsubscription @publication = N'ADW2008R2_SalesOrderDetail_New',
@subscriber = N'SUSANTHABWIN7\SQL2012', @destination_db = N'AdventureWorks2008R2',
@subscription_type = N'Push', @sync_type = N'automatic', @article = N'all',
@update_mode = N'read only', @subscriber_type = 0

1 comment:

  1. more comments are in LinkedIn
    http://www.linkedin.com/groupItem?view=&gid=2238491&type=member&item=271841304&commentID=162583337&report%2Esuccess=8ULbKyXO6NDvmoK7o030UNOYGZKrvdhBhypZ_w8EpQrrQI-BBjkmxwkEOwBjLE28YyDIxcyEO7_TA_giuRN#commentID_162583337

    ReplyDelete

How to interpret Disk Latency

I was analyzing IO stats in one of our SQL Servers and noticed that IO latency (Read / Write) are very high. As a rule of thumb, we know tha...