Microsoft KB Archive/275615

= FIX: Restore Command That Uses Large File Names May Cause Access Violation =

Article ID: 275615

Article Last Modified on 3/14/2006

-

APPLIES TO


 * Microsoft SQL Server 7.0 Standard Edition

-



This article was previously published under Q275615



BUG #: 58121 (SQLBUG_70)



SYMPTOMS
If you use char or nchar variables greater than 260 characters in length to specify the file names in a RESTORE command, or if a string literal greater than 260 characters is specified, the command may cause an access violation and the RESTORE request is not processed.



WORKAROUND
The file name must be 260 characters or shorter. If necessary, rename or move the file so that it uses a shorter file name.

If you use a variable to specify the file name, use a varchar or nvarchar variable instead of char or nchar. The char and nchar datatypes are padded out with spaces that count as part of the file name, while the varchar and nvarchar variables are not padded out with these spaces, which typically results in a shorter valid file name.



STATUS
Microsoft has confirmed this to be a problem in SQL Server 7.0. This problem has been corrected in U.S. Service Pack 3 for Microsoft SQL Server 7.0. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

274799 INF: How to Obtain Service Pack 3 for Microsoft SQL Server 7.0 and Microsoft Data Engine (MSDE) 1.0

For more information, contact your primary support provider.



MORE INFORMATION
With this fix, any file name that is greater than 260 characters in length is truncated. If the length of the file name actually exceeds 260 characters, this could result in the file not being found during the RESTORE and the following error message occurs:

Server: Msg 3201, Level 16, State 2, Line 7 Cannot open backup device 'very long file name specified here'

Keywords: kbbug kbfix KB275615

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.