This article was previously published under Q275615
This article has been archived. It is offered "as is" and will no longer be updated.
BUG #: 58121 (SQLBUG_70)
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.
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.
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.
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 7Cannot open backup device 'very long file name specified here'