473,670 Members | 2,228 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CREATE TABLE using Xml Schema

I want to dynamically create tables in a SQL Server 2000 database that
are modelled after XML schemas. I will not know what the schemas
might look like until the documents arrive.

For example, I'd like to convert this schema:

<xs:schema
elementFormDefa ult="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema"

<xs:element name="OrgLevel" >
<xs:complexType >
<xs:sequence>
<xs:element name="code" type="integer" />
<xs:element name="desc" type="string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

into this SQL command:

CREATE TABLE OrgLevel (code Int, desc varchar)

The problem is, when I walk the schema and read the name and type of
those elements, I get the correct names ("code", "desc"), but
messed-up XML-ized datatypes, like System.Xml.Sche ma.Datatype_int and
System.Xml.Sche ma.Datatype_str ing. How can I best determine the
equivalent SQL Server datatypes so I can build the commands to create
these tables effectively?
Nov 11 '05 #1
1 9169
You might want to check out XmlSpy 2005. It contains the ability to
create database tables for several dbms'es. However I only think it's
an option in the Enterprise edition but you can download a 30 days
trial.

Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4053
by: Phil Powell | last post by:
create table if not exists nnet_produkt_varegruppe ( nnet_produkt_varegruppe_id int not null auto_increment, primary key(nnet_produkt_varegruppe_id), nnet_produkt_varegruppe_navn varchar(255) not null ); create table if not exists nnet_produkt_farge ( nnet_produkt_farge_id int not null auto_increment, primary key(nnet_produkt_farge_id),
2
6190
by: Andreas Bergmeier | last post by:
Hi - I searched quite a bit now but still it seems that one topic was never brought up on oracles xml handling (9i btw). Could anybody tell me how it is possible to create a table out of a xml schema (I don't care about the format the xml must have - the important thing is it being xml)? I can add data to the table using xml, get the schema out in xml and so on but there seems no topic that handles automatic table creation using a xml...
0
2809
by: Guy Deprez | last post by:
Hi, i'm having a problem to create indexes. STEP 1 ----------- Connection is OK (you can find the string at the end of the message) Table ("Couleurs") creation is OK STEP 2. Index Creation
2
22604
by: masri999 | last post by:
I have a requirement in SQL 2005 in Development database 1. Schema dbo owns all objects (tables,views,SPs,UDFs etc) . 2. Only DBA's ( who are database owners ) can create, alter tables . Developer's should not create or alter tables . 3. Developers can create/alter Stored Procedure/User Defined functions in dbo schema and can execute SP/UDF. 4. Developers should have SELECT,INSERT,DELETE,UPDATE on tables ( tables in dbo schema
1
1194
by: donet programmer | last post by:
I have a requirement where I need to create a dataset that consists of a table inside a table ( a child table inside a parent table). I am not really familiar with the data relations and not sure how to represent this relation. I did create a schema and it looks good on paper, but when I create a dataset from this schema it does not allow me to write to the child table. I am elaborate more if required. This is what my schema looks...
2
10826
by: Amber | last post by:
On my DB2 UDB 8.2.7 database user User1 has been granted IMPLICIT_SCHEMA privilege, but when he issues "create schema test", the error message "SQL0552N, USER1 does not have the previliege to execute the operation create schema" was thrown. But if he issues "create table test.test(a int)", the operation can execute successfully. So how can I let users issue the create schema statement.
3
6669
by: Rahul B | last post by:
Hi, I have a user UCLDEV1 which is a part of staff and a group(db2schemagrp1) to which i have not given any permissions. The authorizations of that user are shown as db2 =get authorizations Administrative Authorizations for Current User
1
4092
by: gdev | last post by:
Having some trouble getting my head around setting access to specific schemas- here's my problem: I've created a specific schema that I only want certain users to control Problem: Even though I give them full access....the cannot create tables under that schema...my code is below (flyer is the schema, eflyerAdmin is the role, and eflyer is the user):
0
8978
debasisdas
by: debasisdas | last post by:
The following script is used to create a read only schema of any existing schema in the same database. The readonly schema is granted only read permisions on the tables and views of the existing schema. No previliges on any other objects. The script can be customized as per requirment. CREATE OR REPLACE PROCEDURE CREATE_READONLY_SCHEMA ( i_owner IN VARCHAR2, i_readonly IN VARCHAR2 ) IS CURSOR cur_c1
0
8469
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8386
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8814
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8661
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7419
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6213
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5684
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4391
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2800
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.