Restore big database from SQL server 2014 into SQL Server 2008 - sql-server

I just bought a new 2008 SQL server license and am now trying to move my 10gb database from 2014 express(12.0.5203) to 2008 (10.0.1600.22)
I have tried the "export DB to script" way, but the file is very big(20GB) and a lot of data is not getting imported because of several datatype convertion errors.
Currently I am trying to copy the data by scripts like
SELECT *
INTO database.dbo.table
FROM OPENQUERY([localhost\WAWI], ' SELECT *
FROM [localhost\WAWI].database.dbo.[table]')
While having created a connection in sys.servers
EXEC sp_addlinkedserver #server='WAWI'
EXEC sp_addlinkedsrvlogin 'localhost\WAWI', 'false', NULL, 'sa', 'password'
But while executing the import script I am not able to connect to the local 2014 server even so I have opened it in the object explorer in a query window opened by the remote 2008 server
I get the following error message
The OLE DB provider 'SQLNCLI10' for linked server 'WAWI' has the message 'Login timeout expired' return.
The OLE DB provider 'SQLNCLI10' for linked server 'WAWI' has the message ' network-related or instance-specific error when establishing a connection to SQL Server. The server could not be found, or it can not be accessed. Verify that the instance name is correct and that allows SQL Server remote connections. For more information in SQL Server Books Online.' return.
Message 53, level 16, State 1, line 20
Named pipes provider: it could be made cannot connect to SQL Server [53].

Related

Can't connect to Azure SQL Server from 1/3 of our servers

I was trying to create a linked server from an on-premises SQL Server (BadMachine1), to an Azure SQL Server.
Code for creating the linked server
EXEC sp_addlinkedserver D365BI_Testing, '', 'SQLNCLI11', #datasrc='blabla.database.windows.net', #catalog = 'DbName'
EXEC sp_addlinkedsrvlogin D365BI_Testing, 'false', null, 'blabla_Admin', 'thepassword'
Created fine, but when testing connection on BadMachine1, this error message:
TITLE: Microsoft SQL Server Management Studio
------------------------------
The test connection to the linked server failed.
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
TCP Provider: The specified network name is no longer available.
Client unable to establish connection because an error was encountered during handshakes before login. Common causes include client attempting to connect to an unsupported version of SQL Server, server too busy to accept new connections or a resource limitation (memory or maximum allowed connections) on the server.
OLE DB provider "SQLNCLI11" for linked server "D365BI_Test2" returned message "Client unable to establish connection due to prelogin failure".
OLE DB provider "SQLNCLI11" for linked server "D365BI_Test2" returned message "Client unable to establish connection". (Microsoft SQL Server, Error: 64)
For help, click: https://learn.microsoft.com/sql/relational-databases/errors-events/mssqlserver-64-database-engine-error
------------------------------
BUTTONS:
OK
------------------------------
OK, tested on two other machines we have (GoodMachine1, GoodMachine2) - all of these are in the same data center. The test connection succeeded on both GoodMachine1 and GoodMachine2, and I could successfully write a query from Goodmachine1 and GoodMachine2's SQL Server, to the Azure SQL Server.
Next test:
Tried logging into each of the 3 machines, and opening up SSMS to try to connect to the Azure SQL Db. Connection worked on GoodMachine1 & GoodMachine2. Failed on BadMachine1, with the following error message.
TITLE: Connect to Server
Cannot connect to blabla.database.windows.net.
------------------------------
ADDITIONAL INFORMATION:
A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - The specified network name is no longer available.) (Microsoft SQL Server, Error: 64)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=64&LinkId=20476
------------------------------
The specified network name is no longer available
------------------------------
BUTTONS:
OK
------------------------------
I don't have access to check, but I'm told the firewall rules are OK on the Azure side.
There are some characteristics that differ among the 3 machines:
BadMachine1: ODBC Driver 11, old "Microsoft AS OLE DB Provider for SQL Server 2014". SQL Server 2014
GoodMachine1: ODBC Drivers 11, 13, 17, no OLE driver. SQL Server 2016
GoodMachine2: ODBC Driver 13, recent install of OLE driver. SQL Server 2016
Could the old ODBC driver on BadMachine1 be it? Other ideas? Apologies in advance, I've never tired to setup a linked server before, and don't really know what I'm doing very well.
Turns out our IT was blocking those outbound connections from BadMachine1. Now that they're unblocked, the linked server works fine.

TSQL Having trouble adding a linked SQL Server 2008 R2 to SQL Server 2000

I'm having trouble trying to create a Linked Server to connect from a SQL Server 2008 R2 instance to a SQL Server 2000 instance using Windows Auth.
I can connect to SQL Server 2000 with SSMS with Windows Auth so network and user permissions should be OK.
Here's what I'm using so far
EXEC master.dbo.sp_addlinkedserver
#server = N'SalesLogix_db'
,#srvproduct=N'SalesLogix_db'
,#provider=N'SQLNCLI'
,#datasrc=N'xxx.xxx.xxx.xxx'
GO
--Windows Authentication
EXEC master.dbo.sp_addlinkedsrvlogin
#rmtsrvname=N'SalesLogix_db'
,#useself=N'True'
,#locallogin=NULL
,#rmtuser=NULL
,#rmtpassword=NULL
GO
EXEC master.dbo.sp_testlinkedserver SalesLogix_db;
And this is the error.
OLE DB provider "SQLNCLI10" for linked server "SalesLogix_db" returned message "Login timeout expired".
OLE DB provider "SQLNCLI10" for linked server "SalesLogix_db" returned message "A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.".
Msg 53, Level 16, State 1, Line 24
Named Pipes Provider: Could not open a connection to SQL Server [53].
Where am I going wrong?
Thanks in advance
+1, I got the exact same error message today in a similar setup (sql 2008 R2 server linking to a sql 2008 server). I had existing linked servers which worked fine, but all of a sudden stopped working (exact same error message as you).
I narrowed it down to a batch of recent Windows Security Updates (~14 of them) on the linked server (running windows 2008 R2). I ended up rolling back those updates which resolved the issue temporarily.
At this point, I'm trying to figure out which one of these updates (KBxxxx) is the exact culprit.
After much toing and froing I finally found the answer.
I was failing with double-hop authentication failure.
When I created the Linked Server using SSMS on the db server itself it worked.

SQL Server Import/Export wizard login timeout expired

Both Source and destination servers are SQL Server 2008 R2 64 bit with SP3 on Windows server 2008 R2. I can successfully connect to both of them remotely using SSMS with SQL Server login that has db_owner permission on a custom database. But when I do import or export from one server to another using Import/Export wizard I get the following error related to destination server:
Login timeout expired
A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.
Named Pipes Provider: Could not open a connection to SQL Server [53]. (Microsoft SQL Server Native Client 10.0)
Update
Both the named pipes and TCP/IP are enabled on both the servers.

How can I connect to a local ODBC datasource

I created an ODBC database on my local machine with driver SQL server Native client 10.0, which connects to a remote server, see
.
I am working on a project about customized ODBC to an inhouse database and want to Test how I can connect to a data source using ODBC.
The question is how can I connect to the local ODBC using sql server studio manager? I tried
but it returns an error:
A network-related or instance-specific error occurred while
establishing a connection to SQL Server. The server was not found or
was not accessible. Verify that the instance name is correct and that
SQL Server is configured to allow remote connections. (provider: Named
Pipes Provider, error: 40 - Could not open a connection to SQL Server)
Any idea?
Connect to your local server through SSMS then create a linked server to the ODBC connection.
Echoing #Brian Boyd...
It is possible to create an ODBC connection to a SQL server running locally.
If you start SSMS and point it to a local database engine the Server Name should be Computer_Name\SQLEXPRESS with Authentication set to Windows Auth (ie the logged-in user: you). Computer_Name is found in the System window (Windows Key + Break) and is not localhost, 127.0.0.1, etc.
So, to set up an ODBC connection by running %windir%\syswow64\odbcad32.exe
In the System DSN tab, click [Add...]
Select SQL Server in the drivers list, click [Finish]
Now add a Name and Description but most importantly set the Server to be Computer_Name\SQLEXPRESS (whatever was shown in SSMS)
Click [Next] and leave the authentication set to Windows NT
Click [Next] and tick the default database tickbox to reveal a list of databases locally (if yours is listed here the ODBC settings have already worked)
Click [Next], [Finish] then [Test Data Source...] then all should be well
To connect to a remote server you don't need a DSN. You can enter the server name in the Server name field of SQL Server Management Studio and select Windows authentication or Database authentication.
It is not possible to connect SSMS to an ODBC data source. The only way is to create a linked server in your local SQL server as #Brian Boyd described.
Instructions are:
https://community.sagecrm.com/partner_community/b/hints_tips_and_tricks/archive/2010/05/10/connecting-to-a-sage-mas-erp-90-database-as-a-linked-server-within-ms-sql-server-2008.aspx
... and sp_AddLinkedServer documentation from MS HERE
… and with search = “sp_addlinkedserver for SOTAMAS90“, even an example from 2005
https://blog.coryfoy.com/2005/06/lets-go-crazy-accessing-timberline-pervasive-data-from-a-sql-linked-server/
Let’s see what turn says …. And think I will / would get the same error adding a linked server through UI that I get TSQL
Based on above, I tried …
EXEC sp_addlinkedserver
#server = 'TimberlineTest',
#provider = 'SOTAMAS90', -- Original command #provider = MSDASQL',
#srvproduct = '', --- MAS 90 4.0 ODBC Driver Original is #srvproduct='Timberline Data',
#datasrc = 'DataTest'

timeout when querying a linked server

I am able to connect to and use various databases on my SQL Server at 192.168.5.180.
When I use the query editor of my application, then I successfully add the server by:
sp_addlinkedserver(sp_addlinkedserver '192.168.5.180').
select * from [192.168.5.180].CRM_QA_V3_SYNC_V1..CR_FAQ
When I try to execute a query from my database query editor I get the below error.
Error:
OLE DB provider "SQLNCLI10" for linked server "192.168.5.180" returned message "Login timeout expired".
OLE DB provider "SQLNCLI10" for linked server "192.168.5.180" returned message "A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.".
Both servers are SQL Server 2008.

Resources