Solved

MSDE osql checkdb

Posted on 2006-06-15
4
1,481 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
  • 2
  • 2
4 Comments
 
LVL 5

Expert Comment

by:bwdowhan
Comment Utility
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
Comment Utility
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
Comment Utility
Use [My db]
0
 

Author Comment

by:drees727
Comment Utility
Very helpful.  Thank you.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

772 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now