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
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Finding Database name

Finding Database name

Scheduled Pinned Locked Moved Database
databasehelpquestion
4 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.
  • A Offline
    A Offline
    alok_2k3
    wrote on last edited by
    #1

    Hi, I am creating a procedure in which I want to check that if a database is already exists then drop the database and create the new database and if the database is not exist then just create the database. How can I do this. Plz help me.... Thanks in Advance Alok...

    G 1 Reply Last reply
    0
    • A alok_2k3

      Hi, I am creating a procedure in which I want to check that if a database is already exists then drop the database and create the new database and if the database is not exist then just create the database. How can I do this. Plz help me.... Thanks in Advance Alok...

      G Offline
      G Offline
      Giorgi Dalakishvili
      wrote on last edited by
      #2

      You can check database existence like this: if exists (select * from sys.databases where name = 'demo') // database exists, drop it and create new else // database doesn't exist so just create it

      #region signature my articles #endregion

      A 1 Reply Last reply
      0
      • G Giorgi Dalakishvili

        You can check database existence like this: if exists (select * from sys.databases where name = 'demo') // database exists, drop it and create new else // database doesn't exist so just create it

        #region signature my articles #endregion

        A Offline
        A Offline
        alok_2k3
        wrote on last edited by
        #3

        Thanks, It's working....

        G 1 Reply Last reply
        0
        • A alok_2k3

          Thanks, It's working....

          G Offline
          G Offline
          Giorgi Dalakishvili
          wrote on last edited by
          #4

          You are welcome :)

          #region signature my articles #endregion

          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