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. Updating or Maintaining structure of Database

Updating or Maintaining structure of Database

Scheduled Pinned Locked Moved Database
databasequestionsql-serversysadmintools
2 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.
  • X Offline
    X Offline
    xbiplav
    wrote on last edited by
    #1

    Hi, How can i check the structure of a database in mssql server? What I mean is I need a function or script which creates the table in the database if that table doesnot exist, and moreover i also need to check the existence of columns in a given table and also check if it's datatype is valid or not,if it is a primary key and so on and so forth. What I need is just a routine or a sql script to check the data structure of a database?

    P 1 Reply Last reply
    0
    • X xbiplav

      Hi, How can i check the structure of a database in mssql server? What I mean is I need a function or script which creates the table in the database if that table doesnot exist, and moreover i also need to check the existence of columns in a given table and also check if it's datatype is valid or not,if it is a primary key and so on and so forth. What I need is just a routine or a sql script to check the data structure of a database?

      P Offline
      P Offline
      Paul Conrad
      wrote on last edited by
      #2

      You can use IF EXISTS to check if most database objects exist or not. This can be tables, and stored procedures. Give google a shot and it'll turn up a bit of good stuff for you :-D

      "I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon

      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