Showing posts with label instance. Show all posts
Showing posts with label instance. Show all posts

Friday, February 24, 2012

Backup a Database with a number as name

I've got some numbered databases in an SQL Server 2000 instance with SP3a (eg
'300'). When I create a task to backup this database, I can't get the
statement parsed. I've tried the following:
backup database 301 to Disk_301 with init;
backup database '301' to Disk_301 with init;
backup database "301" to Disk_301 with init;
All statements above result in "Error 170: Incorrect syntax near '301'"
What's going on here?
Wilbert,
You need square brackets.
create database [300]
go
backup database [300] to disk = 'c:\temp\300.bak'
go
Gives:
The CREATE DATABASE process is allocating 0.63 MB on disk '300'.
The CREATE DATABASE process is allocating 0.49 MB on disk '300_log'.
Processed 80 pages for database '300', file '300' on file 1.
Processed 1 pages for database '300', file '300_log' on file 1.
BACKUP DATABASE successfully processed 81 pages in 0.254 seconds (2.588
MB/sec).
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Wilbert wrote:
> I've got some numbered databases in an SQL Server 2000 instance with SP3a (eg
> '300'). When I create a task to backup this database, I can't get the
> statement parsed. I've tried the following:
> backup database 301 to Disk_301 with init;
> backup database '301' to Disk_301 with init;
> backup database "301" to Disk_301 with init;
> All statements above result in "Error 170: Incorrect syntax near '301'"
> What's going on here?
>

Backup a Database with a number as name

I've got some numbered databases in an SQL Server 2000 instance with SP3a (e
g
'300'). When I create a task to backup this database, I can't get the
statement parsed. I've tried the following:
backup database 301 to Disk_301 with init;
backup database '301' to Disk_301 with init;
backup database "301" to Disk_301 with init;
All statements above result in "Error 170: Incorrect syntax near '301'"
What's going on here?Wilbert,
You need square brackets.
create database [300]
go
backup database [300] to disk = 'c:\temp\300.bak'
go
Gives:
The CREATE DATABASE process is allocating 0.63 MB on disk '300'.
The CREATE DATABASE process is allocating 0.49 MB on disk '300_log'.
Processed 80 pages for database '300', file '300' on file 1.
Processed 1 pages for database '300', file '300_log' on file 1.
BACKUP DATABASE successfully processed 81 pages in 0.254 seconds (2.588
MB/sec).
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Wilbert wrote:
> I've got some numbered databases in an SQL Server 2000 instance with SP3a
(eg
> '300'). When I create a task to backup this database, I can't get the
> statement parsed. I've tried the following:
> backup database 301 to Disk_301 with init;
> backup database '301' to Disk_301 with init;
> backup database "301" to Disk_301 with init;
> All statements above result in "Error 170: Incorrect syntax near '301'"
> What's going on here?
>

Backup a Database with a number as name

I've got some numbered databases in an SQL Server 2000 instance with SP3a (eg
'300'). When I create a task to backup this database, I can't get the
statement parsed. I've tried the following:
backup database 301 to Disk_301 with init;
backup database '301' to Disk_301 with init;
backup database "301" to Disk_301 with init;
All statements above result in "Error 170: Incorrect syntax near '301'"
What's going on here?Wilbert,
You need square brackets.
create database [300]
go
backup database [300] to disk = 'c:\temp\300.bak'
go
Gives:
The CREATE DATABASE process is allocating 0.63 MB on disk '300'.
The CREATE DATABASE process is allocating 0.49 MB on disk '300_log'.
Processed 80 pages for database '300', file '300' on file 1.
Processed 1 pages for database '300', file '300_log' on file 1.
BACKUP DATABASE successfully processed 81 pages in 0.254 seconds (2.588
MB/sec).
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Wilbert wrote:
> I've got some numbered databases in an SQL Server 2000 instance with SP3a (eg
> '300'). When I create a task to backup this database, I can't get the
> statement parsed. I've tried the following:
> backup database 301 to Disk_301 with init;
> backup database '301' to Disk_301 with init;
> backup database "301" to Disk_301 with init;
> All statements above result in "Error 170: Incorrect syntax near '301'"
> What's going on here?
>

Sunday, February 12, 2012

Backspace doesn't work in SSMS

This week, I installed SQL2K5 (SP2) on two W2K servers.

On 1 server (W2K Server), I deleted SQL2K and installed SQL2K5 using the default instance. This server works OK.

On another machine (W2K Pro), I retained my SQL2K default instance of the SQL2K db engine and installed SQL2K5 as a new named instance (i.e. SQL2005).

When I go into SSMS on the 2nd machine and edit an sql script, the backspace, home, delete (and other directional key) keys from the keyboard do absolutely nothing.

SSMS on the 1st machine works just fine.

I have looked at SSMS's customizations and tried several changes to no avail...

Does anyone know what I need to do in SSMS?

TIA!!!

you may need to re-install the client tool... select only workstation components from the CD and re-install it...

Madhu

|||

Have you changed any shortcut keys on the client tools of this installation?

Backingng Up a Database that is Attached

Hi,

I was trying to figure out how to back up a database that has been attached to the SQL Express instance. I found on the web this tutorial and tried to use it, however it seems like it cannot find the database. The DB is attached by the web application using AttachDbFilename in the connectionstring.

http://www.sqldbatips.com/showarticle.asp?ID=27

Any ideas?

thanks

If you are doing personal development you download the eval version and install it as a named instance and register the Express so you can manage it with Management Studio. It is good for 180 days but if you are developing full application buy the developer edition it cost $60 on the web and do the same. And one more thing the database is not attached to Express it is created in Express which is a full RDBMS(relational database management system) without the GUI tools. Hope this helps.

http://www.microsoft.com/sql/downloads/trial-software.mspx

|||

Hi,

I actually do have the the developer edition, and when I used the management studio to connect to SQL Express server (on a different machine) I was still unable to see/view this database thats was attached by the web app. I know the database was attached, because the web app was functioning properly and displaying/inserting data in the database.

|||If you have the developer edition you just right click at the top of management studio to register the Express and the Express becomes local to you. Then you use the backup and restore wizard to backup your databases in the Express. I have registered 68 SQL Server 2000/7.0 in one box. If you have more questions post again. Hope this helps.|||

Hi,

The problem is I do not see this databse in the pulldown in the wizard. I see all the other databses on the server, but none of the databses that the web app atached through AttachDbFilename.

Am I missing something?

tony

|||Well I think it is because you used just half of the database which is the data file, so check the Microsoft SQL Server folder under programs and check the data sub folder to see if the LDF(log data file) is there. If not create a blank database with same name and do INSERT INTO to recreate the database and delete the existing ones of all the attached databases because you need the log file and you also need to backup your databases. And no you are not missing anything Microsoft is using RDBMS(relational database management system) as file based database. So the SQL Server wizards may not be seeing all the attached databases because they are missing the log file. Another option is to right click on the database to see if backup is enabled. Hope this helps.