FIX:- Login failed for user ‘sa’. The user is not associated with a trusted SQL Server connection

Filed Under (Microsoft Windows, MSSQL) by Milind on 26-01-2012

Sometime while connecting MSSQL 2005 Remotely OR locally using MSSQL Management Studio (using user as SA) it throw following Error

Login failed for user 'sa'. The user is not associated with a trusted SQL Server connection. (Microsoft SQL Server, Error: 18452)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=18452&LinkId=20476

This Error occurs when SQL Server doesn’t support SQL Server Authentication Mode (Mixed Mode for MSSQL 2000). This issue can be fixed using following Steps:

1) Connect the MSSQL server using Windows Authentication of the server.

mssql1 FIX:  Login failed for user sa. The user is not associated with a trusted SQL Server connection

2) Right Click on the server name in the tree on the left and go to properties.

mssql21 FIX:  Login failed for user sa. The user is not associated with a trusted SQL Server connection

3) Click the Security Option. Now under Server authentication Select “SQL Server and Windows Authentication Mode” and press OK.

mssql31 FIX:  Login failed for user sa. The user is not associated with a trusted SQL Server connection

Now try to connect MSSQL using SA user. Please refer Microsoft KB Article 840219 for more information

MSSQL 2005 Error: Cannot recover the master database

Filed Under (Microsoft Windows, MSSQL) by Milind on 11-01-2012

Sometime due to some technical problems or uncleaned shutdown master database of MSSQL gets corrupted and while starting MSSQL service it throws following Error

mssqlerror 300x48 MSSQL 2005 Error: Cannot recover the master database

Application Log in Event Viewer shows following Error

Cannot recover the master database. SQL Server is unable to run. Restore master from a full backup, repair it, or rebuild it.

mssqlerror1 270x300 MSSQL 2005 Error: Cannot recover the master database

The above error shows that the System Database like Master has been corrupted. To fix this issue we need to rebuild the MSSQL system databases from Installation Disk.

1) Insert MSSQL Installation Disk in Optical Disk Drive

2) Go to Command Prompt (Start >> run >> cmd >> Enter)

3) Execute Following Command:

start /wait []\setup.exe /qn INSTANCENAME=[Instance Name] REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD=[Password]

Here, [Instance Name] will be the name of the MSSQL instance you want to set like MSSQLSERVER and [Password] will be the sa password for MSSQL.

Now try to start MSSQL service.

moz screenshot MSSQL 2005 Error: Cannot recover the master database

Cannot Connect to WMI Provider. You do not have permissions of the server is unreachable

Filed Under (Microsoft Windows, MSSQL, Plesk For Windows) by Milind on 09-01-2012

Sometime while connecting to MSSQL Server Configuration Manager it throws following Error

Cannot Connect to WMI Provider. You do not have permissions of the server is unreachable. Note that you can only manage SQL Server 2005 servers with the SQL Server Configuration Manager.
Invalid namespace[0x8004100e]

sql error1 300x60 Cannot Connect to WMI Provider. You do not have permissions of the server is unreachable

I have searched on Google and found that it happens when 32bit MSSSQL application is installed on 64bit Server and they suggested to execute the following command to fix the issue.

mofcomp "%programfiles%\Microsoft SQL Server\90\Shared\sqlmgmproviderxpsp2up.mof"


MOF files are appropriate for static management data or dynamic management data. Static data includes details such as the computer user’s phone number, office number, and name. Dynamic data includes details such as Microsoft SQL Server(tm) database sizes and applications installed with Windows Installer.

Find Table Count and Tables without Primary Key in MS SQL

Filed Under (Microsoft Windows, MSSQL, Tutorials) by Milind on 03-01-2012

Few days ago while working on MS SQL 2008 Transactional Replication I have faced following two issue
1) To find out the total number of tables to verify that Primary Server and Secondary server have same table count.
2) Tables without Primary key: After replication setup I have found that some tables were not replication. When I checked the logs it showed following error

This table cannot be published because it does not have a primary key column. Primary key columns are required for all tables in transactional publications.

1) Find Number of Tables:

a) Open MSSQL management studio and login using SA password or Administrator access.
b) Click on “New Query” and select the database using following command

use <database name>

 

c) now execute following Query to count the total number of tables in the database.

Select Count(*) As TableCount
From Information_Schema.Tables
Where Table_Type = ‘BASE TABLE’

 

You will get result like:

1 300x137 Find Table Count and Tables without Primary Key in MS SQL

2) Tables without primary key:

a) Open MSSQL management studio and login using SA password or Administrator access.
b) Click on “New Query” and select the database using following command

use <database name>

 

c) now execute following Query to find the Tables without Primary Key.

SELECT DISTINCT
T.TABLE_CATALOG
, T.TABLE_SCHEMA
, T.TABLE_NAME
FROM
INFORMATION_SCHEMA.TABLES T
LEFT OUTER JOIN
INFORMATION_SCHEMA.TABLE_CONSTRAINTS TC
ON TC.TABLE_NAME = T.TABLE_NAME
AND TC.TABLE_SCHEMA = T.TABLE_SCHEMA
AND TC.CONSTRAINT_TYPE = ‘PRIMARY KEY’
WHERE
TC.TABLE_NAME IS NULL
AND T.TABLE_TYPE = ‘BASE TABLE’

 

Output tab will show result like:

2 300x223 Find Table Count and Tables without Primary Key in MS SQL

Guide to MS SQL 2008 Transactional Replication (Create Publisher) Part-III

Filed Under (Microsoft Windows, MSSQL, Tutorials) by Milind on 02-01-2012

After you configure the Distributor Server (Guide to MS SQL 2008 Transactional Replication (Configure Distributor) Part-II) now I will explain how you can create & configure the Publisher.

Create & Configure Publisher

1) Select the Transactional Databases: Login to MSSQL Management Studio and go to  Server >> Replication (right Click) >> Publisher Properties >> Publication Databases >> Select the database you want as Transactional Database and press OK.

14 300x268 Guide to MS SQL 2008 Transactional Replication (Create Publisher) Part III

2) Now under Replication Right click on Local Publication and select “New Publication…

15 300x227 Guide to MS SQL 2008 Transactional Replication (Create Publisher) Part III

3) New Publication Wizard window will open; Press Next.

16 300x270 Guide to MS SQL 2008 Transactional Replication (Create Publisher) Part III

4) Publication Database: Select the database you want to publish and click on Next.

17 300x268 Guide to MS SQL 2008 Transactional Replication (Create Publisher) Part III

5) Publication type: You have to select the publication type you want to create. Select “Transactional Publication” and click on Next.

18 300x268 Guide to MS SQL 2008 Transactional Replication (Create Publisher) Part III

6) Articles: You have to select the objects which will be published. If you have stored procedures and views in your table you can either publish along with views or stored procedure.

19 300x268 Guide to MS SQL 2008 Transactional Replication (Create Publisher) Part III

7) Filter Table Rows: If you want to filter rows or don’t want to publish any row you can add filter here or you can just press Next without adding filter.

21 300x269 Guide to MS SQL 2008 Transactional Replication (Create Publisher) Part III

8) Snapshot Agent: You can manage when Snapshot agent should run. You can configure it to run immediatly or you can schedule it. Press Next.

22 300x270 Guide to MS SQL 2008 Transactional Replication (Create Publisher) Part III

9) Wizard Actions: Select the operations and action wizard will do. Select both the options and click Next.

23 300x269 Guide to MS SQL 2008 Transactional Replication (Create Publisher) Part III

 10) Script File Properties: Mention the path where publication file will be created and press Next.

24 300x271 Guide to MS SQL 2008 Transactional Replication (Create Publisher) Part III

11) Summary will be provided; press Finish to complete it and you will get following screen once New Publication has been created successfully.

25 300x268 Guide to MS SQL 2008 Transactional Replication (Create Publisher) Part III

The publication that you have created will appears under the Replication folder in SQL Server Management Studio.

26 300x296 Guide to MS SQL 2008 Transactional Replication (Create Publisher) Part III

Verify the status of Replication Agent

If you configured the “Snapshot Agent to start immediately” (on step Number 8) as recommended, you can now verify the progress of the Snapshot Agent by using Replication Monitor.

1) Login to MSSQL Management Studio and go to  Server >> Replication >> Local Publication (right Click) >> Launch Replication Monitor

27 300x241 Guide to MS SQL 2008 Transactional Replication (Create Publisher) Part III

2) The Publisher is now listed under the My Publishers node of Replication Monitor. Right side panel of the Replication Monitor will show the subscriptions (as we have not yet added any subcriptions it doesn’t show any).

28 300x189 Guide to MS SQL 2008 Transactional Replication (Create Publisher) Part III

Now go to Agents tab and make sure Snapshot agent and LogReader Agents are running

29 300x189 Guide to MS SQL 2008 Transactional Replication (Create Publisher) Part III

In Part IV (on Monday) I will explain how to configure Subscriber on which data from Publisher will be pushed.

Guide to MS SQL 2008 Transactional Replication (Create Subscriber) Part-IV

Filed Under (Microsoft Windows, MSSQL, Tutorials) by Milind on 16-12-2011

In Previous three parts I have explained about

  1. Transactional Replication
  2. How to configure Distribution Server
  3. How to create Publisher

 Today in last part of this series I am going to explain how you can create the Subcriber to the Publisher which will complete the replication setup. Before we start the configuration please make sure that the hostname of both the servers are configured properly and include proper enteries in hosts file (Please refer Part-I for more information).

Creating a Subscription

1) Go to Management studio (On Publisher Server) and right click on the Publication you have created >> New subcriptions…

32 300x281 Guide to MS SQL 2008 Transactional Replication (Create Subscriber) Part IV

2) New Subscription Wizard will open. Press Next

33 300x269 Guide to MS SQL 2008 Transactional Replication (Create Subscriber) Part IV

 3) Publication: Select the Publication Server from the Drop-down list and then select the Database and publication. Press Next after selection.

34 300x269 Guide to MS SQL 2008 Transactional Replication (Create Subscriber) Part IV

 4) Distribution Agent Location:  There are two type of Subscription i.e. Push Subscription and Pull Subscription using which we can setup replication. In Push Subscription publisher server pushes any changes made on database to the subscriber where as in case of Pull Subscription subscriber pull the data from publisher on a specified time. Push method is useful when the changes in database need to be replicated as soon as they occur.

So, select Push Subscription and press Next.

35 300x268 Guide to MS SQL 2008 Transactional Replication (Create Subscriber) Part IV

5) Subscribers: Here you have to select the subscriber i.e. Slave-DB, from the drop down “Add Subscriber” select “Add New SQL Subscriber…

36 300x269 Guide to MS SQL 2008 Transactional Replication (Create Subscriber) Part IV

You will now get a MSSQL Login prompt which is similar to MSSQL Management Studio. Login to the Subscriber server using the “Hostname” of the server and “SA” Login Details.

37 300x220 Guide to MS SQL 2008 Transactional Replication (Create Subscriber) Part IV

Select the Subscriber name and in “Subscription Database” column client on drop-down which will show all the databases on subscriber server. If you have created the database on subscriber just select it or click “New database“. Press Next.

38 300x269 Guide to MS SQL 2008 Transactional Replication (Create Subscriber) Part IV

6) Distribution Agent Security: This Page allows you to configure Agent security for each Subscriber that you have added, to ensure that the Distribution Agents have the correct permissions.

36 1 300x270 Guide to MS SQL 2008 Transactional Replication (Create Subscriber) Part IV

I have configured this using “SQL Server Agent” User as it already in Publisher Access List (PAL). The Windows user that you select must meet the following conditions:

  1. The user is included in the PAL.
  2. The user should be a member of the db_owner fixed database role in the subscription database.
  3. The user has read permissions on the snapshot share.

36 2 243x300 Guide to MS SQL 2008 Transactional Replication (Create Subscriber) Part IV

Enter MSSQL SA Login Details and press OK. On the Distribution Agent Security window, click Next.

7) Synchronization Schedule: By default Distributor Agent runs synchronization continuously, keep it as it is and press Next.

39 300x268 Guide to MS SQL 2008 Transactional Replication (Create Subscriber) Part IV

 8) Initialize Subscriptions: Select Immediately in the Initialize When and press Next.

40 300x267 Guide to MS SQL 2008 Transactional Replication (Create Subscriber) Part IV

9) Wizard Actions: Select both the options and press Next.

41 300x268 Guide to MS SQL 2008 Transactional Replication (Create Subscriber) Part IV

10) Script File Properties: Mention the path where Subscription file will be created and press Next.

42 300x267 Guide to MS SQL 2008 Transactional Replication (Create Subscriber) Part IV

11) Complete The Wizard: Summary of configuration will be shown. Press “Finish” to complete the subscription wizard.

43 300x269 Guide to MS SQL 2008 Transactional Replication (Create Subscriber) Part IV

12) Allow sometime to get it configured and you will able to see following screen when everything is properly configured.

44 300x269 Guide to MS SQL 2008 Transactional Replication (Create Subscriber) Part IV

Close the window and go to MSSQL Management Studio and open Replication Monitor for the Replication you have configured. You will able to see the Subscriber name and status now.

46 300x187 Guide to MS SQL 2008 Transactional Replication (Create Subscriber) Part IV

Now you can test the replication by adding or inserting in any table on publisher and it will get replicated in subscriber database as well.

Step by Step Guide to MS SQL 2008 Transactional Replication over Internet Part – I

Filed Under (MSSQL, Tutorials) by Milind on 09-12-2011

Replication is can be defined as a process of copying or reproducing information between two or more resources to improve reliability, fault-tolerance or accessibility. Replication can be configured on LAN, WAN or on Internet for database where same data is copied and stored on multiple database servers or for web services where website data is distributed on various locations to increase the availability of website/database in case of any failure at one location.

Database is a very important constraint of any website or origination as it stores all the data. Any problem or failure in database server can lead many problems like work stoppage, unwanted downtime, loss in terms of money and time etc. to over come such problems most of the organization opt for the database replication solution. Most of the database servers like MySQL, Oracle, MSSQL supports database replications and provide various tools for the it.

In this series I am going to explain how you can configure MSSQL 2008 Transactional Replication between two servers which are located in countries on two different continents i.e. America and India. Transactional Replication is a automatic process of distributing changes between master and slave. In this process data is copied in real-time from the master server which is termed as publisher to the slave server which plays the role of subscriber. On its first run Transactional Replication makes complete copy of the Publisher data, and then all subsequent copies transfer modified data to the Subscriber only. Microsoft SQL Server replication uses a publish, distributor and subscribe relation.

Publisher : Publisher is the Primary or Master server which host the original data or database where actual or real-time changes/updates are made.
Subscriber : The Secondary or slave server which gets or fetch data from Primary (Publisher) Database.
Distributor : This is a system or server which manage the data flow in complete replication setup. We can configure Distributor and publisher on single server.

The Snapshot Agent prepares snapshot files of tables and database objects and records synchronization jobs on distributor. Log Reader Agent monitors the transaction log of each database configured in replication and copies the transaction recorded by the Snapshot Agent. The Distribution Agent moves the initial snapshot jobs and the transactions held in the distribution database tables to Subscribers.

Treplication 300x262 Step by Step Guide to MS SQL 2008 Transactional Replication over Internet Part   I

Transactional replication is helpful when:

  • You want the changes made on primary server get reflected on secondary server as soon as they occur.
  • You want database to follow ACID properties.
  • Availability or connectivity of subscriber to the publisher is frequent.

Scenario:
User X have a website hosted in a US based Datacenter and the website is expected to have heavy traffic which is going to put lots of stress on database. Data of the website including user data, their profiles and other information is stored in the MSSQL 2008 Database. Now the owner want to configure a replication of database (in a remote) to increase the availability and fault-tolerance for the database, so he contacts a datacenter in India to Host his secondary database server in their facility.

In next post (Guide to MS SQL 2008 Transactional Replication (Configure Distributor) Part – II) I have explained how to configure the servers to host replication and steps to configure distribution server.

How to Convert/Migrate/Move/Copy MSSQL Database to MySQL Database?

Filed Under (MSSQL, MySQL) by Milind on 10-11-2011

Scenario

Your Company/Organization/Institute maintains certain data in MSSQL 2000 but now on suggestion of System Analyst or database administrator you want to move the data to MySQL 5.x.

Questions?
1) How to migrate the data?
2) Do we need to recreate the complete database schema?
3) Can we use any third Party Application to convert it and how feasible it will be?
etc.

Solution

Using following steps you can easily move/convert the data from MSSQL to MySql (Only data will be moved).

Downloads Required Tools

1) MySql ODBC connector: MySQL ODBC Connector will help Windows OS to configure MySQL as Database Source Name (DSN). It can be downloaded from http://dev.mysql.com/downloads/connector/odbc/5.1.htm


Install MySql ODBC connector on the Server.

Installation of MySql ODBC connector is pretty easy. You will just have to run setup file and follow the instructions.


Configure MySQL Database Source Name (DSN)

Database Source Name or DSN specifies a data structure that contains the information about a specific data source or database that an Open Database Connectivity (ODBC) driver needs in order to connect to that data source or database. To add new DSN follow the instructions given below

1) Go to “Control Panel -> Administrative Tools -> Data Source” which will open following windows.

1 300x244 How to Convert/Migrate/Move/Copy MSSQL Database to MySQL Database?

 

Click on “Add…” to add new DSN

2) Select “MySQL ODBC 5.1 Driver” from the list and press “Finish”

2 300x243 How to Convert/Migrate/Move/Copy MSSQL Database to MySQL Database?

 

3) Once you press Finish “MySQL Connector/ODBC Data Source Configuration” window will open.

3 300x270 How to Convert/Migrate/Move/Copy MSSQL Database to MySQL Database?

 

Here, provide the information about DSN, database, password etc. I have used Localhost as TCP/IP Server as I have the MySQL server installed locally and migrating it locally. Once the data is filled you can test the DSN connectivity with database. Then Press Ok to configure the DSN.

4) Now ODBC Data Source Administrator will show the Datasource which you have created.

4 300x245 How to Convert/Migrate/Move/Copy MSSQL Database to MySQL Database?

 

Export/Migrate Data from MSSQL to MySQL using DSN

1) Go to “MSSQL Enterprise Manager >> Databases >> Right Click the database you want to migrate or export >> All Tasks >> Export Data …

5 300x268 How to Convert/Migrate/Move/Copy MSSQL Database to MySQL Database?

 

2) You will get “Data Transformation Services Import/Export Wizard” Window. Press next.

6 300x232 How to Convert/Migrate/Move/Copy MSSQL Database to MySQL Database?

 

3) Choose Source: You have to select the Data Source from where the data will be migrated. As we are going to migrated data from MSSQL to MySQL select “Microsoft OLE DB Provider for SQL Server” and the name of database which you want to migrate.

7 300x233 How to Convert/Migrate/Move/Copy MSSQL Database to MySQL Database?

 

4) Select Destination: Select “MySQL ODBC 5.1 Driver” from dropdown list which will show the list of DSN in drop-down under “User/System DSN“. Select the DSN you have created and enter the login details.

8 300x234 How to Convert/Migrate/Move/Copy MSSQL Database to MySQL Database?

 

Press Next to Continue.

5) On “Specify Table Copy or Query” select “Copy table(s) and view(s) from the source database” and press next.

9 300x233 How to Convert/Migrate/Move/Copy MSSQL Database to MySQL Database?

6) Select Source tables(s) and view(s): Select the tables which you want to migrate. I have pressed “Select All” for complete database migration.

10 300x232 How to Convert/Migrate/Move/Copy MSSQL Database to MySQL Database?

 

Press “Next

7) Select “Run immediately“; press Next and on next screen press Finish to start Migration.

11 300x233 How to Convert/Migrate/Move/Copy MSSQL Database to MySQL Database?

 

12 300x234 How to Convert/Migrate/Move/Copy MSSQL Database to MySQL Database?

 

Now its time to have a cup of coffee and depending upon size of database it will take 20-30 minutes to complete.

13 300x234 How to Convert/Migrate/Move/Copy MSSQL Database to MySQL Database?

Unattended MSSQL 2005 Installation – Command Line Installation of MSSQL

Filed Under (Microsoft Windows, MSSQL, Plesk For Windows, Windows Virtuozzo) by Milind on 30-10-2011

Microsoft SQL Server is a relational model database server produced by Microsoft and it’s Installation is quite Easy using GUI where a user has to selects the options which he/she needs with the database server and install it. We can automate the installation procedure and make it so simple that MSSQL can be installed using a single command.

Automating SQL server installation is made easier in MSSQL 2005 version and we can define the components which need to be installed with setup.exe via command prompt OR we can create an ini file which will contain all the information about the installation. In this post I will explain the steps to install MSSQL 2005 using command prompt with the help of single command.

Install MSSQL using Command Prompt (By Defining all modules in command)

1) Insert the MSSQL installation media into the disk drive.

2) Open Command Prompt (Start >> Run >> cmd >> Enter)

3) Execute following command

Start /wait [CD or DVD Drive]\servers\setup.exe /qb INSTANCENAME=[InstanceName] ADDLOCAL=All PIDKEY=[pidkey value with no "-"] SAPWD=[StrongPassword] SQLACCOUNT=[domain\user] SQLPASSWORD=[DomainUserPassword] AGTACCOUNT=[domain\user] AGTPASSWORD=[DomainUserPassword] SQLBROWSERACCOUNT=[domain\user] SQLBROWSERPASSWORD=[DomainUserPassword]


Here, ADDLOCAL is set to “All” which will install all the components and modules bundled with the MSSQL. If you want customized modules then you can declare the modules instead of “All“.

Install MSSQL using .ini file

1) Open Notepad (Start >> Run >> Notepad >> Enter)

2) Insert all the “Installation Parameters” in that file. Following is the sample file which I have used to install MSSQL on my System

[Options]
USERNAME=USER
COMPANYNAME=USER
PIDKEY=1234657979764346
INSTALLSQLDIR=D:\MSSQL
ADDLOCAL=SQL_Engine,SQL_Replication,Client_Components,Connectivity,SQLXML
SECURITYMODE=SQL
SAPWD=Supp0rt
SQLACCOUNT=”NT AUTHORITY\SYSTEM”
AGTACCOUNT=”NT AUTHORITY\SYSTEM”
SQLBROWSERACCOUNT=”NT AUTHORITY\SYSTEM”
SQLCOLLATION=SQL_Latin1_General_CP1_CI_AS

Here, PIDKEY will be the Product Key of the product shipped with MSSQL.

3) Save this file with extension .ini (like sqlsetup.ini)

4) Execute following command to run the setup

[CD or DVD Drive]/servers/setup.exe /settings [path to setup file]\sqlsetup.ini /qb


Points to Note:

1) While specifying the accounts like SQLACCOUNT, AGTACCOUNT and SQLBROWSERACCOUNT make sure you define proper users. Users can be

Domain User account     : [domain\user]
Local System Account    : “NT AUTHORITY\SYSTEM”
Network Service Account : “NT AUTHORITY\NETWORK SERVICE”
Local Service Account   : “NT AUTHORITY\LOCAL SERVICE”

2) Microsoft provides a template.ini file in the installation media but I would strongly recommend to remove the options that you don’t want.

You can refer to Microsoft tutorial for more information and component help at http://msdn.microsoft.com/en-us/library/ms144259.aspx

Error: SQL Server replication requires the actual server name to make a connection to the server. Specify the actual server name.

Filed Under (2008 Server, Microsoft Windows, MSSQL) by Milind on 21-09-2011

Sometime while setting up MSSQL Replication you will receive following error at the time of connecting Slave or Secondary Database Server.

 

Detailed Error:
TITLE: Connect to Server
——————————

Cannot connect to failover-db.

——————————
ADDITIONAL INFORMATION:

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, ‘WIN-PNHS6NVSKPI’. (Replication.Utilities)

——————————
BUTTONS:

OK

error 300x85 Error: SQL Server replication requires the actual server name to make a connection to the server. Specify the actual server name.

 

Cause:

The problem mainly occurs when you change the computer name of the server after installation of MSSQL Server but even after reboot MSSQL uses the OLD Computer name as network name and the SQL Server instance name

Here,
OLD NAME of the Server was: WIN-PNHS6NVSKPI
Changed or New Name of the Server is: FAILOVER-DB

Solution.

1) Find Current Network Name and SQL Server Instance Name
First we need to check the Network name and the SQL Server instance name stored in the database. We can find it execute following commands in MSSQL Management Studio.

sp_helpserver
select @@servername

sp_helpserver: This Query or command shows the information of a particular or a replication server. This shows the server name, network name, identication number and collation name of the server.
select @@servername: This Query will return the server name on which the query is executed.

Following were the results which I recived clearly shows that the MSSQL didn’t accepted the new computer name which I have set i.e. FAILOVER-DB.

Output of sp_helpserver

error1 300x84 Error: SQL Server replication requires the actual server name to make a connection to the server. Specify the actual server name.

Output of select @@servername

error2 300x101 Error: SQL Server replication requires the actual server name to make a connection to the server. Specify the actual server name.

2) Change Server Instance Name and Network Name

Now to fix this issue we need change the Server Instance Name and Network Name. This can be done using Following Query

sp_dropserver ‘old_name’
go
sp_addserver ‘new_name’,'local’
go

In my case I have executed following query

sp_dropserver ‘WIN-PNHS6NVSKPI’
go
sp_addserver ‘FAILOVER-DB’,local
go

3) Restart MSSQL Server

Once the above commands get executed successfully; close the MSSQL Management Studio and restart MSSQL server using following commands in command prompt.

net stop mssqlserver
net start mssqlserver

error3 300x242 Error: SQL Server replication requires the actual server name to make a connection to the server. Specify the actual server name.

4) Verify the Changes

To verify if the name has been changed or not execute the queries mentioned in Step 1. I have recived following outputs

Output of sp_helpserver

error4 300x84 Error: SQL Server replication requires the actual server name to make a connection to the server. Specify the actual server name.

Output of select @@servername

error5 300x101 Error: SQL Server replication requires the actual server name to make a connection to the server. Specify the actual server name.

Thats it; now try to setup Replication of MSSQL and it won’t give that error again.

Follow US

Enter your email address:


I'm listed in Technology

Sponsors

Advertisement

Become Fan

tag cloud