i need to add my user name into ssms,how to login first in order to add another user.
like sa or what password?
First, a little more detail would help here. E.g. is this a new or existing SQL instance? Did you install it? Why do you need to do this? This info would be extremely helpful.
Next, SQL Server Management Studio (SSMS) does not store users/credentials, SQL Server does. SSMS is one of the tools Microsoft provides to interact with SQL Server. This is important when understanding what it is that you are trying to do.
When you install a new instance of SQL Server 2008, you have two Authentication modes for that instance:
1) Windows Authentication: Only windows users can access this instance of SQL Server
2) SQL Server and Windows Authentication: Which allows for access by SQL Server Accounts - which are created in SQL Server and the credentials (UN, password, etc) are stored and managed in SQL Server and not Windows/AD.
yourDomain\YourUserName is an example of a Windows account
SA is a SQL Server Account.
i need to add my user name into ssms
By My user name I suspect you are talking about adding your Windows account to an instance of SQL Server. To do that:
1) Open SSMS
2) With Server Type set to Database Engine, your server's name for Server Name, Windows Authentication for Authentication - click Connect
If you can't get in here then the discussion is over - talk to your DBA (or whoever manages the server)
...if you can get in...
3) In Object Explorer > Expand your server instance, go to Security, right-click on logins and select New Login
4) The new login window is pretty self-explanatory.
The irony here is: if you have the rights to connect and do this - then you don't need to.
Again, more detail would help us help you here.
"I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."
-- Itzik Ben-Gan 2001