Solved

MSDE osql checkdb

Posted on 2006-06-15
4
1,490 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

734 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