This article has been archived. It is offered "as is" and will no longer be updated.
BUG #: 469096 (SHILOH_BUGS)
After you apply SQL Server 2000 Service Pack 3 (SP3), an access violation may occur when you run an INSERT statement in an nText column from a NULL parameter in a stored procedure that uses CAST or CONVERT.
Note This problem does not occur in earlier versions of SQL Server.
Service pack information
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 How to obtain the latest SQL Server 2000 service pack
The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
Note Because of file dependencies, the most recent hotfix or feature that contains these files may also contain additional files.
To work around this problem, use one of the following methods:
In the create table script, use the Text column type instead of the nText column type.
In the Insert statement, use the VARCHAR column type instead of the NVARCHAR column type.
Note You can also use both of these methods to work around this problem.
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.This problem was first corrected in Microsoft SQL Server 2000 Service Pack 4.
To reproduce this problem, use the following code sample:
if exists (select * from sysobjects where id = object_id('dbo.MyProc') and sysstat & 0xf = 4) drop procedure dbo.MyProc GO CREATE PROCEDURE dbo.MyProc( @alpDateMetMin datetime = NULL)ASCREATE TABLE #MyTable (nValue ntext NOT NULL)INSERT INTO #MyTable VALUES (CONVERT(nvarchar(19), @alpDateMetMin, 120))return 0GOEXEC MyProc NULL