Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004

    Unanswered: Using the default database

    I am wondering if there is a way to use the default database in a SQL Server job?

    I executed the sp_defaultdb to set the default database to what I want, no problem.

    But in my job, I have to specify the database to use in the drop down menu or set it using the USE command. I currently set it using the USE command but I am wondering, is there a way to USE the default database automatically?


  2. #2
    Join Date
    Jul 2003
    San Antonio, TX
    You can set the default database to SQLAgent account, which means that that account has to be a domain or local computer account, not local system account.
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts