
You're going to have to give us a bit more information.
What is the context? Application / Connection String / Registering a Server with SSMS
Telling us how is it that you will use that information will enable us to give you better assistance.
|||SInce you have mentioned that its from Command Line, i assume that its OSQL or SQLCMD (ie . if its sql 2000 then OSQL and in 2005 its sqlcmd). If this is the case , The instance name is nothing but the SQL Server Name you have given while installing. SQL Login is under which user context you will connect to this SQL Server.
Madhu
|||Ok dude thanx a lot i try tomorrow cause im back home already... If theres any problem i get back here again... Million Thanks... =)Jason|||
hi:
I got the problem, which lots of people might encounter before.
In my case, I use login control and sqlserver 2005 to build a login page.
when password & user name were entered. It gave me:
"Cannot open user default database, login fails"
The solution given by msdn is:
SQL Server 2005
You can use the sqlcmd utility to change the default database in SQL Server 2005. To do this, follow these steps:
sqlcmd –E -S InstanceName –d master
sqlcmd -S InstanceName -d master -U SQLLogin -P Password
ALTER LOGIN SQLLogin WITH DEFAULT_DATABASE = AvailDBName
Note AvailDBName is a placeholder for the name of the existing database that can be accessed by the SQL Server login in the instance.At the sqlcmd prompt, type GO, and then press ENTER
Seriously for this line: ALTER LOGIN SQLLogin WITH DEFAULT_DATABASE = AvailDBName, i still dont know wad to type to replace the word AvailDBName. Can anyone help me... My database name is C:\DOCUMENTS AND SETTINGS\USERNAME\MY DOCUMENTS\VISUAL STUDIO 2005\WEBSITES\WEBSITE1\APP_DATA\ASPNETDB.MDF. This is because i used the login control to do my login. Thanks...
Regards
Jason
|||AvailDBName is nothing but the database name which exists in the Instance of sql server. ie. Each login has a defualt database. if the database does not exists you will not be able to alter. Also , you database is not C:\DOCUMENTS AND SETTINGS\USERNAME\MY DOCUMENTS\VISUAL STUDIO 2005\WEBSITES\WEBSITE1\APP_DATA\ASPNETDB.MDF. THis is only Physical file of your database. The database name will be the one which you see when you open SQL SERVER MANAGEMENT STUDIO, database node, you can see all the databases in this instance. Otherwise , you can replace AvailDBName with 'Master'/MSDB. These are the system datbase , which will exists in any case
Madhu
No comments:
Post a Comment