Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8319345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:17:48+00:00 2026-06-08T22:17:48+00:00

I am using sql server 2008 R2 and in 1 scenario i need to

  • 0

I am using sql server 2008 R2 and in 1 scenario i need to change the default database from “master” to the “Test” as soon as i click on the New Query it will select default database to “Test”. for this i am using following query to change the database priority,

Exec sp_defaultdb @loginame='sa',@defdb='Test'

i am able to change the default database to Test for sa Login but i wanted to change it in the Windows authentication mode i am connecting database using (local).
can any one know about what is the default user when we do login to the SSMS using Windows Authentication Mode. or any other solution to change the priority of database to Test?.
Thanks! in advanced.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T22:17:50+00:00Added an answer on June 8, 2026 at 10:17 pm

    In Windows authentication mode Your credentials to SQL Server are the same, like in Your System. For Example, in Non-Domain Environment, if Your Computer name is CPU, and login is USER, then Windows Authentication credentials would be : CPU\USER. If You try to connect from other PC, credentials would be different.

    So, for answer for Your question : there is no default user when we do login to SSMS using Windows Authentication Mode.

    For second question : You can do it for Windows Authentication User like in this example :

    EXEC sp_defaultdb @loginame = 'CPU\USER' (Domain or Computer Name\Windows Login ) @defdb = 'Test'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have strange scenario in which if I create database using SQL Server 2008
I just converted my SQL Server 2008 database from using a lat/long pair to
using : SQL Server 2008 R2, Entityframework 4.3.1 my scenario : I read my
I'm using SQL Server 2008. I have an interesting scenario where a stored procedure
Scenario: Production servers are running SQL Server 2008 in the domain myDomain.com Dev/test/stage servers
I have a SQL Server 2008 database which contains data that I need to
I am using SQL Server 2008 Enterprise. I have yearly customer data from 2000
Using SQL Server 2008, I need to select this XML into a Table. I
im using sql server 2008. my scenario is as follows. there is a user
Using SQL Server 2008 R2 we are looking for a way to select the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.