Ошибка odbc sqlstate 01000

Перейти к контенту

SQL Server 2012 Enterprise SQL Server 2012 Developer SQL Server 2012 Express SQL Server 2012 Standard SQL Server 2012 Web Еще…Меньше

Симптомы

При попытке войти в систему или подключиться к экземпляру Microsoft SQL Server 2012 устанавливается в Windows Server 2012, может появиться одно из следующих сообщений об ошибке тайм-аута:

  • Сообщение об ошибке 1

    [SQLSTATE 01000] (Сообщение 0) SQLState = 08001, NativeError = [SQLSTATE 01000] 258 ошибки (сообщение 0) = поставщик TCP [Microsoft] [SQL Server собственного клиента 11.0]: [258] ошибка истечения времени ожидания. [SQLSTATE 01000] (Сообщение 0) SQLState = 08001, NativeError = [SQLSTATE 01000] 258 ошибки (сообщение 0) = [Microsoft] [SQL Server собственного клиента 11.0] не удается завершить процесс входа в систему из-за задержки в ответ перед входом [SQLSTATE 01000] (сообщение 0) SQLState = S1T00 NativeError = 0 [SQLSTATE 01000] Ошибка (сообщение 0) = [Microsoft] [SQL Server собственного клиента 11.0] время ожидания входа истекло [SQLSTATE 01000] (сообщение 0)

  • Сообщение об ошибке 2

    <Штамп времени> -! [165] Ошибка ODBC: 0, время ожидания входа истекло [SQLSTATE HYT00]
    <Штамп времени> -! [298] Ошибка SQLServer: 258, не удается завершить процесс входа в систему из-за задержки в ответ перед входом [SQLSTATE 08001]
    <Штамп времени> -! [382] Ошибка входа с сервера «<Имя_базы_данных>» (SubSystemStepHistoryLogger)
    <Штамп времени> -! [298] Ошибка SQLServer: 258, поставщик TCP: [258] ошибка истечения времени ожидания. [SQLSTATE 08001]

Решение

Для решения этой проблемы попытайтесь сначала применить следующих обновлений Windows Server 2012 в Microsoft Knowledge Base:

2779768 Windows Server 2012 и Windows 8 накопительный пакет обновления: Декабрь 2012 г.

Причина

Эта проблема может возникнуть из-за блокировки поток, который вызывает AcceptEX вызовов в режиме ядра (драйвер AFD.sys) в Windows Server 2012. Записывать трассировку сетевого монитора, может оказаться, что некоторые сетевые пакеты достигают сервера. Однако из-за изменений, диспетчер ввода-вывода, вызов GetQueuedCompletionStatus не удается обнаружить сеть данные, полученные и в результате задержки операции сетевого приложения (в данном случае приложением является SQL Server).

Примечание. Windows Server 2012 вносит изменение в диспетчер ввода-вывода, и это изменение влияет на поведение вызова AcceptEX .

Статус

Корпорация Майкрософт подтверждает, что это проблема продуктов Майкрософт, перечисленных в разделе «Относится к».

Нужна дополнительная помощь?

  • Remove From My Forums
  • Question

  • In what circumstances do we get the below error. Shouldn’t it be a little more descriptive?

    The statement has been terminated. [SQLSTATE 01000]

    This is for an SQL SERVER 2005 SP2. I am running a rebuild index using a TSQL job. The rebuild runs fine for a while giving this error later.

Answers

    • Marked as answer by
      HumayunM
      Monday, December 28, 2009 9:49 AM
    • Edited by
      Kalman Toth
      Friday, September 28, 2012 7:28 PM

All replies

  • This is a generic message as you have already figured out and should be preceeded by a more detailed error which should be displayed in the SQL Agent job history log. If you have a profiler trace from that time, an additional error should also be present.

    This error message can also pop up when you have some inconsistencies in the database. Could you run a dbcc checktable on the table whose index you were rebuilding and ensure that there are no inconsistencies reported.

    HTH


    This posting is provided «AS IS» with no warranties, and confers no rights.
    My Blog: Troubleshooting SQL

  • The job history log is not complete either. The errorlog also doesn’t state anything

    «. …contact your system administrator. [SQLSTATE 01000] (Message 2528)  DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] (Message 2528)  DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] (Message 2528)  DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] (Message 2528)  DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] (Message 2528)  DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] (Message 2528)  DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] (Message 2528)  DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] (Message 2528)  DBCC execu…  The step failed.»

    And the good part is, when I ran the proc manually it ran fine. i.e. from sql management studio

    Very perplexing behaviour

  • When you create a maintenance plan you have the option to logging the details.
    Can you check your maintenance plan and take the logging path, go to that path and open the last executuion log file to get the error. Else go the maintenance plan and right click on the plan to view the history.


    Vidhya Sagar. Mark as Answer if it helps!

  • Hi VidhyaSagar,
    I am not using maintenance plan. I am using a TSQL proc.

    Thanks

  • Hi,

    To troubleshoot the issue, could you provide us the error messages logged in the SQL Server error log files. By default, the error log is located at Program FilesMicrosoft SQL ServerMSSQL.nMSSQLLOGERRORLOG and ERRORLOG.n files.

    If there are any more questions, please let me know.
    Thanks and Merry Christmas.


    ***Xiao Min Tan***Microsoft Online Community***

  • You mention «job history log» so I infer that this is a scheduled job from SQL Agent. 

    If so, you can edit the Advanced Properties of the Job Step.   There you will see options for retaining more log information.  For instance, you can select «Log to table» which will log information from running the job into a table in msdb.

    This may provide details missing from the logs that you are examining.

    After the job runs, you can come back to the Advanced Properties tab and click the View button to see what details were recorded.  Or you can select it out as:

    SELECT j.Name, s.Step_Name, s.Step_id, l.log_size, RIGHT(l.log, 50000) AS recent_log
    FROM msdb.dbo.sysjobs j JOIN msdb.dbo.sysjobsteps s
      ON j.job_id = s.job_id
      JOIN msdb.dbo.sysjobstepslogs l
        ON s.step_uid = l.step_uid

    The RIGHT(l.log, 50000) is just to limit the output, since if you use «Append output to existing entry…» this row can grow to two gigabytes.

    RLF

    • Edited by
      SQLWork
      Friday, December 25, 2009 2:59 PM
      Corrected last line
  • Hi Russel,
    I have done that part i.e select Advanced option and log to table and log to a file also. But the error is the same
    like tail of the file is:
    DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000]
    DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000]
    DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000]
    DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000]
    DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000]
    DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000]
    DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000]
    DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000]
    DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000]
    DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000]
    The statement has been terminated. [SQLSTATE 01000]

    Hi Xiao-Min,
    There is nothing of importance in errorlog.

    ———-
    But the thing is, I can run the rebuild index proc as a query but it is only giving this error from sql agent.

    Thanks all for contributing your valuable time.

    • Edited by
      Kalman Toth
      Friday, September 28, 2012 7:28 PM
  • Hi Kalman,

    I am not using print. I am writing below the code that is used as the TSQL PROC.

    CREATE procedure [dbo].[Usp_osdeDBReIndex_2k5]
    as
    DECLARE @TableName varchar(255)

    DECLARE TableCursor CURSOR FOR
    SELECT table_name FROM information_schema.tables
    WHERE table_type = ‘base table’

    OPEN TableCursor

    FETCH NEXT FROM TableCursor INTO @TableName
    WHILE @@FETCH_STATUS = 0
    BEGIN
    DBCC DBREINDEX(@TableName,’ ‘,90)
    FETCH NEXT FROM TableCursor INTO @TableName
    END

    CLOSE TableCursor

    DEALLOCATE TableCursor

  • I was able to recreate it in SQL Server 2008 using your modified sproc.

    DBCC execution completed. If DBCC printed error messages, contact your system administrator. 
    [SQLSTATE 01000] (Message 2528) 

    As some of the links above stated, it can just be ignored.

    You can also open a bug report at Connect:
    https://connect.microsoft.com/SQLServer?wa=wsignin1.0

    Sproc:

    CREATE procedure uspDBreindex
    as 
    DECLARE @TableSchema varchar(127), @TableName varchar(255)
    
    DECLARE TableCursor CURSOR FOR
    SELECT table_schema,table_name FROM information_schema.tables
    WHERE table_type = 'base table'
    
    OPEN TableCursor
    
    FETCH NEXT FROM TableCursor INTO @TableSchema, @TableName
    WHILE @@FETCH_STATUS = 0
    BEGIN
    	SET @TableName=@TableSchema+'.'+@TableName
    	DBCC DBREINDEX(@TableName,' ',90)
    	FETCH NEXT FROM TableCursor INTO  @TableSchema,@TableName
    END
    CLOSE TableCursor
    DEALLOCATE TableCursor
    GO
    

    Kalman Toth SQL SERVER 2012 & BI TRAINING
    New Book: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2012

    • Edited by
      Kalman Toth
      Friday, September 28, 2012 7:29 PM
  • Hi Kalman,
    I can ignore it but the job fails and sends a notification. Isn’t there a way to avoid the failure of job?

    Thanks

  • 70 and then I get «The statement has been terminated». Previously I was able to run the proc fine as a query at-least but now I am getting after 70 or so [SQLSTATE 01000] msg  This error message «Msg 0, Level 11, State 0, Line 0 A severe error occurred on the current command. The results, if any, should be discarded.»

    I found one KB article http://support.microsoft.com/kb/938102. It kind of qualifies. I am indeed on SP2.
    But the errorlog doesn’t have anything

    2009-12-27 21:25:45.90 Server      The time stamp counter of CPU on scheduler id 12 is not synchronized with other CPUs.
    2009-12-27 21:33:46.00 Server      The time stamp counter of CPU on scheduler id 2 is not synchronized with other CPUs.
    2009-12-27 21:57:46.03 Server      The time stamp counter of CPU on scheduler id 13 is not synchronized with other CPUs.
    2009-12-27 22:05:46.04 Server      The time stamp counter of CPU on scheduler id 14 is not synchronized with other CPUs.
    2009-12-27 22:33:46.05 Server      The time stamp counter of CPU on scheduler id 11 is not synchronized with other CPUs.
    2009-12-27 22:41:46.05 Server      The time stamp counter of CPU on scheduler id 12 is not synchronized with other CPUs.
    2009-12-27 22:57:46.06 Server      The time stamp counter of CPU on scheduler id 4 is not synchronized with other CPUs.
    2009-12-27 23:09:46.06 Server      The time stamp counter of CPU on scheduler id 14 is not synchronized with other CPUs.
    2009-12-27 23:13:46.06 Server      The time stamp counter of CPU on scheduler id 2 is not synchronized with other CPUs.
    2009-12-27 23:29:46.07 Server      The time stamp counter of CPU on scheduler id 13 is not synchronized with other CPUs.
    2009-12-28 00:00:08.94 spid20s     This instance of SQL Server has been using a process ID of 2824 since 12/10/2009 9:29:36 PM (local) 12/11/2009 2:29:36 AM (UTC). This is an informational message only; no user action is required.
    2009-12-28 00:05:46.08 Server      The time stamp counter of CPU on scheduler id 4 is not synchronized with other CPUs.
    2009-12-28 00:09:46.08 Server      The time stamp counter of CPU on scheduler id 12 is not synchronized with other CPUs.
    2009-12-28 00:21:46.09 Server      The time stamp counter of CPU on scheduler id 2 is not synchronized with other CPUs.
    2009-12-28 00:49:46.10 Server      The time stamp counter of CPU on scheduler id 13 is not synchronized with other CPUs.
    2009-12-28 01:13:46.11 Server      The time stamp counter of CPU on scheduler id 4 is not synchronized with other CPUs.
    2009-12-28 01:17:46.11 Server      The time stamp counter of CPU on scheduler id 14 is not synchronized with other CPUs.
    2009-12-28 01:29:46.11 Server      The time stamp counter of CPU on scheduler id 12 is not synchronized with other CPUs.
    2009-12-28 01:41:46.12 Server      The time stamp counter of CPU on scheduler id 2 is not synchronized with other CPUs.
    2009-12-28 01:53:46.12 Server      The time stamp counter of CPU on scheduler id 13 is not synchronized with other CPUs.
    2009-12-28 02:41:46.14 Server      The time stamp counter of CPU on scheduler id 4 is not synchronized with other CPUs.

    So I am not sure if this is the bug I am hitting for this rebuild index job. How to find out?

  • I get the below error.
    ————————————-
    The statement has been terminated.
    Msg 0, Level 11, State 0, Line 0
    A severe error occurred on the current command.  The results, if any, should be discarded.

    • Marked as answer by
      HumayunM
      Monday, December 28, 2009 9:49 AM
    • Edited by
      Kalman Toth
      Friday, September 28, 2012 7:28 PM
  • Thanks Kalman. I will work on that.

I’ve installed ignite 2.7 , nginx, php7.0-fpm.

I also installed unixodbc, unixodbc-dev, libtool, automake, libssl-dev, and m4.

The odbc installation looked at the official homepage and followed up, but there was a problem.

cat odbc.ini // odbcinst.ini // .odbc.ini (all same)

[Apache Ignite]
Description=Apache Ignite
DSN=Apache Ignite
Driver=/usr/local/lib/libignite-odbc.so
Setup=/usr/local/lib/libignite-odbc.so
DriverODBCVer=03.00
FileUsage=0
UsageCount=1

tail /etc/profile

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export LD_LIBRARY_PATH=/usr/local/lib/

ldd /usr/local/lib/libignite-odbc.so

linux-vdso.so.1 =>  (0x00007ffef07c0000)

libignite-binary-2.7.0.33575.so.0 => /usr/local/lib/libignite-binary-2.7.0.33575.so.0 (0x00007fd8b8d4d000)

libodbcinst.so.2 => /usr/lib/x86_64-linux-gnu/libodbcinst.so.2 (0x00007fd8b8b3b000)

libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fd8b87b9000)

libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd8b83ef000)

libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fd8b81d9000)

libignite-common-2.7.0.33575.so.0 => /usr/local/lib/libignite-common-2.7.0.33575.so.0 (0x00007fd8b7fc2000)

libltdl.so.7 => /usr/lib/x86_64-linux-gnu/libltdl.so.7 (0x00007fd8b7db8000)

libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fd8b7b9b000)

libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd8b7892000)

/lib64/ld-linux-x86-64.so.2 (0x00007fd8b9227000)

libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd8b768e000)

ex.php

<?php

try {
    // Connecting to Ignite using pre-configured DSN.
    $dbh = new PDO('odbc:Driver=Apache Ignite;ADDRESS=127.0.0.1:10800;Cache    =default');

    // Changing PDO error mode.
    $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

    // Preparing query.
    $dbs = $dbh->prepare('INSERT INTO city (id, name) VALUES (?, ?)');

    // Declaring parameters.
    $key = 777;
    $firstName = "James";

    // Binding parameters.
    $dbs->bindParam(1, $key);
    $dbs->bindParam(2, $firstName);

    // Executing the query.
    $dbs->execute();

} catch (PDOException $e) {
    print "Error!: " . $e->getMessage() . "n";
    die();
}

?>

localhost/ex.php

Error!: SQLSTATE[01000] SQLDriverConnect: 0 [unixODBC][Driver Manager]Can’t open lib ‘/usr/local/lib/libignite-odbc.so’ : file not found

I do not know what to try.
Thank you for your help.

  • Remove From My Forums
  • Question

  • Hi

    When I run a query like below against one remote SQL Server then it works fine and returns the required data;

    SELECT * FROM [ODBC;Driver=SQL Server;SERVER=Server1.com;DATABASE=MyDatabase;UID=MyUser;PWD=MyPass].MyTable

    However when I run the same query against a second remote SQL Server it gives me below error;

    Connection failed:
    SQLState: ‘01000’
    SQL Server Error: 14
    [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Invalid Instance()).
    Connection failed:
    SQLState: ‘08001’
    SQL Server Error: 14
    [Microsoft][ODBC SQL Server Driver][DBNETLIB]Invalid connection.

    I can otherwise access the second SQL Server fine. So it would seem there is something minor missing in the second server configuration that blocks running the query in this way. What is it I need to do on the problematic SQL Server to have me run the query
    fine?

    Many Thanks

    Regards

    • Edited by

      Tuesday, February 7, 2012 4:34 AM

Answers

  • «Invalid instance» seems to indicate you are trying use the default instance but you should specify a specific instance. For example not «Server=myMachine» but «Server=myMachineSQL2008». If you use SSMS to browse for servers, it will show all servers
    and their instance names.


    -Tom. Microsoft Access MVP

    • Marked as answer by
      Y a h y a
      Tuesday, February 7, 2012 7:10 PM
  • Remove From My Forums
  • Question

  • Hi

    When I run a query like below against one remote SQL Server then it works fine and returns the required data;

    SELECT * FROM [ODBC;Driver=SQL Server;SERVER=Server1.com;DATABASE=MyDatabase;UID=MyUser;PWD=MyPass].MyTable

    However when I run the same query against a second remote SQL Server it gives me below error;

    Connection failed:
    SQLState: ‘01000’
    SQL Server Error: 14
    [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Invalid Instance()).
    Connection failed:
    SQLState: ‘08001’
    SQL Server Error: 14
    [Microsoft][ODBC SQL Server Driver][DBNETLIB]Invalid connection.

    I can otherwise access the second SQL Server fine. So it would seem there is something minor missing in the second server configuration that blocks running the query in this way. What is it I need to do on the problematic SQL Server to have me run the query
    fine?

    Many Thanks

    Regards

    • Edited by

      Tuesday, February 7, 2012 4:34 AM

Answers

  • «Invalid instance» seems to indicate you are trying use the default instance but you should specify a specific instance. For example not «Server=myMachine» but «Server=myMachineSQL2008». If you use SSMS to browse for servers, it will show all servers
    and their instance names.


    -Tom. Microsoft Access MVP

    • Marked as answer by
      Y a h y a
      Tuesday, February 7, 2012 7:10 PM

I’m trying to create odbc connection to SQL Server but it returns following error:


Microsoft SQL Server Login

Connection failed: SQLState: ‘01000’ SQL Server Error: 53
[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen
(Connect()). Connection failed: SQLState: ‘08001’ SQL Server Error: 17
[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist
or access denied.


OK

I have verified the server name and credentials. But i am not able to make connection.

Please suggest.

Vijunav Vastivch's user avatar

asked Jun 21, 2017 at 7:15

Harman Veer Kaur's user avatar

4

  1. Check if TCP/UDP ports for Sql Server are present in Windows Firewalls. If not ,
    then you have create new incoming rules with (Sql Server Defaults) TCP port 1433
    and UDP port 1434 . These are the main things which allows you to establish a
    connection to Sql server from ODBC or any other external.

  2. If you are using the named instance server(Server\Instance Name) in ODBC
    Connection String, You have to enable the UDP port (1434) in Windows Firewall
    along with TCP Port(1433) created in the above step.

  3. Restart the SQL SERVER and SQL Browser Services from SQL Server Configuration
    Manager.

answered Jul 9, 2021 at 13:28

Srikar mogaliraju's user avatar

If the server name and credentials are correct, maybe you were using the wrong driver?…

In my case I used the wrong odbcad32.exe to connect to a MySQL server via a 32-bit driver. The confusing thing is, that the 64-bit odbcad32.exe shows other 32-bit MySQL datasources. After I clicked ‘Add’, two SQL driver entries showed up (I have two MySQL driver versions installed) and it took me a minute to realize that these are just preinstalled MS SQL drivers after it returned the error in the question.

If you need a 32-bit ODBC connection, make sure to use C:\windows\SysWoW64\odbcad32.exe — another everlasting source of confusion, if you don’t know that on a 64-bit Windows the 32-bit binaries are located in SysWoW64 and the 64-bit ones are in System32.

After the ODBC Administration Tool is no longer available from the Computer Management GUI in Windows 10/11, I suspect that this problem might have become more common in recent years, when people fall for the 64-bit version, using Windows key + ‘R’ and just type odbcad32.exe even if they want to establish a 32-bit driver connection for a legacy ODBC-using application.

answered Jun 2, 2022 at 10:52

thomiel's user avatar

thomielthomiel

2,49722 silver badges37 bronze badges

SQL Server Connection error 17 is usually triggered in the process of setting up an ODBC connection on Microsoft SQL.

Here at IbmiMedia, we have provided solutions to numerous SQL related issues as part of our Server Support Services.

In this context, we will look into why this error occurs and how to get rid of it.

Why does SQL server error 17 occurs?

From our experience with working with SQL server, this error can be triggered by various factors which we shall look into below;

i. When an incorrect SQL Server name is used while trying to connect to the database. Additionally, assigning a wrong port number, username or password can result in this error.
ii. Firewall restrictions can lead to SQL Server error 17.
iii. In a case where important ports such as telnet port 1433 are not accessible, this error will be triggered.
iv. This issue could occur when remote connection access is not enabled for the SQL Server Instance or in a case of a disabled TCP/IP or Named Pipes protocol in the SQL Server Configuration Manager.
v. Inability to connect to the IP address or a blocked port can result in the SQL Server not able to be reached.
vi. In a scenario where the SQL Server Browser service is not active.
vii. When UDP port 1434 is not accessible in the SQL Server.

How to solve SQL Server Error 17 sqlstate 01000

In a local machine, this bug can be fixed by simply following the instructions below;

i. Click on the Start Menu, and Search for «Control Panel«. From the control panel go to «Open Administrative Tools» and navigate to the Data Sources area.
ii. Now you should navigate through the «Go» tab — «User DSN» —  «ADD» . In this Window, navigate via, Create New Data SourceSQL Native Client or SQL ServerFinish.
iii. From here, you will be able to Create New Data Source To SQL Server.
Use the attributes below;

Name = SQLEXPRESS
Description = SQLEXPRESS

Next you should choose the name of the Server or type of Server in line with the appropriate path as seen below;

Server = COMP1\SQLEXPRESS (the name of your computer\SQLEXPRESS)

Then click on «Next» button to navigate to the next window where you can choose the Window or Server Authentication and click «Next» afterwards.

This will take you to a window where you can change Default Database with the Database FileName. It is also possible for you to change the database to your preferred here after which you should Click «Next«.
Here you can complete the process by clicking «Finish«.
The following report will be displayed on screen if successful;

Running connectivity tests…

Attempting connection
Connection established
Verifying option settings
Disconnecting from server

TESTS COMPLETED SUCCESSFULLY!
Need support in solving SQL errors? You can reach us Here.

Problem

DataStage ODBC connection to Microsoft SQL Server database with SSL enabled using driver VMmsss25.so fails with error:
ODBC Function «SQLConnect» reported: SQLSTATE=01000: Native Erorr Code = 11: Msg = [IBM(DataDirect OEM)[ODBC SQL Server Legacy Driver][libssclient25]Connectionread(recv()).

Resolving The Problem

The ODBC drivers bundled with InfoSphere Information Server contain two SQL Server wire protocol drivers for Unix environments, the legacy driver VMmsssnn.so and the newer native driver VMsqlsnn.so (where «nn» is the version of driver, i.e. VMmsss24, VMmsss25, etc). The VMsqlsnn driver is the rcommended driver.

The SQLConnect connection error SQLSTATE 01000, Error code 11 is typically resolved by switching from the VMmsssnn driver to the VMsqlsnn driver. Please review the .odbc.ini file in the DSEngine directory and find the data source entry used in the failing connection. Change the driver= line to point to the correct VMsqlsnn driver for your release of DataStage (i.e. VMsqls24.so, VMsqls25.so, VMsqls00.so, etc).

Use the example DNS entry for this driver in the original odbc.ini file as a template for the correct set of properties to define for that driver.

[{«Product»:{«code»:»SSVSEF»,»label»:»IBM InfoSphere DataStage»},»Business Unit»:{«code»:»BU059″,»label»:»IBM Software w\/o TPS»},»Component»:»—«,»Platform»:[{«code»:»PF002″,»label»:»AIX»},{«code»:»PF010″,»label»:»HP-UX»},{«code»:»PF016″,»label»:»Linux»},{«code»:»PF027″,»label»:»Solaris»}],»Version»:»11.3;8.5;8.7;9.1″,»Edition»:»»,»Line of Business»:{«code»:»LOB10″,»label»:»Data and AI»}}]

Перейти к контенту

I’m trying to create an ODBC connection to SQL Server, but when i do, i get error:

Connection failed:
SQLState: '01000'
SQL Server Error: 10060
[Microsoft][ODBC_SQL Server Driver][TCP/IP Sockets] COnnectionOpen (Connect()).
Connection failed:
SQLState: '08001'
SQL Server Error: 17
[Microsoft][ODBC_SQL Server Driver][TCP/IP Sockets] SQL Server does not exist or access denied.

Here’s what I’ve tried:

  1. not a firewall issue: tried with firewall on SQL Server turned off, and client turned off. Also able to telnet 1433 from client and that works fine.
  2. not an access issue: I can login from many different computers, including the SQL Server itself using the account i’m using on client (using SQL Server authentication)
  3. i can ping the hostname and IP address. (i’ve tried both)

The only thing i can think of is that the client computer is windows server 2003, and has various roles setup:

  • File Server
  • Application Server
  • Terminal Server
  • Domain Controller
  • DNS Server

I don’t know why these services are setup, but for the time being i can’t shut them off. Would it be any of these, and if so, is there a way to disable any of the aspects of them, that might be blocking SQL.

Any advise truly appreciated!

asked Nov 15, 2012 at 20:00

russds's user avatar

1

Found the issue. For some reason, even though SQL was not in use on the client, it was installed, and by going to All Programs -> Microsoft SQL Server -> Client Network Utility, i found that the protocal TCP/IP was using port 4717. I have no idea why that port was in use, and even further, i’m not sure why it would even matter — I was just setting up an odbc connection, and not using sql server (on the client) at all. Either way, I changed this to the typical port (1433), and like boom, ODBC connection works like charm!

answered Nov 15, 2012 at 20:44

russds's user avatar

russdsrussds

8255 gold badges25 silver badges48 bronze badges

1

Is it possible that the server in question has not been configured to use named pipes?

CAUSE
The most common reason that this connection attempt failed is
that this DSN or ODBC data source attempted to make a connection using
the TCP/IP sockets Net-Library, which is Dbmssocn.dll. Because the SQL
Server is not listening for incoming connections for TCP/IP sockets
clients, the connection fails. From ISQL/w, the second error message
stated above would be returned. The OS Error is 10061, and the
function call that failed was ConnectionOpen(connect()).

WORKAROUND
By default, SQL Server will listen for incoming connections
made by Named Pipes clients. Named Pipes is the default IPC mechanism
for clients to connect to a SQL Server version 4.2, 6.0, and 6.5
server. The Named Pipes DLL is Dbnmpntw.dll, and it should be located
in the WindowsSystem or WinntSystem32 directory. The TCP/IP sockets
netlib DLL is Dbmssocn.dll, and also should be in the WindowsSystem
or WinntSystem32 directory.The most common resolution to this problem
is to configure the client computer to connect using Named Pipes.
Configuring Named Pipes If the Microsoft Data Access Components (MDAC)
ODBC drivers have been installed on the computer, you can make this
change in the second step of the Create New Data Source wizard.

NOTE: You can download MDAC drivers from:

http://msdn2.microsoft.com/en-us/data/aa937730.aspx To configure the
client, start the Create New Data Source wizard, click the Client
Configuration button, and perform the following steps, based on the
version of the SQL Server ODBC driver you are using:

For SQL Server ODBC Driver version 3.50

Click the Net Library tab and use the drop down list box to set the 
default network (Net Library) to Named Pipes.
On the Advanced tab, remove any advanced entries that reference the 
server you are connecting to.
Click Done.

For SQL Server ODBC Driver version 3.70

In the Network Libraries section of the Edit Network Library Configuration 
dialog box, select Named Pipes.
Click OK.

If you do not have the MDAC ODBC drivers installed, you can use the
SQL Server Client Configuration Utility tool to set the default
Net-Library to Named Pipes. You can install the client utilities from
the SQL Server CD from the i386 directory.

Source: http://support.microsoft.com/kb/195566

answered Nov 15, 2012 at 20:19

SchmitzIT's user avatar

SchmitzITSchmitzIT

9,1449 gold badges65 silver badges92 bronze badges

1

By default SQL Native Client seems to look for MSSQLSERVER instance. However, if you use SQLEXPRESS all connections through that will fail.

Very strange, but try installing your SQL Server with MSSQLSERVER instance name — it should work!

answered Feb 18, 2015 at 17:23

tonysepia's user avatar

tonysepiatonysepia

3,3103 gold badges27 silver badges45 bronze badges

To create a new Data source to SQL Server, do the following steps:

  1. In host computer/server go to Sql server management studio —> open Security Section on left hand —> right click on Login, select New Login and then create a new account for your database which you want to connect to.

  2. Check the TCP/IP Protocol is Enable. go to All programs —> Microsoft SQL server 2008 —> Configuration Tools —> open Sql server configuration manager. On the left hand select client protocols (based on your operating system 32/64 bit). On the right hand, check TCP/IP Protocol be Enabled.

  3. In Remote computer/server, open Data source administrator. Control panel —> Administrative tools —> Data sources (ODBC).

  4. In User DSN or System DSN , click Add button and select Sql Server driver and then press Finish.

  5. Enter Name.

  6. Enter Server, note that: if you want to enter host computer address, you should enter that`s IP address without «\». eg. 192.168.1.5 and press Next.

  7. Select With SQL Server authentication using a login ID and password entered by the user.

  8. At the bellow enter your login ID and password which you created on first step. and then click Next.

  9. If shown Database is your database, click Next and then Finish.

answered May 25, 2016 at 7:31

Vahid's user avatar

VahidVahid

912 silver badges3 bronze badges

Adding another check point to all the above answers. Valid if you are using a named instance of Sql Server ( ServerNameInstanceName)

  • Make Sure UDP Port is enabled in Windows Firewall with SQL Server Default UDP Port
    Number 1434. If not present create a new incoming rule in Firewall for UDP 1434 Port and restart SQL Server Browser Services in SQL configuration Manager.

answered Jul 9, 2021 at 13:38

Srikar mogaliraju's user avatar

Help,

setup a new sql server 2012 on a windows 2012r2 server to replace old sql server 2005 on an old windows server 2003 machine.  When i test the ODBC connection locally on the server it works fine, however when i try to connect via windows 7 client machine
i get the following error:

Connection failed:
SQLState:’01000′
SQL Server Error:67
[Microsoft]ODBC SQL Server Driver][DBNETLIB]ConnectionOpen
(Connect()).
Connection failed:
SQLState:’08001′
SQL Server Error:17
[Microsoft]ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied

I think it must be a permissions thing, I’ve turned off the firewall for now and still no difference, ‘ve also made sure remote connection is enabled.  I can connect to the other sql server in studio manager on the new machine however, i can’t go do
the same in the old server, says:

cannot connect to hbfsqlpro1hbfsqlpro1
Additonal information a network related or instance specifc error occured while establising 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:SQL Network Interfaces, error 26 — error locationg server/instance specified) (Microsoft SQL server)

the instance is def correct, as that is what i use to connect locally on the new machine and what it comes up on the studio manager on the new machine.  STarting to pull my hair out somewhat, i’m sure it’s something really simple! 

@mauricio0015

hello, today I bring this new error, produced on a server with SO Debian 9.2 php7.1 in the function of connections to SQL SERVER on WINDOWS USING THE BOOKSTORES
«extension = sqlsrv.so» >> /etc/php/7.1/apache2/php.ini
, but at the beginning the connection to the sql server I receive the following error:
Error information:

SQLSTATE: 01000
Código: 0
Mensaje: [unixODBC] [Driver Manager] No se puede abrir lib ‘Controlador ODBC 13 para SQL Server’: archivo no encontrado

@mauricio0015
mauricio0015

changed the title
SQLSTATE: 01000 Código: 0 Mensaje: [unixODBC] [Driver Manager] No se puede abrir lib ‘Controlador ODBC 13 para SQL Server’: archivo no encontrado

Error information: SQLSTATE: 01000 Code: 0 Message: [unixODBC][Driver Manager]Can’t open lib ‘ODBC Driver 13 for SQL Server’ : file not found

Jan 27, 2018

@lilgreenbird

hi @mauricio0015,

Looks like the ODBC driver was not installed properly. The error message is from the Driver Manager, complaining that it can’t find the ODBC driver. Can you please check your odbc.ini and odbcinst.ini to make sure the ODBC driver entries are there? You should see the path of the ODBC driver in odbcinst.ini. Please make sure the path is valid and then verify your connection using isql first before attempting to connect with PHP. If isql succeeds and you’re still having connection issues, please list the entries you have in your config files and we can debug further. Thanks.

@nicdnepr

I got same problem
I use mssql on ubuntu 16.04
I removed package mssql-tools
and not can’t install
I got error
mssql-tools : Depends: msodbcsql (< 13.2.0.0) but 17.0.1.1-1 is to be installed
also php cant connect to mssql

@lilgreenbird

@nicdnepr your problem looks completely different than the one above. Are you trying to install mssql-tools? If you are using msodbcsql 17 preview then you will need to manually install the mssql-tools 17 preview which is also available in the preview folder
If you have further problems with this can you please open a new issue so we can look into this further and not hijack this one.
Thanks..

@neoacevedo

To me, odbcinst.ini has the following:

[ODBC Driver 17 for SQL Server]
Description=Microsoft ODBC Driver 17 for SQL Server
Driver=/opt/microsoft/msodbcsql/lib64/libmsodbcsql-17.0.so.1.1
UsageCount=1

But I’m getting exactly the same issue on openSUSE, running PHP CLI commands.

@david-puglielli

@neoacevedo Could you provide a repro script and the output you are getting?

@neoacevedo

good, I am just using yii migrate with the following configuration:

'db' => [
            'class' => 'yiidbConnection',
            'dsn' => "sqlsrv:Server=external-or-local-server,1433;Database=mydatabase",
            'username' => 'SA',
            'password' => 'the-password',
            'charset' => 'utf8',
            'enableQueryCache' => false
        ],

On Server I use localhost with exactly the same results as if it were Amazon or Azure RDS.
The output is just like

$ php yii migrate
PHP Fatal error:  Uncaught PDOException: SQLSTATE[01000]: [unixODBC][Driver Manager]Can't open lib 'ODBC Driver 13 for SQL Server' : file not found in /home/nestor/public_html/myproject/vendor/yiisoft/yii2/db/Connection.php:660

Although in local I can’t connect via sqlcmd, on remote I can do it without problems.

@david-puglielli

@neoacevedo The latest version of the pdo_sqlsrv driver defaults to ODBC driver 17, so if you are seeing an error message saying that ‘ODBC Driver 13 for SQL Server’ is not found, you are probably using an older version of the pdo_sqlsrv driver. Please try the latest preview by running pecl install pdo_sqlsrv-5.2.0RC1 or getting the binary from the release page and let us know if the problem is fixed. Thanks!

@neoacevedo

Following this comment I uninstalled the latest pdo_sqlsrv and sqlsrv drivers and installed the 5.2.0RC1 and now the error changes to SSL Provider: [error:140A90A1:SSL routines:SSL_CTX_new:library has no ciphers]’ so I will check for any issue related to this.

@dhawkshaw

Hi, I’ve been having the same problems on this using Leap 42.3. In my case I reverted back to to the previous versions of the driver and tools in zypper. ie msodbcsql.13.1.9.2-1 and mssql-tools.14.0.6.0-1 and that at least allows me to keep working. In the meantime, I’ve disabled the ms repo so that I don’t get any further updates.

@AnnoyingTechnology

I had this issue too, as the file libmsodbcsql did exist, I looked at its dependencies

root@Mespilus:/opt/microsoft/msodbcsql/lib64# readelf -d libmsodbcsql-13.1.so.9.2 | grep NEEDED
 0x0000000000000001 (NEEDED)             Shared library: [libdl.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libodbcinst.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libcrypto.so.1.0.0]
 0x0000000000000001 (NEEDED)             Shared library: [libkrb5.so.3]
 0x0000000000000001 (NEEDED)             Shared library: [libgssapi_krb5.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libcurl.so.4]
 0x0000000000000001 (NEEDED)             Shared library: [libssl.so.1.0.0]
 0x0000000000000001 (NEEDED)             Shared library: [libuuid.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libpthread.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]

And checking if each library was present on the system. This one was missing
0x0000000000000001 (NEEDED) Shared library: [libssl.so.1.0.0]
The package build by microsoft doesn’t seem to reference/require/install the proper libssl.
It references libssl1.0.0 while debian 9 seems to have >1.0.0 installed.
Installing libssl1.0.0 from debian jessie fixed it. for me

@artemik

@AnnoyingTechnology Where could I find the libssl.so.1.0.0 for Ubuntu?
I installed it via wget and dpkg. Is there a better way of doing this?

Many thanks for the fix!

@AnnoyingTechnology

@nenetto

I leave this scripts that worked for me.

My problem was pretty similar yours and I tested all the options such as changing the driver location, making a symbolic link, modify /etc/*.ini files, etc… nothing worked.

My problem, running python 3.6, pyodbc package in a docker container from alpine was the library libssl1.0.0

Here you will find my installation script for pyodbc Debian 8 (alpine) docker image using the driver v13

DRIVER={ODBC Driver 13 for SQL Server}

The command I run for database connection was:

import pyodbc
connection_string = 'DRIVER={ODBC Driver 13 for SQL Server};'
connection_string += 'SERVER={0};DATABASE={1};UID={2};PWD={3};'.format(host,dbname,user,pwd)
connection = pyodbc.connect(connection_string)

@J4VMC

Hello, I have the same issue running a Debian 8 docker container with PHP7.2 and Nginx. I’ve installed the MSSQL ODBC 13.1 drivers but I still get the

SQLSTATE [01000, 0]: [unixODBC][Driver Manager]Can't open lib '/opt/microsoft/msodbcsql/lib64/libmsodbcsql-13.1.so.9.2' : file not found

As others have suggested, I ran readelf -d libmsodbcsql-13.1.so.9.2 | grep NEEDED and then ldconfig -p | grep libraryname for each of the libraries, but to my surprise, all the needed libraries are available.

My odbcinst.ini contains the right path for the libmsodbcsql file, which also has the right permissions.

My Dockerfile looks like:

FROM php:fpm

RUN apt-get update 
    && apt-get install -y --no-install-recommends vim curl libssl libc6 debconf subversion git apt-transport-https apt-utils 
    build-essential locales acl mailutils wget zip unzip 
    gnupg gnupg1 gnupg2

ENV ACCEPT_EULA=Y

# Microsoft SQL Server Prerequisites
RUN apt-get update 
    && curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - 
    && curl https://packages.microsoft.com/config/debian/8/prod.list 
        > /etc/apt/sources.list.d/mssql-release.list 
    && apt-get install -y --no-install-recommends 
        locales 
        apt-transport-https 
    && echo "en_GB.UTF-8 UTF-8" > /etc/locale.gen 
    && locale-gen 
    && apt-get update 
    && apt-get -y --no-install-recommends install 
        msodbcsql 
        unixodbc-dev

RUN docker-php-ext-install mbstring pdo pdo_mysql 
    && pecl install sqlsrv pdo_sqlsrv xdebug 
    && docker-php-ext-enable sqlsrv pdo_sqlsrv xdebug

COPY php.ini /etc/php/latest/php.ini
COPY php-fpm-pool.conf /etc/php/latest/pool.d/www.conf

RUN curl -sSk https://getcomposer.org/installer | php -- --disable-tls && 
   mv composer.phar /usr/local/bin/composer

RUN groupadd dev -g 999
RUN useradd dev -g dev -d /home/dev -m

RUN rm -rf /var/lib/apt/lists/*

WORKDIR /var/www/symfony

EXPOSE 9000
CMD ["php-fpm"]

What could be the problem if the libraries exist and the path is correct?

@nenetto

Hey!

Did you try this line?
RUN DEBIAN_FRONTEND=noninteractive apt-get install libssl1.0.0

I think this a key problem when installing MSSql Drivers
Take a look and let me know, please

@J4VMC

@nenetto

@J4VMC Anywhere after apt-get update? Just add it to after your RUN command for MSQL:

# Microsoft SQL Server Prerequisites

RUN DEBIAN_FRONTEND=noninteractive apt-get install libssl1.0.0

;)

@J4VMC

@nenetto this is what I get when I run docker-compose up -d:

E: Package 'libssl1.0.0' has no installation candidate

And my Dockerfile looks like:

FROM php:fpm

RUN apt-get update 
    && apt-get install -y --no-install-recommends vim curl libc6 debconf subversion git apt-transport-https apt-utils 
    build-essential locales acl mailutils wget zip unzip 
    gnupg gnupg1 gnupg2

ENV ACCEPT_EULA=Y

# Microsoft SQL Server Prerequisites
RUN apt-get update 
    && curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - 
    && curl https://packages.microsoft.com/config/debian/8/prod.list 
        > /etc/apt/sources.list.d/mssql-release.list 
    && apt-get install -y --no-install-recommends 
        locales 
        apt-transport-https 
    && echo "en_GB.UTF-8 UTF-8" > /etc/locale.gen 
    && locale-gen 
    && apt-get update 
    && apt-get -y --no-install-recommends install 
        msodbcsql 
        unixodbc-dev

RUN DEBIAN_FRONTEND=noninteractive apt-get install libssl1.0.0

RUN docker-php-ext-install mbstring pdo pdo_mysql 
    && pecl install sqlsrv pdo_sqlsrv xdebug 
    && docker-php-ext-enable sqlsrv pdo_sqlsrv xdebug

COPY php.ini /etc/php/latest/php.ini
COPY php-fpm-pool.conf /etc/php/latest/pool.d/www.conf

RUN curl -sSk https://getcomposer.org/installer | php -- --disable-tls && 
   mv composer.phar /usr/local/bin/composer

RUN groupadd dev -g 999
RUN useradd dev -g dev -d /home/dev -m

RUN rm -rf /var/lib/apt/lists/*

WORKDIR /var/www/symfony

EXPOSE 9000
CMD ["php-fpm"]

@nenetto

@J4VMC ,

I check your docker image and you built it from php:fpm link here. This image is built from debian:stretch-slim link here.

This means that your image is debian based on the version 9.4 link here.

In summary, you should install following the instructions for Debian 9. However, you are installing drivers for debian 8
curl https://packages.microsoft.com/config/debian/8/prod.list -> From your Dockerfile.

So, my suggestion is the following Dockerfile for your problem

FROM php:fpm

RUN apt-get update 
    && apt-get install -y --no-install-recommends vim curl libssl libc6 debconf subversion git apt-transport-https apt-utils 
    build-essential locales acl mailutils wget zip unzip 
    gnupg gnupg1 gnupg2

ENV ACCEPT_EULA=Y

# Microsoft SQL Server Prerequisites
RUN apt-get update 
    && curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - 
    && curl https://packages.microsoft.com/config/debian/9/prod.list 
        > /etc/apt/sources.list.d/mssql-release.list 
    && apt-get install -y --no-install-recommends 
        locales 
        apt-transport-https 
    && echo "en_GB.UTF-8 UTF-8" > /etc/locale.gen 
    && locale-gen 
    && apt-get update 
    && apt-get -y --no-install-recommends install 
        msodbcsql 
        unixodbc-dev

RUN echo "deb http://security.debian.org/debian-security jessie/updates main" >> /etc/apt/sources.list && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install libssl1.0.0

RUN docker-php-ext-install mbstring pdo pdo_mysql 
    && pecl install sqlsrv pdo_sqlsrv xdebug 
    && docker-php-ext-enable sqlsrv pdo_sqlsrv xdebug

COPY php.ini /etc/php/latest/php.ini
COPY php-fpm-pool.conf /etc/php/latest/pool.d/www.conf

RUN curl -sSk https://getcomposer.org/installer | php -- --disable-tls && 
   mv composer.phar /usr/local/bin/composer

RUN groupadd dev -g 999
RUN useradd dev -g dev -d /home/dev -m

RUN rm -rf /var/lib/apt/lists/*

WORKDIR /var/www/symfony

EXPOSE 9000
CMD ["php-fpm"]

@J4VMC

@nenetto what php-fpm image can I use that is based on Debian 8? I think that will help with the issue.

@nenetto

I have no idea right now, take a look at dockerhub — php.

Anyway, in my last response I changed the debian repositories already. Test that image first and cross the fingers.

@J4VMC

@nenetto still throws the E: Unable to locate package libssl error. I’ll try and build a custom image based on Ubuntu 16.04. Thanks for your help

@sprankle

@yitam

@sprankle the name change applies to ODBC 17+
For those who want ODBC 13.1 the name remains the same

Перейти к контенту

SQL Server 2012 Enterprise SQL Server 2012 Developer SQL Server 2012 Express SQL Server 2012 Standard SQL Server 2012 Web Еще…Меньше

Симптомы

При попытке войти в систему или подключиться к экземпляру Microsoft SQL Server 2012 устанавливается в Windows Server 2012, может появиться одно из следующих сообщений об ошибке тайм-аута:

  • Сообщение об ошибке 1

    [SQLSTATE 01000] (Сообщение 0) SQLState = 08001, NativeError = [SQLSTATE 01000] 258 ошибки (сообщение 0) = поставщик TCP [Microsoft] [SQL Server собственного клиента 11.0]: [258] ошибка истечения времени ожидания. [SQLSTATE 01000] (Сообщение 0) SQLState = 08001, NativeError = [SQLSTATE 01000] 258 ошибки (сообщение 0) = [Microsoft] [SQL Server собственного клиента 11.0] не удается завершить процесс входа в систему из-за задержки в ответ перед входом [SQLSTATE 01000] (сообщение 0) SQLState = S1T00 NativeError = 0 [SQLSTATE 01000] Ошибка (сообщение 0) = [Microsoft] [SQL Server собственного клиента 11.0] время ожидания входа истекло [SQLSTATE 01000] (сообщение 0)

  • Сообщение об ошибке 2

    <Штамп времени> -! [165] Ошибка ODBC: 0, время ожидания входа истекло [SQLSTATE HYT00]
    <Штамп времени> -! [298] Ошибка SQLServer: 258, не удается завершить процесс входа в систему из-за задержки в ответ перед входом [SQLSTATE 08001]
    <Штамп времени> -! [382] Ошибка входа с сервера «<Имя_базы_данных>» (SubSystemStepHistoryLogger)
    <Штамп времени> -! [298] Ошибка SQLServer: 258, поставщик TCP: [258] ошибка истечения времени ожидания. [SQLSTATE 08001]

Решение

Для решения этой проблемы попытайтесь сначала применить следующих обновлений Windows Server 2012 в Microsoft Knowledge Base:

2779768 Windows Server 2012 и Windows 8 накопительный пакет обновления: Декабрь 2012 г.

Причина

Эта проблема может возникнуть из-за блокировки поток, который вызывает AcceptEX вызовов в режиме ядра (драйвер AFD.sys) в Windows Server 2012. Записывать трассировку сетевого монитора, может оказаться, что некоторые сетевые пакеты достигают сервера. Однако из-за изменений, диспетчер ввода-вывода, вызов GetQueuedCompletionStatus не удается обнаружить сеть данные, полученные и в результате задержки операции сетевого приложения (в данном случае приложением является SQL Server).

Примечание. Windows Server 2012 вносит изменение в диспетчер ввода-вывода, и это изменение влияет на поведение вызова AcceptEX .

Статус

Корпорация Майкрософт подтверждает, что это проблема продуктов Майкрософт, перечисленных в разделе «Относится к».

Нужна дополнительная помощь?

  • Remove From My Forums
  • Question

  • In what circumstances do we get the below error. Shouldn’t it be a little more descriptive?

    The statement has been terminated. [SQLSTATE 01000]

    This is for an SQL SERVER 2005 SP2. I am running a rebuild index using a TSQL job. The rebuild runs fine for a while giving this error later.

Answers

    • Marked as answer by
      HumayunM
      Monday, December 28, 2009 9:49 AM
    • Edited by
      Kalman Toth
      Friday, September 28, 2012 7:28 PM

All replies

  • This is a generic message as you have already figured out and should be preceeded by a more detailed error which should be displayed in the SQL Agent job history log. If you have a profiler trace from that time, an additional error should also be present.

    This error message can also pop up when you have some inconsistencies in the database. Could you run a dbcc checktable on the table whose index you were rebuilding and ensure that there are no inconsistencies reported.

    HTH


    This posting is provided «AS IS» with no warranties, and confers no rights.
    My Blog: Troubleshooting SQL

  • The job history log is not complete either. The errorlog also doesn’t state anything

    «. …contact your system administrator. [SQLSTATE 01000] (Message 2528)  DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] (Message 2528)  DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] (Message 2528)  DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] (Message 2528)  DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] (Message 2528)  DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] (Message 2528)  DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] (Message 2528)  DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000] (Message 2528)  DBCC execu…  The step failed.»

    And the good part is, when I ran the proc manually it ran fine. i.e. from sql management studio

    Very perplexing behaviour

  • When you create a maintenance plan you have the option to logging the details.
    Can you check your maintenance plan and take the logging path, go to that path and open the last executuion log file to get the error. Else go the maintenance plan and right click on the plan to view the history.


    Vidhya Sagar. Mark as Answer if it helps!

  • Hi VidhyaSagar,
    I am not using maintenance plan. I am using a TSQL proc.

    Thanks

  • Hi,

    To troubleshoot the issue, could you provide us the error messages logged in the SQL Server error log files. By default, the error log is located at Program FilesMicrosoft SQL ServerMSSQL.nMSSQLLOGERRORLOG and ERRORLOG.n files.

    If there are any more questions, please let me know.
    Thanks and Merry Christmas.


    ***Xiao Min Tan***Microsoft Online Community***

  • You mention «job history log» so I infer that this is a scheduled job from SQL Agent. 

    If so, you can edit the Advanced Properties of the Job Step.   There you will see options for retaining more log information.  For instance, you can select «Log to table» which will log information from running the job into a table in msdb.

    This may provide details missing from the logs that you are examining.

    After the job runs, you can come back to the Advanced Properties tab and click the View button to see what details were recorded.  Or you can select it out as:

    SELECT j.Name, s.Step_Name, s.Step_id, l.log_size, RIGHT(l.log, 50000) AS recent_log
    FROM msdb.dbo.sysjobs j JOIN msdb.dbo.sysjobsteps s
      ON j.job_id = s.job_id
      JOIN msdb.dbo.sysjobstepslogs l
        ON s.step_uid = l.step_uid

    The RIGHT(l.log, 50000) is just to limit the output, since if you use «Append output to existing entry…» this row can grow to two gigabytes.

    RLF

    • Edited by
      SQLWork
      Friday, December 25, 2009 2:59 PM
      Corrected last line
  • Hi Russel,
    I have done that part i.e select Advanced option and log to table and log to a file also. But the error is the same
    like tail of the file is:
    DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000]
    DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000]
    DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000]
    DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000]
    DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000]
    DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000]
    DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000]
    DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000]
    DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000]
    DBCC execution completed. If DBCC printed error messages, contact your system administrator. [SQLSTATE 01000]
    The statement has been terminated. [SQLSTATE 01000]

    Hi Xiao-Min,
    There is nothing of importance in errorlog.

    ———-
    But the thing is, I can run the rebuild index proc as a query but it is only giving this error from sql agent.

    Thanks all for contributing your valuable time.

    • Edited by
      Kalman Toth
      Friday, September 28, 2012 7:28 PM
  • Hi Kalman,

    I am not using print. I am writing below the code that is used as the TSQL PROC.

    CREATE procedure [dbo].[Usp_osdeDBReIndex_2k5]
    as
    DECLARE @TableName varchar(255)

    DECLARE TableCursor CURSOR FOR
    SELECT table_name FROM information_schema.tables
    WHERE table_type = ‘base table’

    OPEN TableCursor

    FETCH NEXT FROM TableCursor INTO @TableName
    WHILE @@FETCH_STATUS = 0
    BEGIN
    DBCC DBREINDEX(@TableName,’ ‘,90)
    FETCH NEXT FROM TableCursor INTO @TableName
    END

    CLOSE TableCursor

    DEALLOCATE TableCursor

  • I was able to recreate it in SQL Server 2008 using your modified sproc.

    DBCC execution completed. If DBCC printed error messages, contact your system administrator. 
    [SQLSTATE 01000] (Message 2528) 

    As some of the links above stated, it can just be ignored.

    You can also open a bug report at Connect:
    https://connect.microsoft.com/SQLServer?wa=wsignin1.0

    Sproc:

    CREATE procedure uspDBreindex
    as 
    DECLARE @TableSchema varchar(127), @TableName varchar(255)
    
    DECLARE TableCursor CURSOR FOR
    SELECT table_schema,table_name FROM information_schema.tables
    WHERE table_type = 'base table'
    
    OPEN TableCursor
    
    FETCH NEXT FROM TableCursor INTO @TableSchema, @TableName
    WHILE @@FETCH_STATUS = 0
    BEGIN
    	SET @TableName=@TableSchema+'.'+@TableName
    	DBCC DBREINDEX(@TableName,' ',90)
    	FETCH NEXT FROM TableCursor INTO  @TableSchema,@TableName
    END
    CLOSE TableCursor
    DEALLOCATE TableCursor
    GO
    

    Kalman Toth SQL SERVER 2012 & BI TRAINING
    New Book: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2012

    • Edited by
      Kalman Toth
      Friday, September 28, 2012 7:29 PM
  • Hi Kalman,
    I can ignore it but the job fails and sends a notification. Isn’t there a way to avoid the failure of job?

    Thanks

  • 70 and then I get «The statement has been terminated». Previously I was able to run the proc fine as a query at-least but now I am getting after 70 or so [SQLSTATE 01000] msg  This error message «Msg 0, Level 11, State 0, Line 0 A severe error occurred on the current command. The results, if any, should be discarded.»

    I found one KB article http://support.microsoft.com/kb/938102. It kind of qualifies. I am indeed on SP2.
    But the errorlog doesn’t have anything

    2009-12-27 21:25:45.90 Server      The time stamp counter of CPU on scheduler id 12 is not synchronized with other CPUs.
    2009-12-27 21:33:46.00 Server      The time stamp counter of CPU on scheduler id 2 is not synchronized with other CPUs.
    2009-12-27 21:57:46.03 Server      The time stamp counter of CPU on scheduler id 13 is not synchronized with other CPUs.
    2009-12-27 22:05:46.04 Server      The time stamp counter of CPU on scheduler id 14 is not synchronized with other CPUs.
    2009-12-27 22:33:46.05 Server      The time stamp counter of CPU on scheduler id 11 is not synchronized with other CPUs.
    2009-12-27 22:41:46.05 Server      The time stamp counter of CPU on scheduler id 12 is not synchronized with other CPUs.
    2009-12-27 22:57:46.06 Server      The time stamp counter of CPU on scheduler id 4 is not synchronized with other CPUs.
    2009-12-27 23:09:46.06 Server      The time stamp counter of CPU on scheduler id 14 is not synchronized with other CPUs.
    2009-12-27 23:13:46.06 Server      The time stamp counter of CPU on scheduler id 2 is not synchronized with other CPUs.
    2009-12-27 23:29:46.07 Server      The time stamp counter of CPU on scheduler id 13 is not synchronized with other CPUs.
    2009-12-28 00:00:08.94 spid20s     This instance of SQL Server has been using a process ID of 2824 since 12/10/2009 9:29:36 PM (local) 12/11/2009 2:29:36 AM (UTC). This is an informational message only; no user action is required.
    2009-12-28 00:05:46.08 Server      The time stamp counter of CPU on scheduler id 4 is not synchronized with other CPUs.
    2009-12-28 00:09:46.08 Server      The time stamp counter of CPU on scheduler id 12 is not synchronized with other CPUs.
    2009-12-28 00:21:46.09 Server      The time stamp counter of CPU on scheduler id 2 is not synchronized with other CPUs.
    2009-12-28 00:49:46.10 Server      The time stamp counter of CPU on scheduler id 13 is not synchronized with other CPUs.
    2009-12-28 01:13:46.11 Server      The time stamp counter of CPU on scheduler id 4 is not synchronized with other CPUs.
    2009-12-28 01:17:46.11 Server      The time stamp counter of CPU on scheduler id 14 is not synchronized with other CPUs.
    2009-12-28 01:29:46.11 Server      The time stamp counter of CPU on scheduler id 12 is not synchronized with other CPUs.
    2009-12-28 01:41:46.12 Server      The time stamp counter of CPU on scheduler id 2 is not synchronized with other CPUs.
    2009-12-28 01:53:46.12 Server      The time stamp counter of CPU on scheduler id 13 is not synchronized with other CPUs.
    2009-12-28 02:41:46.14 Server      The time stamp counter of CPU on scheduler id 4 is not synchronized with other CPUs.

    So I am not sure if this is the bug I am hitting for this rebuild index job. How to find out?

  • I get the below error.
    ————————————-
    The statement has been terminated.
    Msg 0, Level 11, State 0, Line 0
    A severe error occurred on the current command.  The results, if any, should be discarded.

    • Marked as answer by
      HumayunM
      Monday, December 28, 2009 9:49 AM
    • Edited by
      Kalman Toth
      Friday, September 28, 2012 7:28 PM
  • Thanks Kalman. I will work on that.

I’ve installed ignite 2.7 , nginx, php7.0-fpm.

I also installed unixodbc, unixodbc-dev, libtool, automake, libssl-dev, and m4.

The odbc installation looked at the official homepage and followed up, but there was a problem.

cat odbc.ini // odbcinst.ini // .odbc.ini (all same)

[Apache Ignite]
Description=Apache Ignite
DSN=Apache Ignite
Driver=/usr/local/lib/libignite-odbc.so
Setup=/usr/local/lib/libignite-odbc.so
DriverODBCVer=03.00
FileUsage=0
UsageCount=1

tail /etc/profile

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export LD_LIBRARY_PATH=/usr/local/lib/

ldd /usr/local/lib/libignite-odbc.so

linux-vdso.so.1 =>  (0x00007ffef07c0000)

libignite-binary-2.7.0.33575.so.0 => /usr/local/lib/libignite-binary-2.7.0.33575.so.0 (0x00007fd8b8d4d000)

libodbcinst.so.2 => /usr/lib/x86_64-linux-gnu/libodbcinst.so.2 (0x00007fd8b8b3b000)

libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fd8b87b9000)

libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd8b83ef000)

libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fd8b81d9000)

libignite-common-2.7.0.33575.so.0 => /usr/local/lib/libignite-common-2.7.0.33575.so.0 (0x00007fd8b7fc2000)

libltdl.so.7 => /usr/lib/x86_64-linux-gnu/libltdl.so.7 (0x00007fd8b7db8000)

libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fd8b7b9b000)

libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd8b7892000)

/lib64/ld-linux-x86-64.so.2 (0x00007fd8b9227000)

libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd8b768e000)

ex.php

<?php

try {
    // Connecting to Ignite using pre-configured DSN.
    $dbh = new PDO('odbc:Driver=Apache Ignite;ADDRESS=127.0.0.1:10800;Cache    =default');

    // Changing PDO error mode.
    $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

    // Preparing query.
    $dbs = $dbh->prepare('INSERT INTO city (id, name) VALUES (?, ?)');

    // Declaring parameters.
    $key = 777;
    $firstName = "James";

    // Binding parameters.
    $dbs->bindParam(1, $key);
    $dbs->bindParam(2, $firstName);

    // Executing the query.
    $dbs->execute();

} catch (PDOException $e) {
    print "Error!: " . $e->getMessage() . "n";
    die();
}

?>

localhost/ex.php

Error!: SQLSTATE[01000] SQLDriverConnect: 0 [unixODBC][Driver Manager]Can’t open lib ‘/usr/local/lib/libignite-odbc.so’ : file not found

I do not know what to try.
Thank you for your help.

  • Remove From My Forums
  • Question

  • Hi

    When I run a query like below against one remote SQL Server then it works fine and returns the required data;

    SELECT * FROM [ODBC;Driver=SQL Server;SERVER=Server1.com;DATABASE=MyDatabase;UID=MyUser;PWD=MyPass].MyTable

    However when I run the same query against a second remote SQL Server it gives me below error;

    Connection failed:
    SQLState: ‘01000’
    SQL Server Error: 14
    [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Invalid Instance()).
    Connection failed:
    SQLState: ‘08001’
    SQL Server Error: 14
    [Microsoft][ODBC SQL Server Driver][DBNETLIB]Invalid connection.

    I can otherwise access the second SQL Server fine. So it would seem there is something minor missing in the second server configuration that blocks running the query in this way. What is it I need to do on the problematic SQL Server to have me run the query
    fine?

    Many Thanks

    Regards

    • Edited by

      Tuesday, February 7, 2012 4:34 AM

Answers

  • «Invalid instance» seems to indicate you are trying use the default instance but you should specify a specific instance. For example not «Server=myMachine» but «Server=myMachineSQL2008». If you use SSMS to browse for servers, it will show all servers
    and their instance names.


    -Tom. Microsoft Access MVP

    • Marked as answer by
      Y a h y a
      Tuesday, February 7, 2012 7:10 PM
  • Remove From My Forums
  • Question

  • Hi

    When I run a query like below against one remote SQL Server then it works fine and returns the required data;

    SELECT * FROM [ODBC;Driver=SQL Server;SERVER=Server1.com;DATABASE=MyDatabase;UID=MyUser;PWD=MyPass].MyTable

    However when I run the same query against a second remote SQL Server it gives me below error;

    Connection failed:
    SQLState: ‘01000’
    SQL Server Error: 14
    [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Invalid Instance()).
    Connection failed:
    SQLState: ‘08001’
    SQL Server Error: 14
    [Microsoft][ODBC SQL Server Driver][DBNETLIB]Invalid connection.

    I can otherwise access the second SQL Server fine. So it would seem there is something minor missing in the second server configuration that blocks running the query in this way. What is it I need to do on the problematic SQL Server to have me run the query
    fine?

    Many Thanks

    Regards

    • Edited by

      Tuesday, February 7, 2012 4:34 AM

Answers

  • «Invalid instance» seems to indicate you are trying use the default instance but you should specify a specific instance. For example not «Server=myMachine» but «Server=myMachineSQL2008». If you use SSMS to browse for servers, it will show all servers
    and their instance names.


    -Tom. Microsoft Access MVP

    • Marked as answer by
      Y a h y a
      Tuesday, February 7, 2012 7:10 PM

I’m trying to connect my access front-end to the SQL Server backend.

It was working when SQL Server was on my computer but now i’m trying to connect to a server

So when I create the DSN file with access

  1. I chose SQL-Server driver ( I have also tried with SQL-Server native 10.0 )
  2. I enter the server name that I copied from SQL Management Studio so there’s no typo there
  3. I chose the NT authentication

Then I have this error

enter image description here

In the properties, I tried with TCP/IP with the default port 1433 and I also tried with the name pipes

I made sure that the checkbox to allow remote connection is checked

If I try to connect with management studio I got this error

enter image description here

I can see the server when I browse on the network

I’m trying this troubleshotting but i’m stuck with the telnet command. It says Could not open connection to host on 1433

I also tried with no port and i got the same error on port 23

Any ideas?

Thank you

asked Nov 21, 2012 at 20:24

Marc's user avatar

MarcMarc

16.1k20 gold badges73 silver badges118 bronze badges

5

To create a new Data source to SQL Server, do the following steps:

  1. In host computer/server go to Sql server management studio —> open Security Section on left hand —> right click on Login, select New Login and then create a new account for your database which you want to connect to.

  2. Check the TCP/IP Protocol is Enable. go to All programs —> Microsoft SQL server 2008 —> Configuration Tools —> open Sql server configuration manager. On the left hand select client protocols (based on your operating system 32/64 bit). On the right hand, check TCP/IP Protocol be Enabled.

  3. In Remote computer/server, open Data source administrator. Control panel —> Administrative tools —> Data sources (ODBC).

  4. In User DSN or System DSN , click Add button and select Sql Server driver and then press Finish.

  5. Enter Name.

  6. Enter Server, note that: if you want to enter host computer address, you should enter that`s IP address without «\». eg. 192.168.1.5 and press Next.

  7. Select With SQL Server authentication using a login ID and password entered by the user.

  8. At the bellow enter your login ID and password which you created on first step. and then click Next.

  9. If shown Database is your database, click Next and then Finish.

answered May 25, 2016 at 7:45

Vahid's user avatar

VahidVahid

912 silver badges3 bronze badges

  1. Windows firewall blocks the sql server. Even if you open the 1433 port from exceptions, in the client machine it sets the connection point to dynamic port. Add also the sql server to the exceptions.

«C:Program FilesMicrosoft SQL ServerMSSQL11.MSSQLSERVERMSSQLBinnSqlservr.exe»

More info

  1. This page helped me to solve the problem. Especially

or if you feel brave, locate the alias in the registry and delete it
there.

HKEY_LOCAL_MACHINESOFTWAREMicrosoftMSSQLServerClientConnectTo

answered Jul 8, 2017 at 8:05

Hysen's user avatar

HysenHysen

113 bronze badges

I had the same error which was coming and dont need to worry about this error, just restart the server and restart the SQL services. This issue comes when there is low disk space issue and system will go into hung state and then the sql services will stop automatically.

answered Jun 26, 2014 at 6:56

krish's user avatar

Received SQLSTATE 01000 in the following error message below:

SQL Agent — Jobs Failed: The SQL Agent Job «LiteSpeed Backup Full» has failed with the message «The job failed. The Job was invoked by User X. The last step to run was step 1 (Step1). NOTE: Failed to notify via email. — Executed as user: X. LiteSpeed(R) for SQL Server Version 6.5.0.1460 Copyright 2011 Quest Software, Inc. [SQLSTATE 01000] (Message 1) LiteSpeed for SQL Server could not open backup file: (N:BACKUP2filename.BAK). The previous system message is the reason for the failure. [SQLSTATE 42000] (Error 60405). The step failed.»

In my case this was related to permission on drive N following an SQL Server failover on an Active/Passive SQL cluster.

All SQL resources where failed over to the seconary resouce and back to the preferred node following maintenance. When the Quest LiteSpeed job then executed on the preferred node it was clear the previous permissions for SQL server user X had been lost on drive N and SQLSTATE 10100 was reported.

Simply added the permissions again to the backup destination drive and the issue was resolved.

Hope that helps someone.

Windows 2008 Enterprise

SQL Server 2008 Active/Passive cluster.

answered May 26, 2015 at 7:41

scott_lotus's user avatar

scott_lotusscott_lotus

3,15322 gold badges51 silver badges69 bronze badges

Понравилась статья? Поделить с друзьями:
  • Ошибка odbc excel
  • Ошибка obs кодировщик перегружен
  • Ошибка odbc 126
  • Ошибка object xmlhttprequest
  • Ошибка obi элинж с3т