locked
SQL Server 2012 error when trying to create a query? RRS feed

Answers

  • You are running the query against master database. But your table resides in TEST_DB1?? (DB name is not clear in pic)

    Either change the database name to TEST_DB1 using the dropdown

    else use the below query before your query

    Use <Database_Name>
    go


    Regards, Ashwin Menon My Blog - http:\\sqllearnings.com


    • Edited by Ashwin Menon Friday, July 25, 2014 12:07 PM
    • Proposed as answer by Krishnakumar S Friday, July 25, 2014 12:24 PM
    • Marked as answer by Sofiya Li Friday, August 1, 2014 6:53 AM
    Friday, July 25, 2014 12:06 PM

All replies

  • You are running the query against master database. But your table resides in TEST_DB1?? (DB name is not clear in pic)

    Either change the database name to TEST_DB1 using the dropdown

    else use the below query before your query

    Use <Database_Name>
    go


    Regards, Ashwin Menon My Blog - http:\\sqllearnings.com


    • Edited by Ashwin Menon Friday, July 25, 2014 12:07 PM
    • Proposed as answer by Krishnakumar S Friday, July 25, 2014 12:24 PM
    • Marked as answer by Sofiya Li Friday, August 1, 2014 6:53 AM
    Friday, July 25, 2014 12:06 PM
  • Hello,

    It occurred due to wrong selection of database ,I think you did not select database by default Master database is selected .

    Change your selection and run query .


    Ahsan Kabir Please remember to click Mark as Answer and Vote as Helpful on posts that help you. This can be beneficial to other community members reading the thread. http://www.aktechforum.blogspot.com/

    Thursday, August 7, 2014 7:44 AM