Sqlstate 01000 ошибка sql

RRS feed

  • 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 Files\Microsoft SQL Server\MSSQL.n\MSSQL\LOG\ERRORLOG 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’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.2k20 gold badges76 silver badges119 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

1012 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 Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Binn\Sqlservr.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_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo\

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:\BACKUP2\filename.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,18122 gold badges51 silver badges69 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.

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 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

Понравилась статья? Поделить с друзьями:
  • Sql сервер ошибка 4064
  • Sqlserverwriter неисправен неповторяемая ошибка
  • Sql сервер ошибка 3417
  • Sqlite ошибка проверки внешних ключей после изменения таблицы
  • Sqlite ошибка no such table