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. Generic Insert & update procedure

Generic Insert & update procedure

Scheduled Pinned Locked Moved Database
helpdatabasequestionannouncement
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.
  • P Offline
    P Offline
    praveenanand
    wrote on last edited by
    #1

    hi all, i want to write a generic Insert & update procedure.It should work with different tables having diffrerent datatypes.suppose let say table1 may have col1 int,col2 varchar... and let say table2 may have col1 varchar,col2 char..like that..and so on.. generally till now wat iam doing is that iam writting different stored procedure for different tables.. Now i want to write One Insert & update procedure in my project...and for all the tables in the project i want to use only that procedure. Is it Possible? If yes kindly help me ..on resolving this issue.. Thanks & regards suman

    C 1 Reply Last reply
    0
    • P praveenanand

      hi all, i want to write a generic Insert & update procedure.It should work with different tables having diffrerent datatypes.suppose let say table1 may have col1 int,col2 varchar... and let say table2 may have col1 varchar,col2 char..like that..and so on.. generally till now wat iam doing is that iam writting different stored procedure for different tables.. Now i want to write One Insert & update procedure in my project...and for all the tables in the project i want to use only that procedure. Is it Possible? If yes kindly help me ..on resolving this issue.. Thanks & regards suman

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      You can. But it would most likely end up using dynamic SQL and you might as well just fire that against the database instead.


      Upcoming FREE developer events: * Glasgow: db4o: An Embeddable Database Engine for Object-Oriented Environments, Mock Objects, SQL Server CLR Integration, Reporting Services ... My website

      P 1 Reply Last reply
      0
      • C Colin Angus Mackay

        You can. But it would most likely end up using dynamic SQL and you might as well just fire that against the database instead.


        Upcoming FREE developer events: * Glasgow: db4o: An Embeddable Database Engine for Object-Oriented Environments, Mock Objects, SQL Server CLR Integration, Reporting Services ... My website

        P Offline
        P Offline
        praveenanand
        wrote on last edited by
        #3

        hi thanks for u reply.. can u help me in writing the query for that requirement.If u have any thing about the dynamic sql and like generic procedures ..please help me by giving some sample query.

        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