Link to home
Start Free TrialLog in
Avatar of drees727
drees727

asked on

MSDE osql checkdb

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.







Avatar of bwdowhan
bwdowhan

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
Avatar of drees727

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of bwdowhan
bwdowhan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Very helpful.  Thank you.