• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
Collapse

You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:

  • You are not logged in. If you are already registered, fill in the form below to log in, or follow the "Sign Up" link to register a new account.
  • You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
  • If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.

Previously on "sql server management studio"

Collapse

  • scotspine
    replied
    i'll check that out s/cadet - once i've finished this iteration

    weltchy tsk tsk

    Leave a comment:


  • Weltchy
    replied
    Originally posted by scotspine View Post
    something about haste and speed comes to mind
    Less Hash, more Speed?

    PS - I am, in no way, endorsing Drug use!!!

    Leave a comment:


  • Spacecadet
    replied
    Originally posted by scotspine View Post
    it sounds as though you've read the manual???
    Thats not always such a bad thing

    Seriously though, Query Analyser in Sql Server 2000 behaved exactly the same way and this behaviour was carried through to 2005 and 2008
    Don't know about version 7 - I only ever did some basic admin work on that

    Leave a comment:


  • scotspine
    replied
    Originally posted by Spacecadet View Post

    its not magically "switching" you just don't know how to use it!
    it sounds as though you've read the manual???

    Leave a comment:


  • Spacecadet
    replied

    its not magically "switching" you just don't know how to use it!

    The behaviour is perfectly consitant, predictable and documented

    Leave a comment:


  • Not So Wise
    replied
    If you know knew the amount of times I ran queries against "Master" by mistake on my home system because of the switching

    Luckily have policy at work to always use "Use DBName"

    Leave a comment:


  • Spacecadet
    replied
    Originally posted by scotspine View Post
    "it will open a session to which ever database you are currently connected to"

    hmmmm..in theory, yes. i still think my copy of ssm studio has an attitude problem though.
    try clicking on a db in the object explorer then click on new query
    see which db you are connected to

    then with the query window active click new query
    see which db you are connected to

    select a different db in the object explorer and click new query (whilst the object explorer window is still maintaining the application focus)
    again see which db you are connected to

    Leave a comment:


  • scotspine
    replied
    "it will open a session to which ever database you are currently connected to"

    hmmmm..in theory, yes. i still think my copy of ssm studio has an attitude problem though.

    "use "dbname""

    i know, i know. i ought to do this but sometimes....you just want to be productive and get on with things...something about haste and speed comes to mind

    Leave a comment:


  • Spacecadet
    replied
    when you click on new query (or hit control-N) it will open a session to which ever database you are currently connected to. This is not constrained to the query windows.

    So if you were browsing the live system in the object explorer tree and the window focus was on there then SSMS will open a DB connection to the Live database.

    Once you understand the behaviour you'll realise its not just switching... its doing what it is supposed to do and it does it very consitantly.

    As JoJoGabor pointed out though - adding the use <dbname> will make sure your scripts are always diverted to the correct database (unless your running a partial section of the query by highlighting then executing)

    Leave a comment:


  • DimPrawn
    replied
    Originally posted by JoJoGabor View Post
    Just put the statement at the start of the script:

    use "dbname"
    WHS/WSS

    Leave a comment:


  • JoJoGabor
    replied
    Just put the statement at the start of the script:

    use "dbname"

    Leave a comment:


  • scotspine
    started a topic sql server management studio

    sql server management studio

    this thing has a mind of it's own. it keeps switching the active database so that unless you're *really* careful, you can end up running a script against a database other than the one you think you are!!!!! grrrrrr

Working...
X