ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Default Database in SQL SERVER 2005

Default Database in SQL SERVER 2005

原创 Linux操作系统 作者:italucia 时间:2009-05-20 20:23:41 0 删除 编辑

This morning when I open SSMS, it turns out the error saying that could not connect to the server.

It's strange since yesterday it worked fine, and i just remember that the only modification is my colleage had taken one of the databases OFFLINE.

Finally i understand that the database he took offline is the default database, and in this case, the server is not accessible any more.  The solution is trying to change the default database to master on this server, using the following cmd.

 

C:\> sqlcmd -E -d master

1> ALTER LOGIN [BUILTIN\Administrators] WITH
DEFAULT_DATABASE=master

2> GO

Then it works perfectly. :)

 


 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/12374161/viewspace-600592/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2009-05-08

  • 博文量
    28
  • 访问量
    27866