× Heads up!

Aqua Data Studio / nhilam

Follow
IDE for Relational Databases
×
tariqrahiman reported 2013-07-10T20:19:25Z  · SachinPrakash last modified 2013-07-16T21:17:39Z

Not able to Attach Database in SQL Server due to large file name with spaces in syntax


customer request
Priority Minor
Complexity Unknown
Component DBA-T - SQL Server - Storage Mngr
Version 13.0
Version: 13.0.2
Build #: 32848
Build Date: 2013-Jun-13 07:30:48 AM
 

Not able to Attach Database in SQL Server due to large file name with spaces in syntax

To reproduce, use the ADS install at 10.168.11.57 and use the database named GTWMDB which I have detached.

1. Open SQL Server DBA Tool - Storage Manager

2. Go to the Databases Tab

3. Right Click on any database and select Attach Database

4. Add a file

5. Save the Alter and ADS fails with an error message saying the file length is too large.

The file that starts with 'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\GTWMDB_Data.mdf                                                                                                                                                                                ' is too long. Maximum length is 259.
 Msg: 103, Level: 15, State: 3, Procedure: , Line: 0

 

Note:

If you closely look at the Syntax, you can find that after the file name, there is lots of free spaces. See screenshot 2

Sample SQL Syntax created by ADS

USE [master]
GO
CREATE DATABASE [GTWMDB] ON
(FILENAME=N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\GTWMDB_Data.mdf                                                                                                                                                                                '), 
(FILENAME=N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\GTWMDB_Log.mdf                                                                                                                                                                                 '), 
(FILENAME=N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\new.mdf                                                                                                                                                                                        ')
FOR ATTACH
GO
if not exists (select name from master.sys.databases sd where name = N'GTWMDB' and 
SUSER_SNAME(sd.owner_sid) = SUSER_SNAME() ) EXEC [GTWMDB].dbo.sp_changedbowner
@loginame=N'sa', @map=false
GO

 

2 attachments
  • 1

    2013-07-10T20:19:25Z

    54 KB

  • 2

    2013-07-10T20:19:26Z

    60 KB

Issue #9567

Closed
Fixed
Resolved 2013-07-12T20:59:05Z
 
 
Completion
No due date
Fixed Build v13.0.3-5
No time estimate

About AquaClusters Privacy Policy Support Version - 19.0.2-4 AquaFold, Inc Copyright © 2007-2017