Ошибка odbc sqlstate 23000 номер ошибки 544

   TeMochkiN

21.01.20 — 14:56

Здравствуйте!

Платформа 8.3.15.1830 (x64)

Хочу с помощью менеджера записи изменить значение одного поля, но выдается следующая ошибка:

{ОбщийМодуль.ОбработчикиСобытий.Модуль(666)}: Ошибка при вызове метода контекста (Записать)

            ЗаписьТаблицыВнешнейБД.Записать();

по причине:

Ошибка внешней базы данных:

ошибка при выполнении запроса

по причине:

Ошибка ODBC. SQLSTATE: 23000

Номер ошибки: 544

Описание: [Microsoft][SQL Server Native Client 11.0][SQL Server]Невозможно вставить явное значение для столбца идентификаторов в таблице «build_main», когда параметр IDENTITY_INSERT имеет значение OFF.

Собственно, вот кусок кода, где возникает ошибка:

            ЗаписьТаблицыВнешнейБД = ВнешниеИсточникиДанных.УчетВесовогоМатериала.Таблицы.ОсновнаяТаблицаУчета.СоздатьМенеджерЗаписи();

            ЗаписьТаблицыВнешнейБД.НомерСтроки = СтрокаТЗ.НомерСтроки;

            ЗаписьТаблицыВнешнейБД.Прочитать();

            
            ЗаписьТаблицыВнешнейБД.ЗагруженоВ1С = 1;

            ЗаписьТаблицыВнешнейБД.Записать();

Основные свойства таблицы:

Тип данных таблицы внешнего источника данных — НеобъектныеДанные

Поле ключа — НомерСтроки

Только чтение — Ложь

У всех столбцов, кроме «ЗагруженоВ1С», свойство Только чтение установлено в значение Истина

Из-за чего может возникать ошибка?

Я так понимаю, что сама ошибка говорит о том, что я якобы пытаюсь вставить новую строку с установленным значением ключевого поля. Почитал описание процедуры Записать(), там действительно написано, что изменение записи происходит путем удаления текущей записи и вставки новой измененной. Так а почему оно не работает тогда? Поле ключа ведь обозначено как только для чтения, зачем 1С его заполняет, по логике, должна добавиться новая запись, с новым ID, но этого не происходит. Но этого и не хотелось бы, хочется, чтобы обычный UPDATE по ключу сработал. Никто не знает как с этим разобраться?

   TeMochkiN

3 — 21.01.20 — 15:21

(1) (2) я знаю, поэтому и выставил на все поля, в том числе ключевое, свойство только чтение в значение Истина, у меня для изменения разрешено только поле ЗагруженоВ1С

   ДенисЧ

6 — 21.01.20 — 15:24

(5) Ну и что? IDENTITY, тупо по определению, заполняет сам сервер. И серверу наплевать, что ты там и где заполнил.

   TeMochkiN

12 — 21.01.20 — 15:50

(11) вот я как раз для всех полей таблицы, кроме «ЗагруженоВ1С» и  установил ТолькоЧтение = Истина, поэтому при изменении должно обновляться только поле «ЗагруженоВ1С»

УстановитьЗаписываемыеПоля() и ПолучитьЗаписываемыеПоля() работает для таблиц с объектными данными

но я не пробовал через набор записей выполнить изменение. хотя, почитав описание, ожидаю тот же самый результат

ВнешнийИсточникДанныхТаблицаНаборЗаписей.<Имя внешнего источника>.<Имя таблицы внешнего источника данных> (ExternalDataSourceTableRecordSet.<External source name>.<External data source table name>)

Записать (Write)

Доступен, начиная с версии 8.3.5.

Синтаксис:

Записать(<Замещать>)

Параметры:

<Замещать> (необязательный)

Тип: Булево.

Определяет режим замещения существующей записи в соответствии с текущими установками отбора. Истина — перед записью существующие записи будут удалены. Ложь — записи будут дописаны к уже существующим в информационной базе записям.

Значение по умолчанию: Истина.

Описание:

Выполняет запись набора записей в базу данных внешнего источника данных. В зависимости от переданного параметра может быть выполнено добавление записей или замещение. Если указано замещение, то перед выполнением записи будет выполнено удаление всех существующих записей в соответствии с текущими установками отбора.

Доступность:

Сервер, толстый клиент, внешнее соединение.

Использование в версии:

Доступен, начиная с версии 8.3.5.

  

TeMochkiN

21.01.20 — 14:56

Здравствуйте!

Платформа 8.3.15.1830 (x64)

Хочу с помощью менеджера записи изменить значение одного поля, но выдается следующая ошибка:

{ОбщийМодуль.ОбработчикиСобытий.Модуль(666)}: Ошибка при вызове метода контекста (Записать)

            ЗаписьТаблицыВнешнейБД.Записать();

по причине:

Ошибка внешней базы данных:

ошибка при выполнении запроса

по причине:

Ошибка ODBC. SQLSTATE: 23000

Номер ошибки: 544

Описание: [Microsoft][SQL Server Native Client 11.0][SQL Server]Невозможно вставить явное значение для столбца идентификаторов в таблице «build_main», когда параметр IDENTITY_INSERT имеет значение OFF.

Собственно, вот кусок кода, где возникает ошибка:

            ЗаписьТаблицыВнешнейБД = ВнешниеИсточникиДанных.УчетВесовогоМатериала.Таблицы.ОсновнаяТаблицаУчета.СоздатьМенеджерЗаписи();

            ЗаписьТаблицыВнешнейБД.НомерСтроки = СтрокаТЗ.НомерСтроки;

            ЗаписьТаблицыВнешнейБД.Прочитать();

            

            ЗаписьТаблицыВнешнейБД.ЗагруженоВ1С = 1;

            ЗаписьТаблицыВнешнейБД.Записать();

Основные свойства таблицы:

Тип данных таблицы внешнего источника данных — НеобъектныеДанные

Поле ключа — НомерСтроки

Только чтение — Ложь

У всех столбцов, кроме «ЗагруженоВ1С», свойство Только чтение установлено в значение Истина

Из-за чего может возникать ошибка?

Я так понимаю, что сама ошибка говорит о том, что я якобы пытаюсь вставить новую строку с установленным значением ключевого поля. Почитал описание процедуры Записать(), там действительно написано, что изменение записи происходит путем удаления текущей записи и вставки новой измененной. Так а почему оно не работает тогда? Поле ключа ведь обозначено как только для чтения, зачем 1С его заполняет, по логике, должна добавиться новая запись, с новым ID, но этого не происходит. Но этого и не хотелось бы, хочется, чтобы обычный UPDATE по ключу сработал. Никто не знает как с этим разобраться?

  

TeMochkiN

3 — 21.01.20 — 15:21

(1) (2) я знаю, поэтому и выставил на все поля, в том числе ключевое, свойство только чтение в значение Истина, у меня для изменения разрешено только поле ЗагруженоВ1С

  

ДенисЧ

6 — 21.01.20 — 15:24

(5) Ну и что? IDENTITY, тупо по определению, заполняет сам сервер. И серверу наплевать, что ты там и где заполнил.

  

TeMochkiN

12 — 21.01.20 — 15:50

(11) вот я как раз для всех полей таблицы, кроме «ЗагруженоВ1С» и  установил ТолькоЧтение = Истина, поэтому при изменении должно обновляться только поле «ЗагруженоВ1С»

УстановитьЗаписываемыеПоля() и ПолучитьЗаписываемыеПоля() работает для таблиц с объектными данными

но я не пробовал через набор записей выполнить изменение. хотя, почитав описание, ожидаю тот же самый результат

ВнешнийИсточникДанныхТаблицаНаборЗаписей.<Имя внешнего источника>.<Имя таблицы внешнего источника данных> (ExternalDataSourceTableRecordSet.<External source name>.<External data source table name>)

Записать (Write)

Доступен, начиная с версии 8.3.5.

Синтаксис:

Записать(<Замещать>)

Параметры:

<Замещать> (необязательный)

Тип: Булево.

Определяет режим замещения существующей записи в соответствии с текущими установками отбора. Истина — перед записью существующие записи будут удалены. Ложь — записи будут дописаны к уже существующим в информационной базе записям.

Значение по умолчанию: Истина.

Описание:

Выполняет запись набора записей в базу данных внешнего источника данных. В зависимости от переданного параметра может быть выполнено добавление записей или замещение. Если указано замещение, то перед выполнением записи будет выполнено удаление всех существующих записей в соответствии с текущими установками отбора.

Доступность:

Сервер, толстый клиент, внешнее соединение.

Использование в версии:

Доступен, начиная с версии 8.3.5.

https://bugboard.v8.1c.ru/error/000124959
Платформы: 8.3.15, 8.3.17, 8.3.20.

Дано: внешняя БД (MSSQL) с таблицей, одна из колонок которой имеет имя «allowed».

Если при подключении этой внешней БД как внешний источник данных (ВИД) в метаданных конфигурации тоже задать этому полю такое имя, то при попытке открыть в предприятии (в любом клиенте) эту таблицу (динамический список) получим ошибку 1:

Ошибка при выполнении запроса.
по причине:
Ошибка инициализации
по причине:
Ошибка создания набора данных "НаборДанныхДинамическогоСписка" 
по причине:
Ошибка при исполнении запроса набора данных
по причине:
{(3, 60)}: Ожидается имя
ВнешнийИсточникДанныхDWHТаблицаdbo_Test_Table.allowed КАК <<?>>allowed_

При попытке добавить запись (интерактивно или программно) в объектную таблицу ВИДа при записи будет ошибка 2:

Ошибка при вызове метода контекста (Записать): Ошибка внешней базы данных:
ошибка при выполнении запроса
по причине:
Ошибка ODBC. SQLSTATE: 23000
Номер ошибки: 544
Ошибка внешней базы данных:
ошибка при выполнении запроса
по причине:
Ошибка ODBC. SQLSTATE: 23000
Номер ошибки: 544
Описание: [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert explicit value for identity column in table 'Test_Column_Allowed' when IDENTITY_INSERT is set to OFF.

Если в метаданных конфигурации переименовать имя поля на какое-то другое, не являющееся одним из служебных слов языка запросов, то ошибки 1 в предприятии уже не будет (форма с таблицей-списком будет открываться):

Однако ошибка 2 по-прежнему будет наблюдаться, т.е. у нас отсутствует возможность добавлять / изменять (как программно, так и интерактивно) записи таблиц, колонки которых во внешней БД имеют имена, соответствующие служебным словам языка запросов.

Если поле во внешней БД имеет имя «top» или «distinct», то обе ошибки (1 и 2) в клиенте 1С будут с другим текстом:

Ошибка внешней базы данных:
ошибка при выполнении запроса
по причине:
Ошибка ODBC. SQLSTATE: 42000
Номер ошибки: 156
Описание: [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'top'.

Причем обойти ошибку 1 (через переименование имени поля в метаданных конфигурации) уже не получится.

ODBC Error Messages

SQLERROR returns SQLSTATE values as defined by the X/Open and SQL Access Group SQL CAE specification (1992). SQLSTATE values are strings that contain five characters. The following table lists SQLSTATE values that a driver can return for SQLError.

The character string value returned for SQLSTATE consists of a two-character class value followed by a three-character subclass value. A class value of 01 indicates a warning and is accompanied by a return code of SQL_SUCCESS_WITH_INFO. Class values other than 01, except for the class IM, indicate an error and are accompanied by a return code of SQL_ERROR. The class IM is specific to warnings and errors that derive from the implementation of ODBC. The subclass value 000 in any class is for implementation defined conditions within the given class. The assignment of class and subclass values is defined by SQL-92.

Note  Although successful execution of a function is indicated typically by a return value of SQL_SUCCESS, the SQLSTATE 00000 also indicates success.

SQLSTATE ODBC API (Driver Manager) error
00000 Success
01000 General warning
01002 Disconnect error
01004 Data truncated
01006 Privilege not revoked
01S00 Invalid connection string attribute
01S01 Error in row
01S02 Option value changed
01S03 No rows updated or deleted
01S04 More than one row updated or deleted
01S05 Cancel treated as FreeStmt/Close
01S06 Attempt to fetch before the result returned the first rowset
07001 Wrong number of parameters
07006 Restricted data type attribute violation
07S01 Invalid use of default paramater
08001 Unable to connect to data source
08002 Connection in use
08003 Connection not open
08004 Data source rejected establishment of connection
08007 Connection failure during transaction
08S01 Communication link failure
21S01 Insert value list does not match column list
21S02 Degree of derived table does not match column list
22001 String data right truncation
22002 Indicator variable required but not supplied
22003 Numeric value out of range
22005 Error in assignment
22008 Datetime field overflow
22012 Division by zero
22026 String data, length mismatch
23000 Integrity constraint violation
24000* Invalid cursor state
25000 Invalid transaction state
28000 Invalid authorization specification
34000 Invalid cursor name
37000 Syntax error or access violation
3C000 Duplicate cursor name
40001 Serialization failure
42000 Syntax error or access violation
70100 Operation aborted
IM001 Driver does not support this function
IM002 Data source name not found and no default driver specified
IM003 Specified driver could not be loaded
IM004 Driver’s SQLAllocEnv failed
IM005 Driver’s SQLAllocConnect failed
IM006 Driver’s SQLSetConnectOption failed
IM007 No data source or driver specified; dialog prohibited
IM008 Dialog failed
IM009 Unable to load translation DLL
IM010 Data source name too long
IM011 Driver name too long
IM012 DRIVER keyword syntax error
IM013 Trace file error
S0001 Base table or view already exists
S0002 Base table not found
S0011 Index already exists
S0012 Index not found
S0021 Column already exists
S0022 Column not found
S0023 No default for column
S1000 General error
S1001 Memory allocation failure
S1002 Invalid column number
S1003 Program type out of range
S1004 SQL data type out of range
S1008 Operation canceled
S1009 Invalid argument value
S1010 Function sequence error
S1011 Operation invalid at this time
S1012 Invalid transaction operation code specified
S1015 No cursor name available
S1090 Invalid string or buffer length
S1091 Descriptor type out of range
S1092 Option type out of range
S1093 Invalid parameter number
S1094 Invalid scale value
S1095 Function type out of range
S1096 Information type out of range
S1097 Column type out of range
S1098 Scope type out of range
S1099 Nullable type out of range
S1100 Uniqueness option type out of range
S1101 Accuracy option type out of range
S1103 Direction option out of range
S1104 Invalid precision value
S1105 Invalid parameter type
S1106 Fetch type out of range
S1107 Row value out of range
S1108 Concurrency option out of range
S1109 Invalid cursor position
S1110 Invalid driver completion
S1111 Invalid bookmark value
S1C00 Driver not capable
S1DE0 No data at execution values pending
S1T00 Timeout expired

* In SQL Server Enterprise Manager, you may receive the «Invalid cursor state» error message when Microsoft® SQL Server™ runs out of resources while attempting to save selected tables or a database diagram. This error is returned because of insufficient space in your database or transaction log to complete the save process. To correct this problem, check to see if the database or the transaction log is full. If so, increase the size of the database to accommodate the change. Check other system resources or contact your system administrator.

In addition to the standard ODBC error messages located in your ODBC programmer’s reference documentation, the SQL Server ODBC driver can return error messages for certain SQLSTATE values, as shown in this table.

SQLSTATE SQL SERVER DRIVER ERROR Description
01000 %ld rows sent to SQL Server. Total sent: %ld. A batch size of rows have been sent to SQL Server using the BCP API.
01000 %ld rows successfully bulk-copied to host-file. Total received: %ld. A batch size of rows have been written to the host file using the BCP API.
01000 Access to database configured in the DSN has been denied. Default used. Either the database does not exist or the user does not have permission to access the database. The default database configured for the login ID was used.
01000 An error has occurred during an attempt to access the log file, logging disabled. The log file for driver statistics or long-running queries could not be used. The logging of driver statistics or long-running queries has been disabled.
01000 Connected to backup server. The SQL Server primary server was not available, so the connection was made to the fallback server.
01000 Language configured in the DSN is not supported. Default used. Either the language name is invalid or the language is not installed on the server. The default language configured for the login ID was used.
01000 Null bit data forced to zero. A bit field containing a NULL is being loaded to a server that does not support NULL bit data. The field was set to zero.
01000 Procedure executed with ‘EXEC’. No output parameters returned. The procedure could not be executed as an RPC and output parameters were specified. Because the procedure had to be executed with EXEC, no output parameters will be stored.
01000 SQL Debugging disabled. SQL Debugging could not be enabled, probably because the SQL Server is not configured for SQL debugging.
01000 The ODBC catalog stored procedures installed on server %s are version %s; version %02d.%02d.%4.4d or later is required to ensure proper operation. Please contact your system administrator. Install the ODBC catalog stored procedures by executing MsqqlInstallInstcat.sql.
01000 Zero length data forced to length 1. A zero-length binary or character field is being loaded, but zero-length data is not supported. The field was forced to a 1 byte blank or binary zero.
01S02 Cursor concurrency changed. The application requested a concurrency that could not be honored because of the type of request or query. A different concurrency was used instead.
01S02 Cursor type changed. The application requested a cursor type that could not be honored because of the type of request or query. A different cursor type was used instead.
01S02 Packet size change not honored by server, server size used. The application requested a nondefault packet size that could not be supported by SQL Server. The server default size was used instead.
01S02 Packet size changed. The application requested a nondefault packet size that was outside of the limits of allowable size. Either the smallest or largest packet size was used instead, depending if the requested size was too small or too large.
01S02 Login timeout changed. The application requested a login time-out that was too large. The maximum login time out was used instead.
07006 Conversions not allowed using bcp_moretext. The application using bcp_moretext must have the same field type as it does the column type.
08004 Server rejected the connection; Access to selected database has been denied. Either the database does not exist or the user does not have permission to access the database.
08004 Server rejected the connection; Language specified is not supported. Either the language name is invalid or the language is not installed on SQL Server.
HY024 Database is invalid or cannot be accessed. Either the database does not exist or the user does not have permission to access the database.
IM006 Packet size change not supported by server, default used. The application requested a nondefault packet size that SQL Server does not support. The client default size was used.
HY000 All bound columns are read-only. There must be an updatable column to use SQLSetPos or SQLBulkOperations to change or insert a row.
HY000 An old netlib (%s) has been detected. Please delete it and restart the application. The netlib that was being loaded was out of date. The driver requires a newer netlib.

The problem could be a netlib in the current directory of the application, which is being loaded instead of the one in the system directory, or it could be that the netlib was not installed properly or is corrupted. If the netlib specified in the error text exists elsewhere than in the Windows system directory, delete it. If the netlib exists only in the system directory, install the client utilities on the client and restart the application.

HY000 Attempt to bulk-copy a NULL value into a Server column which does not accept NULL values. The field contains a NULL value, but the column does not allow NULL values.
HY000 Attempt to bulk-copy an oversized column to the SQL Server. The length supplied for a column is larger than the column definition in the table.
HY000 Attempt to read unknown version of BCP format file. The header line in the bcp format file was not a recognized version.
HY000 Bad bulk-copy direction. Must be either IN or OUT. The bcp_init call did not specify a valid direction for the eDirection parameter.
HY000 Bad terminator. The terminator string supplied in bcp_bind is invalid.
HY000 Bcp host-files must contain at least one column. No columns were selected to be loaded.
HY000 Cannot generate SSPI context. The driver could not obtain an SSPI context required for integrated security. The native error will contain the Win32 error code.
HY000 Cannot initialize SSPI package. The driver could not obtain an SSPI context required for integrated security. The native error will contain the Win32 error code.
HY000 Communication module is not valid. Driver has not been correctly installed. The network library .dll is corrupted. Install the client utilities on the client and restart the application.
HY000 Connection is busy with results for another hstmt. The SQL Server ODBC driver allows only one active hstmt. For more information, see Using Default Result Sets.
HY000 Connection is not enabled for BCP. The application using the BCP API must set the SQLSetConnectAttr or SQL_SS_COPT_BCP attribute before connecting.
HY000 Failure during closing of connection. The ConnectionClose function in the network library failed. This problem is typically caused by a network or SQL Server problem.
HY000 For BCP, all variable-length data must have either a length-prefix or a terminator specified. bcp_bind was called with SQL_VARYLEN_DATA, but neither a prefix length nor a terminator was specified.
HY000 Host-file columns may be skipped only when copying into the server. A bcp out format file specified that a column should be skipped. This is not allowed. Either create a view containing only the desired columns and bcp out from that view, or use the -Q flag to provide a SELECT statement selecting only the desired columns.
HY000 Incorrect host-column number found in BCP format-file. The format file contains a column number greater than the number of columns in the table.
HY000 I/O error while reading bcp data-file.  
HY000 I/O error while reading BCP format file.  
HY000 I/O error while writing bcp data-file.  
HY000 I/O error while writing bcp error-file.  
HY000 Invalid option. The eOption parameter to bcp_control was not valid.
HY000 Non-default parameter not allowed after default parameter. Parameters to a stored procedure cannot have a non-default value after any preceding parameter has been specified with the default value.
HY000 Not enough columns bound. For a bcp out, not all columns of the table were bound. Either create a view which contains only the desired columns and bcp out from that view or, use the -Q flag to provide a SELECT statement selecting only the desired columns.
HY000 ODBC BCP/Driver version mismatch. The Sqlsrv32.dll and Odbcbcp.dll .dlls do not have identical versions. Install the client utilities on the client and restart the application.
HY000 Protocol error in TDS stream. The TDS stream from the server is invalid. This problem is typically caused by a SQL Server problem. Check the SQL Server error log.
HY000 Table contains less rows than first row count. A starting row number was supplied, but the table on the server did not contain that number of rows. No rows were copied to the host-file.
HY000 Table contains less rows than last row count. An ending row number was supplied, but the table on the server did not contain that number of rows.
HY000 Table has no text/image columns. bcp_moretext was called, but the table does not contain any text or image columns.
HY000 TDS buffer length too large. The TDS stream from the server is invalid. This problem is typically caused by a SQL Server problem. Check the SQL Server error log.
HY000 Text column data incomplete. The summation of the lengths supplied by bcp_moretext did not match the length supplied in bcp_bind or bcp_collen.
HY000 The BCP host-file contains less rows than first row count. A starting row number was supplied, but the host-file did not contain that number of rows. No rows were loaded.
HY000 The row length exceeds SQL Server’s maximum allowable size. The summation of the data lengths for a row is larger than the maximum row size.
HY000 The stored procedure required to complete this operation could not be found on the server (they were supplied with SQL Server). Please contact your system administrator. Install the ODBC catalog stored procedures by executing MsqqlInstallInstcat.sql.
HY000 Unable to load communication module. Driver has not been correctly installed. The network library .dll specified for the connection does not exist on this client. Install the client utilities on the client and restart the application.
HY000 Unable to open BCP host data-file. The file name specified in the bcp_init call does not exist or is opened by another application.
HY000 Unable to open BCP error-file. The error file name specified in the bcp_init call does not exist or is opened by another application.
HY000 Unable to read driver version. The driver was unable to read the version block in its .DLL. Install the client utilities on the client and restart the application.
HY000 Unexpected EOF encountered in BCP data-file. During a bcp in operation, end-of-file was detected on the data file while in the middle of processing the last row. This is typically caused by having a different number of columns, types, nullability, or sizes between the original table and the table being loaded.
HY000 Unicode conversion failed. An error occurred during conversion to or from a Unicode string. The native error will contain the Win32 error code.
HY000 Unicode conversion failed. The code page of the SQL server must be installed on the client system. The server code page must exist on the client for proper operation. Either clear the Auto Translate check box for the DSN or install the code page of the server on the client. The server code page can be determined by running EXEC sp_server_info 18.
HY000 Unknown token received from SQL Server. The TDS stream from the server is invalid. This error is typically caused by a problem on the server. Check the SQL Server error log.
HY000 Warning: Partial insert/update. The insert/update of a text or image column(s) did not succeed. A failure during insertion or update of a text, image, or ntext column occurred. That column will not contain the proper data. Roll back the transaction, if possible.

Возникла тут у клиентов вообщем-то простая задача — сконвертировать базу 1С 7.7 (Торговля и Склад) с DBF на SQL вариант. Провели тестирование и исправление базы, никаких ошибок вообщем-то не было выявлено. Выгрузили данные, но при попытке загрузки их в SQL базу получили сообщение об ошибке:

SQL State: 23000 

Native: 1505 

Message: [Microsoft][ODBC SQL Server Driver][SQL Server]CREATE UNIQUE INDEX terminated because a duplicate key was found for index ID 2. Most significant primary key is ‘ BF3 ‘. 

SQL State: 01000 

Native: 3621 

Message: [Microsoft][ODBC SQL Server Driver][SQL Server]The statement has ben terminated.

Быстрое гугление на тему привело к вот этой статье и пониманию того, что в данном случае мы знали в какой таблице был замечен неуникальный индекс, а в нашем случае — нет. Собственно дальнейшие изыскания привели к следующему. Если не закрывать и не сворачивать окно 1С во время загрузки в SQL базу, то при появлении MessageBox’а об ошибке можно увидеть какую информацию он пытался загрузить последней. В нашем случае это был справочник Цены, вернее создание индексов справочника цены. Смотрим в DBF варианте файл 1Cv7.dd и видим, что таблица справочника цен — это SC319.DBF. Открываем ее в DBF Viewer 2000 и видим что поле ID действительно неуникально, присутствуют две записи с ID = BF3. Далее мы воспользовались инструментом Tools -> Delete duplicates … оставив в качестве фильтра только ID, и удалили дублирующиеся данные:

SQL State: 23000 

Native: 1505 

Message: [Microsoft][ODBC SQL Server Driver][SQL Server]CREATE UNIQUE INDEX terminated because a duplicate key was found for index ID 2. Most significant primary key is ‘ BF3 ‘. 

SQL State: 01000 

Native: 3621 

Message: [Microsoft][ODBC SQL Server Driver][SQL Server]The statement has ben terminated.

Быстрое гугление на тему привело к вот этой статье и пониманию того, что в данном случае мы знали в какой таблице был замечен неуникальный индекс, а в нашем случае — нет. Собственно дальнейшие изыскания привели к следующему. Если не закрывать и не сворачивать окно 1С во время загрузки в SQL базу, то при появлении MessageBox’а об ошибке можно увидеть какую информацию он пытался загрузить последней. В нашем случае это был справочник Цены, вернее создание индексов справочника цены. Смотрим в DBF варианте файл 1Cv7.dd и видим, что таблица справочника цен — это SC319.DBF. Открываем ее в DBF Viewer 2000 и видим что поле ID действительно неуникально, присутствуют две записи с ID = BF3. Далее мы воспользовались инструментом Tools -> Delete duplicates … оставив в качестве фильтра только ID, и удалили дублирующиеся данные:

После чего сделали Edit -> Pack (для физического удаления помеченных на удаление записей), и на всякий случай удалили файл индексов SC319.CDX. После чего по новой выгрузили данные из DBF базы и попытались по новой загрузить их в базу MSSQL. Этап создания индексов таблицы Цены прошел успешно. Ошибка SQL State: 23000 была побеждена.

Ну и несколько ссылок с решением аналогичной проблемы напоследок:

  • v7: Ошибка SQL State: 23000 Native: 1505 — мое решение проблемы
  • Попытка вставки неуникального значения в уникальный индекс
  • v7: Ошибка SQL State: 23000 Native: 1505 — обновление решения проблемы
  • v7: Загрузка базы в SQL (ошибка: sql state 23000, native 1505 — create unique index)

В последней ссылке есть действенное решение по определению места (т.е. на каких именно данных останавливается загрузка) на котором все падает, процитирую:

1. запустив профайлер SQL загружаем базу. с логе профайлера будет инфа на какой ошибке все завалилось.
2. отредактировал битые dbf ки с помощью плугина wlx_xbaseview к тотал командеру (удалил дублирующие записи)
3. дублирующие записи нашел: выгрузил dbf в excel и сделал сводную таблицу по ключевым полям. где кол-во было > 1 — это дубли

Good morning all.  I need some help with a stored proc that is driving me up a wall.  It’s probably something stairing me right in the face but I can’t see it!

I keep getting the following error on the procedure that I’m working on:

SQL-DMO (ODBC SQLSTATE: 42000)

ERROR 156: Incorrect syntax near keyword ‘AS’

Must declare the variable ‘@signid’

Must declare the variable ‘@signid’

Here’s the code:

CREATE PROCEDURE [dbo].[ws_savesignature2db]
@xml as text=»,
@image as image=»,
@imageformat as varchar(20)=»,
@imagename as varchar(40)=»,
@imagesize as int=0,
AS

insert into signaturetable
 ([image], imageformat, imagename, imagesize)
values
 (@image, @imageformat,@imagename,@imagesize)

/*
if your XML field datatype is Text or nTEXT, use the code below in Sql Server 2000.
If you use Sql Server 2005, you can use varchar(max) or nvarchar(max) which will be
much easier and you do not need the code.
*/

select   @signid =  @@IDENTITY

DECLARE @ptrval binary(16)
SELECT @ptrval = TEXTPTR([xml])
FROM ws_signature
WHERE signid= @signid

if @ptrval is not null
 WRITETEXT ws_signature.xml @ptrval @xml
GO

Any help you can give would be a life saver!!!!

Thanks in advance.

1C_V7_logoОфициально, платформа 1С:Предприятие 7.7 работает только с MS SQL Server 2000. Но с помощью небольших манипуляций можно организовать стабильную работу и с последней, на момент написания статьи, версий Microsoft SQL Server 2008 R2. Ниже представлена пошаговая настройка связки 1С:Предприятие 7.7 + MS SQL Server 2008 R2 + Microsoft Windows Server 2008 R2 (Справедливо и для других операционных систем семейства Windows). Итак:

0. Оглавление

  1. Установка Windows Server 2008 R2
  2. Установка SQL Server 2008 R2 
  3. Создание новой базы данных в SQL Server 2008 R2
  4. Настройка Windows Server 2008 R2
  5. Установка 1С:Предприятие 7.7
  6. Патч и замена файла BkEnd.dll
  7. Создание представления sksprocesses в MS SQL Server
  8. Добавление информационной базы в 1С:Предприятие 7.7
  9. Настройка безопасности для всех пользователей

1. Установка Windows Server 2008 R2

В качестве серверной ОС используем Microsoft Windows Server 2008 R2. Об установке этой системы подробно можно прочитать в статье «Установка Windows Server 2008 R2».

2. Установка SQL Server 2008 R2

Далее устанавливаем Microsoft SQL Server 2008 R2. Во время установки выбираем:

  • Параметры сортировки  — «Cyrilic_General_CI_AS»
  • Режим проверки подлинности — «Смешанный режим»

Очень подробно об установке SQL Server я писал в статье «Установка Microsoft SQL Server 2008 R2».

3. Создание новой базы данных в  SQL Server 2008 R2

Добавляем нового пользователя в SQL Server 2008 R2. Обязательно даем ему роль processadmin, иначе будем натыкаться на ошибку:

«Доступ к базе возможен только из одного каталога информационной базы»  

Затем создаем новую базу данных, указав:

  • Имя базы данных не должно начинаться с цифры или иметь пробелы в названии, иначе получим ошибку:
    «неправильный синтаксис около конструкции %имя базы данных%»
  • В качестве владельца указываем только что созданного пользователя (В моем случае имя пользователя — «UserSQL» )
  • Модель восстановления базы данных: «Простая» (1С:Предприятие 7.7 прекрасно работает и при полной модели восстановления. Но в этом случае, вы должны хорошо понимать все плюсы и минусы данного решения).
  • Уровень совместимости: «SQL Server 2000 (80)» .

О том как это сделать читайте в статье «Добавление пользователя и создание новой базы данных в Microsoft SQL Server 2008 R2».

4. Настройка Windows Server 2008 R2

Теперь необходимо заменить оригинальные фалы odbcbcp.dll, sqlsrv32.dll и sqlsrv32.rll (скачать все файлы одним архивом) в каталогах C:WindowsSystem32 и в C:WindowsSysWOW64 файлами из каталога C:WindowsSystem32 под управлением Windows Server 2003 (в архиве).
Чтобы сделать это необходимо стать владельцем этих файлов и получить права на их редактирование . Для этого заходим в C:WindowsSystem32 находим файл odbcbcp.dll, кликаем по нему правой кнопкой, выбираем «Свойства». В открывшемся окне переходим на вкладку «Безопасность», нажимаем «Дополнительно».

Ustanovka_1C_SQL_001

В появившемся окне переходим на вкладку «Владелец» , нажимаем «Изменить» , выбираем текущего пользователя и жмем 2 раза «ОК» .

Ustanovka_1C_SQL_002

Затем на вкладе «Безопасность» нажимаем «Изменить» и для текущего пользователя выставляем уровень безопасности «Полный доступ» . Закрываем окна кнопкой «ОК» .
Только после этого система даст нам заменить файл odbcbcp.dll.
Аналогичные действия необходимо выполнить и для всех остальных файлов в папках C:WindowsSystem32 и C:WindowsSysWOW64.
Если этого не сделать, при запуске 1С:Предприятие будем натыкаться на ошибку:
«Ошибка для доступа к базе данных требуется ODBC-драйвер для MS SQL Server версии 3.50.0303 или старше»

5. Установка 1С:Предприятие 7.7

Теперь необходимо установить 1С:Предприятие 7.7, ставим версию для SQL. Об особенностях установки читайте в статье «Установка системы 1С:Предприятие 7.7 в Windows x64».

6. Патч и замена файла BkEnd.dll

Теперь необходимо заменить файл BkEnd.dll из оригинальной поставки 1С:Предприятие 7.7, находящего по пути C:Program Files (x86)1Cv77BIN, «пропатченным» файлом BkEnd.dll. Вы можете использовать мой файл, или сделать изменения самостоятельно. О том как и что необходимо в нем изменить читайте в моей статье «Работа в Hex-редакторе Free Hex Editor Neo, на примере патча файла BkEnd.dll для работы 1С:Предприятие 7.7 с Microsoft SQL Server 2008 R2».
Замену файла делаем для того, чтобы избавиться от ошибок:

  • «Требуется MS SQL Server 6.5 + Service Pack 5a или более старшая версия!»
  • «Порядок сортировки, установленный для базы, отличается от системного!»
  • «Неправильный синтаксис около ключевого слова «TRANSACTION»
  • «База данных не может быть открыта в однопользовательском режиме»

7. Создание представления sksprocesses в MS SQL Server

Продолжаем исправлять ошибку «База данных не может быть открыта в однопользовательском режиме». Для этого создадим представление в базе данных (источник).
Заходим в программу «Среда Microsoft SQL Server Management Studio» («Пуск» — «Все программы» — «Microsoft SQL Server 2008 R2» — «Среда Microsoft SQL Server Management Studio» ), выбираем наш SQL Server (в моем примере это «S4ULTRA»), раскрываем вкладку «Базы данных» , затем «Системные базы данных» и вкладку «master» . На вкладке «Представления» кликаем правой кнопкой мыши и в меню выбираем «Создать представление» .

Ustanovka_1C_SQL_004

Откроется окно «Добавление таблицы» , закроем его нажав «Закрыть» .

Ustanovka_1C_SQL_005

Теперь в окне слева напишем текст представления:

select * from sysprocesses where cmd <> 'checkpoint'

Затем, нажимаем «Выполнить код SQL» (Иконка с красным восклицательным знаком на панели)

Ustanovka_1C_SQL_006

После того, как код изменится, сохраним представление, назвав  его sksprocesses.

Ustanovka_1C_SQL_007

В результате чего в обозревателе объектов увидим только что созданное представление dbo.sksprocesses. Кликаем по нему правой кнопкой мыши и выбираем «Свойства» .

Ustanovka_1C_SQL_008

Откроется окно «Свойства представления» , в нем переходим на вкладку «Разрешения» и добавим пользователя guest. Для этого нажимаем «Найти» в окне добавления пользователей «Обзор» , отмечаем в списке пользователя guest и жмем «ОК» .

Ustanovka_1C_SQL_009

Теперь отмечаем разрешения для guest:

  • Вставка
  • Выборка
  • Изменение
  • Назначение владельцем
  • Обновление
  • Просмотр определения

После чего нажимаем «ОК» .

Ustanovka_1C_SQL_010

На этом создание представления завершено.

8. Добавление информационной базы в 1С:Предприятие 7.7

Теперь, запустим 1С:Предприятие в режиме конфигуратора и добавим новую базу, для этого нажимаем «Добавить» задаем имя базы данных и указываем путь к каталогу в котором будет храниться наша база (изначально должен быть пустым) и нажимаем «ОК» .

Ustanovka_1C_SQL_011

Заходим в добавленную только что базу данных в режиме конфигуратора. При первом запуске система попросит выбрать формат хранения данных. Выбираем «MS SQL Server» и нажимаем «ОК» .

Ustanovka_1C_SQL_012

В запустившемся конфигураторе заходим в «Администрирование» — «Параметры базы данных SQL…» .

Ustanovka_1C_SQL_013

Откроется окно «Параметры базы данных SQL«, в нем заполняем:

  • Имя сервера в формате: <Сетевое имя компьютера><Имя экземпляра SQL Server>. (в моем случае это «S4ULTRA» )
  • База данных: Имя базы данных, которое было введено при создании новой базы данных в п. 2. (в моем случае это «BASE_1C» )
  • Пользователь: Имя пользователя, которое было введено при создании нового пользователя в п. 2. (у меня это «UserSQL» )
  • Пароль: Пароль, который указывали для пользователя при создании в п. 2.

И нажимаем «ОК» .

Ustanovka_1C_SQL_014

Если нам нужна новая, т. е. «чистая» база, то уже можно начинать работать. Если же необходимо перенести уже существующую базу данных, то необходимо предварительно выгрузить из нее данные (войти в 1С:Предприятие в режиме конфигуратора, «Администрирование» — «Выгрузить данные» ) а затем загрузить в нашу, только что созданную базу на SQL («Администрирование» — «Загрузить данные» — выбрать файл выгрузки — «ОК» и согласиться с предупреждением о конфликте данных) .

Ustanovka_1C_SQL_015

После этого этапа уже можно работать в 1С под текущим пользователем Windows.

9. Настройка безопасности для всех пользователей

Если подразумевается, что данный сервер является также Сервером терминалов, на котором будут работать несколько пользователей, то необходимо для директорий, где хранятся базы данных 1С (в моем случае это «C:1C_BASE») дать всем пользователям права на чтение/запись. Для этого в проводнике выделяем нужную папку, кликаем по ней правой кнопкой мыши и в меню выбираем «Свойства«. В открывшемся окне переходим на вкладку «Безопасность» и нажимаем кнопку «Изменить» . В окне «Разрешения для группы…» для группы «Все» установим «Полный доступ» . Закроем все окна кнопкой «ОК» .

Теперь можно создавать пользователей для работы с 1С:Предприятие в режиме терминального сервера или в режиме удаленных приложений RemoteApp.

Содержание

  1. Ошибка ODBC. SQLSTATE: 28000 Номер ошибки: 18456
  2. Ошибка ODBC. SQLSTATE: 28000 Номер ошибки: 18456
  3. Способы решения проблемы:
  4. Верная инициализация соединения:
  5. Настройки пользователя в управляемом приложении:
  6. Пример задания общих параметров:
  7. Login failed for [SQLSTATE 28000] (Error 18456) the step failed SQL Server
  8. Details of Error:
  9. Cause of Error:
  10. Resolution:
  11. ‘SQL error 1045 sqlstate 28000’ – Here are the steps to fix it
  12. ‘SQL error 1045 sqlstate 28000’ – What this means?
  13. ‘SQL error 1045 sqlstate 28000’ – Causes & Fixes
  14. 1) Typo in username and password
  15. Solution
  16. 2) Accessing from wrong host
  17. Solution
  18. 3) User doesn’t exist
  19. Solution
  20. 4) Existence of Anonymous users
  21. Solution
  22. 5) Insufficient privileges
  23. Solution
  24. Conclusion
  25. PREVENT YOUR SERVER FROM CRASHING!
  26. 1 Comment
  27. Sql error sqlstate 28000
  28. Question
  29. All replies
  30. Sql error sqlstate 28000
  31. Answered by:
  32. Question
  33. Answers
  34. All replies

Ошибка ODBC. SQLSTATE: 28000 Номер ошибки: 18456

При использовании внешнего источника данных в 1С 8.3 возникает сообщение с кодом 18456.

Чаще всего такое бывает при переходе на 8.3 — данный код говорит об ошибке авторизации в момент подключения.

Даже, если ранее этот код работал на 8.2, здесь он не работоспособен.

Способы решения проблемы:

  1. Проверка написания пользователя, пароля
  2. Явное указание при соединении имени и пароля, связано скорее всего с тем, что в платформе появилась возможность хранить настройки соединения для каждого пользователя

Верная инициализация соединения:

Настройки пользователя в управляемом приложении:

Все функции/ Стандартные/Управление внешними источниками данных

Далее можно задать общие настройки параметры соединения или индивидуальные для пользователя

Пример задания общих параметров:

Реклама — величайшее искусство XX века.

Источник

Login failed for [SQLSTATE 28000] (Error 18456) the step failed SQL Server

Table of Contents

Details of Error:

Executed as user: DomainLoginName. Login failed for user ‘DomainLoginName’. [SQLSTATE 28000] (Error 18456). The step failed.

or below ODBC Data Source SQL Server Connection – Login Failed For User

Connection failed:
SQLState: ‘28000’
SQL Server Error: 18456
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user ‘UserName’.

Cause of Error:

This error is encountered when SQL Agent Service does not have permissions required to run the job. Or When we try ODBC Data Source SQL Server Connection Login Failed message when Login used for connection does not have permission needed.

Resolution:

First if this message is caused by SQL Agent Job connection then we will need to check the source SQL server agent service account name from Services MMC or Server manager or SQL Server Cofiguration Manager in Services-> Go to the SQL Server Agent Service –> properties –> Check the logon tab where we can find the account name.

Now check and add the login we found above or if the its caused by ODBC Data Source SQL Server Connection then add the Login used in ODBC to the SQL server instance by checking in Security tab –>logins with necessary permission on your target machine where its trying to connect or run the job on. This can be same instance or different instance on same or some other server.

Источник

‘SQL error 1045 sqlstate 28000’ – Here are the steps to fix it

Server errors are annoying, especially when they are cryptic like “sql error 1045 sqlstate 28000″.

The message contains some error codes.

But, what’s the real problem here?

At Bobcares, we help website owners resolve complex errors like “sql error 1045 sqlstate 28000 as part of our Outsourced Hosting Support services.

Today, let’s discuss the top 5 reasons for this error and we fix them.

‘SQL error 1045 sqlstate 28000’ – What this means?

Before we move on to the reasons for this error, let’s first get an idea of this error.

Website owners face this error when querying data from the SQL server.

For instance, the complete error message looks like this:

This error shows that the MySQL server disallows the user to connect to it from localhost or 127.0.0.1.

‘SQL error 1045 sqlstate 28000’ – Causes & Fixes

In our experience managing servers, we’ll see the major causes of this error and how our Dedicated Support Engineers fix it.

1) Typo in username and password

This is the most common reason for the error “sql error 1045 sqlstate 28000″.

Users may type wrong username and password while connecting to the database.

Therefore, SQL server can’t identify the authenticity of the account.

Solution

In such cases, we help website owners reset the database user password.

For example, in cPanel servers, we reset the database user password from Databases > Mysql databases > Current Users.

Mysql databases option in cPanel

Also, for database driven websites like WordPress, Magento, etc., we update the new database username and password in the website configuration files.

For example, in the Magento application, we update the database name, username and password in the “app/etc/local.xml” file.

In some cases, website owners get errors like this:

This is because, the root session don’t know the password of mysql root user.

And, it can be probably a mis-typed password during the initial setup.

Here, our Hosting Engineers reset the admin/root password after starting the MySQL in safe mode.

For example, we use the below command to reset the root password in safe mode.

2) Accessing from wrong host

MySQL uses host based restrictions for user access to enhance security.

In other words, MySQL allows user access only from hosts defined in the MySQL user table.

So, any access from remote machines whose hostnames are not defined in this user table will bounce with the error “sql error 1045 sqlstate 28000

Solution

First, our Hosting Engineers check whether the remote host is allowed in the MySQL user table.

If not, we add the hostname of the remote machine in the MySQL user table.

For instance, we use the below command to add a host in the MySQL user table.

Here, hostname is the hostname of the remote machine, and username is the MySQL user.

We’ve seen cases where server owners use wildcards(%) in host field which gives universal access to this user.

But, this is not a good practice as there is a security risk that user can access the database from any hosts.

In addition to that, due to security concerns, we always disable accessing root user from remote machines.

[You don’t have to be a MySQL expert to keep your websites online. We have experienced MySQL admins available 24/7.]

3) User doesn’t exist

Similarly, this error “sql error 1045 sqlstate 28000” occurs when the user trying to access the database doesn’t exist on the MySQL server.

For example, if you access MySQL using a testuser that doesn’t exist, you can see the following error.

Solution

In such cases, our Support Engineers first check whether the user exists in the MySQL user table.

If not, we check the user’s requirement to access the database and if it is valid, we create a user with that username.

4) Existence of Anonymous users

Website owners face this error when there are anonymous MySQL users like ”@localhost or ”@127.0.0.1.

That is, when a client tries to connect to the database, the MySQL server looks through the rows in the user table in a sorted order.

The server uses the first row that matches the most specific username and hostname.

So, here the anonymous user (‘ ‘@localhost) precedes any other users like ‘user’@localhost when connecting from localhost.

And, use the anonymous user password to connect to the server.

Finally, the result is “sql error 1045 sqlstate 28000“.

Solution

Our Hosting Engineers check the MySQL user table and remove the anonymous user account.

For example, we use the below command to remove the anonymous user from MySQL.

5) Insufficient privileges

Likewise, insufficient privileges for the user to access the database can also result in this error.

Solution

In such cases, we assign proper access rights for the user to access the database.

For example, in cPanel servers, we manage user privileges from:

cPanel > Mysql databases > Current databases > Privileged users > Click on the database user.

Granting user privileges in cPanel

[Struggling with database user permissions and privileges? Our MySQL Experts are here for your help.]

Conclusion

In short, “sql error 1045 sqlstate 28000” may occur due to insufficient database privileges, wrong username or password, etc. Today we’ve discussed the top 5 reasons for this error and how our Dedicated Support Engineers fix it.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

Excellent Article very exciting and well presented.

Источник

Sql error sqlstate 28000

Question

The common causes for login failed are wrong password or a bad database name. Check the SQL Server error log, which will provide more information about the specific cause. Details of authentication errors are not returned to the client for security reasons.

Also, don’t use a sysadmin rule member account for routine application access. Instead, use one with only the permissions needed by your app.

Dan Guzman, Data Platform MVP, http://www.dbdelta.com

  • Proposed as answer by Will_Kong Microsoft contingent staff Monday, July 10, 2017 5:11 AM

Sql server error log «Login failed for user «sa» Reason: Password did not match that for the login provided»

According to the error log, you may change the password of the user «sa» in the SQL Server. Or you could do as Dan said, create a new account with some permissions for your applications. Or it is probably the problem of string password, so you may refer to https://docs.microsoft.com/en-us/sql/relational-databases/security/strong-passwords for assistance.

H ope these are helpful to you.

MSDN Community Support
Please remember to click «Mark as Answer» the responses that resolved your issue, and to click «Unmark as Answer» if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

  • Edited by Will_Kong Microsoft contingent staff Monday, July 10, 2017 5:12 AM

Sql server error log «Login failed for user «sa» Reason: Password did not match that for the login provided» i dont understant why it did not mach if i have another database on the same app working perfectly.

Maybe that database is on a different instance with a different password for sa?

In any case, you should absolutely not use sa in your application. That’s a complete no-no. You should use a login which has been granted the permissions needed, which at most is membership in db_datareader and db_datawriter. (But even better is that the application uses stored procedures, in which case permission to execute the stored procedures is all you need.)

Also, if this is a plain Windows client, the application should not use its own login, but the login would depend on the user, preferrably through Windows authenticationl.

Источник

Sql error sqlstate 28000

This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.

Answered by:

Question

We have an application that connects to SQL 2005 thru ODBC with the following string:

When our administrators login on the workstation the application works well. But when ordinary users login they get the following error. (We only have 1 domain)

SQL Server Error: 18452

Login failed for user «. The user is not associated with a trusted SQL Server connection.

Then the standard SQL Server Login window pops up asking for the Login ID and Password. On the window the ‘Use Trusted Connection’ is checked and the name of the user on the workstation appears on the LoginID. What we do is uncheck the ‘Use Trusted Connection’ then login using the credentials above.

Need help on this one please. Thanks.

Answers

Try sp_adduser to make sure that the login is identified as trusted by SQL Server.

Checked the setting, it is on SQL Server ad Windows auth mode.

Try sp_adduser to make sure that the login is identified as trusted by SQL Server.

I am facing Same problem and it is as follows:-

There are two servers ‘A’ and ‘B’. At server ‘A’, there is installed Window server at server ‘B”, there

is installed Window Server2000. And both servers have SQL SERVER 2000. I have created link server from A to B. I have to insert data into table of server ‘B’ from server ‘A’. When I used directly insert command like

Insert into [server name (B)]. [Database]. [Owner] .[ table name]

Select * from [server name (A)]. [Database]. [Owner] .[ table name]

The data is inserted successfully.

But when I created trigger (for insertion) on table of server (A) (because I want as there is insertion in the table of server( A), rest

Records that are not in the table of server (B ) , are automatically inserted into the table of server(B)).

The Insertion is not complete and there is shown system message which is as follows:-

Server: Msg 7391, Level 16, State 1, Procedure rms_trn_con_details_insertion , Line 6

The operation could not be performed because the OLE DB provider ‘SQLOLEDB’ was unable to begin a distributed transaction.

[OLE/DB provider returned message: New transaction cannot enlist in the specified transaction coordinator . ]

I have searched in Google , I found that there are problems in heterogeneous system.

But till today, I have no solution for it. Temporary, I find solution through Job Scheduling.

Try to find out solution for this problem.

Regards,

Nikhil Chaturvedi

Источник

Понравилась статья? Поделить с друзьями:
  • Ошибка objxl getcertlistasjson is not a function
  • Ошибка odbc sqlstate 08001 номер ошибки 17
  • Ошибка object required vba excel
  • Ошибка ocsp ответ еще не действителен
  • Ошибка ocf частотник шнайдер 312