Thursday, March 29, 2012

Database Names

Hi Everyone,
I've got Windows SharePoint Services installed and it uses a database called
STS_svr-apps-1_1414639615
I'm trying to back up this database from the QSQL command line tool.
However when I try to run the backup, I get the following error:
1> BACKUP DATABASE STS_svr-apps-1_1414639615 TO DISK
'D:\ShareBack\Backup.bak'
2> GO
Msg 170, Level 15, State 1, Server SVR-APPS-1\SHAREPOINT, Line 1
Line 1: Incorrect syntax near '-'.
1>
Thinking it might be an issue with the name I enclosed it in single quotes:
1> BACKUP DATABASE 'STS_svr-apps-1_1414639615' TO DISK
'D:\ShareBack\Backup.bak'
2> GO
Msg 170, Level 15, State 1, Server SVR-APPS-1\SHAREPOINT, Line 1
Line 1: Incorrect syntax near 'STS_svr-apps-1_1414639615'.
1>
Yet I still get the same error!
Then I tried to just use the database:
1> use STS_svr-apps-1_1414639615
2> go
Msg 911, Level 16, State 1, Server SVR-APPS-1\SHAREPOINT, Line 1
Could not locate entry in sysdatabases for database 'STS_svr'. No entry
found
with that name. Make sure that the name is entered correctly.
1>
Again I tried to using quotation marks, another error:
1> use 'STS_svr-apps-1_1414639615'
2> GO
Msg 170, Level 15, State 1, Server SVR-APPS-1\SHAREPOINT, Line 1
Line 1: Incorrect syntax near 'STS_svr-apps-1_1414639615'.
1> quit
If I do:
SELECT name
FROM master..sysdatabases
ORDER BY name
It lists:
master
model
msdb
STS_Config
STS_svr-apps-1_1414639615
tempdb
From this I can only assume MSDE doesn't support having '-' in a database
name?
Can someone suggest a way around this?
Thanks
Chris Moon
hi Chris,
> From this I can only assume MSDE doesn't support having '-' in a
> database name?
>
SQL Server (and MSDE) support this kind of identifier.. executing
SET NOCOUNT ON
SELECT @.@.VERSION
GO
CREATE DATABASE [STS_svr-apps-1_1414639615];
GO
USE [STS_svr-apps-1_1414639615];
GO
USE master ;
GO
DROP DATABASE [STS_svr-apps-1_1414639615];
reports
Microsoft SQL Server 2000 - 8.00.2162 (Intel X86)
Sep 30 2005 19:59:14
Copyright (c) 1988-2003 Microsoft Corporation
Desktop Engine on Windows NT 5.1 (Build 2600: Service Pack 2)
The CREATE DATABASE process is allocating 0.75 MB on disk
'STS_svr-apps-1_1414639615'.
The CREATE DATABASE process is allocating 0.49 MB on disk
'STS_svr-apps-1_1414639615_log'.
Deleting database file 'C:\Programmi\Microsoft SQL
Server\MSSQL$MSDE2K\Data\STS_svr-apps-1_1414639615_log.LDF'.
Deleting database file 'C:\Programmi\Microsoft SQL
Server\MSSQL$MSDE2K\Data\STS_svr-apps-1_1414639615.mdf'.
http://msdn.microsoft.com/library/de...on_03_6e9e.asp
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.16.0 - DbaMgr ver 0.61.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||Many thanks Andrea, it worked perfectly.
Thanks again.
Chris Moon
"Andrea Montanari" <andrea.sqlDMO@.virgilio.it> wrote in message
news:43ml8mF1o772rU1@.individual.net...
> hi Chris,
> SQL Server (and MSDE) support this kind of identifier.. executing
> SET NOCOUNT ON
> SELECT @.@.VERSION
> GO
> CREATE DATABASE [STS_svr-apps-1_1414639615];
> GO
> USE [STS_svr-apps-1_1414639615];
> GO
> USE master ;
> GO
> DROP DATABASE [STS_svr-apps-1_1414639615];
> reports
> ----
> Microsoft SQL Server 2000 - 8.00.2162 (Intel X86)
> Sep 30 2005 19:59:14
> Copyright (c) 1988-2003 Microsoft Corporation
> Desktop Engine on Windows NT 5.1 (Build 2600: Service Pack 2)
> The CREATE DATABASE process is allocating 0.75 MB on disk
> 'STS_svr-apps-1_1414639615'.
> The CREATE DATABASE process is allocating 0.49 MB on disk
> 'STS_svr-apps-1_1414639615_log'.
> Deleting database file 'C:\Programmi\Microsoft SQL
> Server\MSSQL$MSDE2K\Data\STS_svr-apps-1_1414639615_log.LDF'.
> Deleting database file 'C:\Programmi\Microsoft SQL
> Server\MSSQL$MSDE2K\Data\STS_svr-apps-1_1414639615.mdf'.
> http://msdn.microsoft.com/library/de...on_03_6e9e.asp
> --
> Andrea Montanari (Microsoft MVP - SQL Server)
> http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
> DbaMgr2k ver 0.16.0 - DbaMgr ver 0.61.0
> (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
> interface)
> -- remove DMO to reply
>
sql

No comments:

Post a Comment