Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. MSSQL USE

MSSQL USE

Scheduled Pinned Locked Moved Database
c++helpdatabasesql-serverquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MsmVc
    wrote on last edited by
    #1

    Hi All Question move from C/C++/MFC Message Board to here. I have a problem to use syntax of MSSQL.I use this syntax

    use databasename

    it is not working for me.I check out through this code

    SELECT db_name()

    then result show MASTER. Can any one give me tips where i wrong to use syntax. Plz help me

    N 1 Reply Last reply
    0
    • M MsmVc

      Hi All Question move from C/C++/MFC Message Board to here. I have a problem to use syntax of MSSQL.I use this syntax

      use databasename

      it is not working for me.I check out through this code

      SELECT db_name()

      then result show MASTER. Can any one give me tips where i wrong to use syntax. Plz help me

      N Offline
      N Offline
      Niladri_Biswas
      wrote on last edited by
      #2

      If you write

      use databasename

      it will throw error Msg 207, Level 16, State 1, Line 1 Invalid column name 'databasename'. But if you write

      use master

      it will say Command(s) completed successfully. :)

      Niladri Biswas

      M 1 Reply Last reply
      0
      • N Niladri_Biswas

        If you write

        use databasename

        it will throw error Msg 207, Level 16, State 1, Line 1 Invalid column name 'databasename'. But if you write

        use master

        it will say Command(s) completed successfully. :)

        Niladri Biswas

        M Offline
        M Offline
        MsmVc
        wrote on last edited by
        #3

        if i use

        use master

        And i want to create some table in different database then what i will do?

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups