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. Retrieve table structure with OPENXML

Retrieve table structure with OPENXML

Scheduled Pinned Locked Moved Database
sharepointxmlhelp
1 Posts 1 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.
  • T Offline
    T Offline
    Tridip Bhattacharjee
    wrote on last edited by
    #1

    when we use OPENXML then we have to mention table structure like below one. DECLARE @xml_text VARCHAR(4000), @i INT /* put xml structure here */ EXEC sp_xml_preparedocument @i OUTPUT, @xml_text SELECT au_id AS author_id, au_lname AS last_name, au_fname AS first_name, a.title_id, title, royaltyper AS royalty FROM OPENXML(@i, '/root/authors/titles', 1) WITH ( au_id VARCHAR(11), au_lname VARCHAR(20) '../@au_lname', au_fname VARCHAR(30) '../@au_fname', title_id VARCHAR(15), royaltyper INT) a INNER JOIN titles b ON a.title_id = b.title_id WITH ( au_id VARCHAR(11), au_lname VARCHAR(20) '../@au_lname', au_fname VARCHAR(30) '../@au_fname', title_id VARCHAR(15), royaltyper INT ) suppose if i dont want to mention the table structure manually or hard coded rather dynamically fetch table structure,datatype and length then how could i proceed. please help me with sample code. thanks in advance

    tbhattacharjee

    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