Solved

MSDE osql checkdb

Posted on 2006-06-15
4
1,496 Views
Last Modified: 2008-01-09
I need to run a checkdb on an MSDE database.  I'm logged into the server running MSDE as an Administrator and typed the following at the command prompt:

c:\osql -E -d Mydb

and get the following error:

Cannot open database requested in login 'Mydb'.  Login Fails.

If I type in c:\osql -E
I get the >1
Then I type in the following, but nothing happens:
 >1 use Mydb
>2  dbcc checkdb

Any suggestions?  Thanks.







0
Comment
Question by:drees727
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 5

Expert Comment

by:bwdowhan
ID: 16913062
Hi drees727,

You just need to add the GO keyword after each command:

If I type in c:\osql -E
I get the >1
Then I type in the following, but nothing happens:
 >1 use Mydb
>2 GO
>1 dbcc checkdb
>2 GO
>1

Brian
0
 

Author Comment

by:drees727
ID: 16913224
Thanks.  I just realized my database name has a space 'My db'.  If I use:

use 'My db'
or
use "My db"
or
use ('My db')

I get an incorrect syntax error.
0
 
LVL 5

Accepted Solution

by:
bwdowhan earned 125 total points
ID: 16913289
Use [My db]
0
 

Author Comment

by:drees727
ID: 16913362
Very helpful.  Thank you.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question