FIX: SP1 Regression: Bulk Load of a Table with a Text Column Causes AV on the Server (308807)



The information in this article applies to:

  • Microsoft SQL Server 2000 (all editions) SP1

This article was previously published under Q308807
BUG #: 354453 (SHILOH_BUGS)

SYMPTOMS

If you plan to run multiple instances of SQL Server 2000 on a server with mixed RTM and SQL Server 2000 Service Pack 1 (SP1) levels, the BULK INSERT or bulk-copy (BCP) of a table with a text column fails on instances of SQL Server 2000 that are running on the RTM build.

CAUSE

The new Impprov.dll file that the SQL Server 2000 SP1 upgrade installs is not compatible with the RTM build of Microsoft SQL Server 2000.

RESOLUTION

To resolve this problem, obtain the latest service pack for Microsoft SQL Server 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

290211 INF: How to Obtain the Latest SQL Server 2000 Service Pack

WORKAROUND

The goal of the workaround is to preserve the RTM copy of the Impprov.dll so that you can continue to use it in the mixed environment. So, you must ensure that the C:\Program Files\Microsoft SQL Server\80\COM folder always contains only the RTM copy of Impprov.dll.

For example, if you have not yet upgraded to SQL Server 2000 SP1 and you are planning to upgrade one of the instances of SQL Server, you can use the following steps to resolve the problem:
  1. Rename the Impprov.dll file in the C:\Program Files\Microsoft SQL Server\80\COM folder to Impprov.rtm.dll.
  2. Install SQL Server 2000 SP1 to one or more instances.
  3. Rename the new Impprov.dll file in the C:\Program Files\Microsoft SQL Server\80\COM folder to Impprov.sp1.dll.
  4. Rename the Impprov.rtm.dll file and name it Impprov.dll. This is the RTM copy of the DLL. Now, all of the instances continue to use this DLL.
Similarly, if you have already upgraded to SQL Server 2000 SP1, you can resolve the problem by following these steps:
  1. Rename the Impprov.dll file in the C:\Program Files\Microsoft SQL Server\80\COM folder to Impprov.sp1.dll.
  2. Use the SQL Server 2000 CD and copy the Impprov.dll from the x86\Binn folder on the CD to the C:\Program Files\Microsoft SQL Server\80\COM folder on the computer.
Please note that you must repeat the preceding steps every time you install SQL Server 2000 SP1 onto SQL Server 2000. However, if all of the instances of Microsoft SQL Server 2000 are upgraded to SQL Server 2000 SP1 the problem does not occur.

STATUS

Microsoft has confirmed that this is a problem in Microsoft SQL Server 2000 Service Pack 1. This problem was first corrected in Microsoft SQL Server 2000 Service Pack 2.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Install two instances of Microsoft SQL Server 2000.
  2. Apply SQL Server 2000 Service Pack 1 to one instance and leave the other version at the RTM build.
  3. Connect to the RTM instance by using Query Analyzer and run the following script:
    USE TEMPDB
    GO
    /****** Object:  Table [dbo].[pub_info]    Script Date: 4/5/01 5:38:17 PM ******/ 
    if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[pub_info]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
    drop table [dbo].[pub_info]
    GO
    /***** create a schema of the pub_info table in the tempdb database ***/ 
    select * into tempdb..pub_info from pubs..pub_info where 1=2
    GO
    /*** Transfer the records in the pub_info table onto a flat text file, using bcp.exe ***/<BR/>
    EXEC master..xp_cmdshell 'bcp pubs..pub_info out c:\pub_info.bcp -n -T'
    GO
    /****Bulk load the data from the flat file into the new table created in tempdb***/<BR/>
    BULK INSERT tempdb..pub_info from 'C:\pub_info.bcp' with (datafiletype = 'native')
    					
The following Access Violation occurs:
Short Stack Dump
FD0131DE Module(UNKNOWN+00000000)
41901B0B Module(impprov+00001B0B)
4190E95F Module(impprov+0000E95F)
0042D1C5 Module(sqlservr+0002D1C5) (CQScanRowset::Prefetch(unsigned long *)+00000029)
0070F223 Module(sqlservr+0030F223) (CQScanRmtBase::RmtPrefetch(unsigned long *)+00000013)
0070FB03 Module(sqlservr+0030FB03) (CQScanRmtScan::GetRow(unsigned long *,unsigned long *)+000001B5)
0042FE4F Module(sqlservr+0002FE4F) (CQScanTop::GetRow(unsigned long *,unsigned long *)+000000CA)
004BFC9D Module(sqlservr+000BFC9D) (CQScanUpdate::GetRow(unsigned long *,unsigned long *)+0000013D)
00427985 Module(sqlservr+00027985) (CQueryScan::GetRow(unsigned long *,unsigned long *)+00000014)
00426F64 Module(sqlservr+00026F64) (CStmtQuery::ErsqExecuteQuery(class CMsqlExecContext *,class CEsComp const *,class CEsComp const *,unsigned long *,int,int)const +000003C4)
0042EA36 Module(sqlservr+0002EA36) (CStmtDML::XretExecuteNormal(class CMsqlExecContext *)const +000002F0)
0042E82D Module(sqlservr+0002E82D) (CStmtDML::XretExecute(class CMsqlExecContext *)const +0000001C)
004160DB Module(sqlservr+000160DB) (CMsqlExecContext::ExecuteStmts(class ExecutionContext *)+0000027E)
00415765 Module(sqlservr+00015765) (CMsqlExecContext::Execute(class CCompPlan *,class CParamExchange *)+000001C7)
00415410 Module(sqlservr+00015410) (CSQLSource::Execute(class CParamExchange *)+00000343)
004F71C1 Module(sqlservr+000F71C1) (CSQLSource::SeExecute(void)+0000006D)
009239BF Module(sqlservr+005239BF) (ExecSql(class SQLError &,unsigned short *,unsigned int)+000000F1)
00884999 Module(sqlservr+00484999) (CBcpImport::ExecInsertStmt(unsigned long)+00000456)
0088320D Module(sqlservr+0048320D) (BcpImportMain(unsigned short *,int,class CBulkImp *,unsigned __int64 &,unsigned __int64 &)+000001AA)
00637DDB Module(sqlservr+00237DDB) (CStmtBulkIns::XretExecute(class CMsqlExecContext *)const +00000066)
004160DB Module(sqlservr+000160DB) (CMsqlExecContext::ExecuteStmts(class ExecutionContext *)+0000027E)
00415765 Module(sqlservr+00015765) (CMsqlExecContext::Execute(class CCompPlan *,class CParamExchange *)+000001C7)
00415410 Module(sqlservr+00015410) (CSQLSource::Execute(class CParamExchange *)+00000343)
00459A54 Module(sqlservr+00059A54) (language_exec(struct srv_proc *)+000003C8)
004175D8 Module(sqlservr+000175D8) (process_commands(struct srv_proc *)+000000E0)
410735D0 Module(UMS+000035D0) (ProcessWorkRequests(class UmsWorkQueue *)+00000264)
4107382C Module(UMS+0000382C) (ThreadStartRoutine(void *)+000000BD)
7800BEA1 Module(MSVCRT+0000BEA1) (_beginthread+000000CE)
77E92CA8 Module(KERNEL32+00012CA8) (CreateFileA+0000011B)
-----------------------------------------------------------------------
				
The Access Violation does not occur if:
  • You run the preceding script on the SQL Server 2000 SP1 instance.
  • SQL Server 2000 SP1 is not present on the server.
  • All the instances are upgraded to SQL Server 2000 SP1.

Modification Type:MajorLast Reviewed:1/10/2002
Keywords:kbbug kbSQLServ2000SP2Fix KB308807