Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Storing XML file in a table

Author  Topic 

nitin1353
Constraint Violating Yak Guru

381 Posts

Posted - 2006-06-28 : 14:59:12
Gurus
How can i store a XML file in a column in a table?
Regards
Nitin

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2006-06-28 : 15:27:53
By using SQL Server 2005 and the XML datatype?
Go to Top of Page

nitin1353
Constraint Violating Yak Guru

381 Posts

Posted - 2006-06-28 : 15:40:29
using sql 2000
Regards
Nitin
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-06-28 : 16:05:36
"using sql 2000"

Would you like to elaborate on that nitin1353?

Kristen
Go to Top of Page

nitin1353
Constraint Violating Yak Guru

381 Posts

Posted - 2006-06-28 : 16:07:48
I guess blindman was askin me are you workin in sql 2005 so i said sql 2000
Regards
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-06-28 : 16:17:49
Humble apologies, I thought you were providing an answer to the original poster - but I now see that YOU are the original poster!

If your XML files are significantly more than 8K in size then you might like to consider storing them in the File System, with a path to the file stored in the database.

If they are guaranteed to be less than 8,000 bytes then use a VARCHAR(8000) and store them in the database.

Either way, if the XML files are served by, say, an Internet Service, then consider files if the Internet Service, and more particularly downstream-proxy servers, will cache the files.

If the files sit between 8,000 and "significantly more than 8,000 bytes" filesize then you need to test the relative performance of the solutions you are considering.

Kristen
Go to Top of Page

nitin1353
Constraint Violating Yak Guru

381 Posts

Posted - 2006-06-28 : 16:39:07
Hi Kirsten
Agreed,but how do i store the file in my table
regards
Nitin
Go to Top of Page

rockmoose
SQL Natt Alfen

3279 Posts

Posted - 2006-06-28 : 17:34:05
It takes too much energy to get xml to actually work, don't bother with it.

rockmoose
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-06-30 : 01:47:47
"how do i store the file in my table"

Using INSERT?

I've gotta be missing something on this one!!

Kristen
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-06-30 : 01:48:24
"It takes too much energy to get xml to actually work, don't bother with it"

I'm a big fan of XML, but boy are you right about the "energy" ...
Go to Top of Page

rockmoose
SQL Natt Alfen

3279 Posts

Posted - 2006-06-30 : 04:25:44
"I'm a big fan of XML"
I know this other person too, I can give him your mail if you want
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-06-30 : 04:37:55
Can't you send me the URL for his Schema instead, then I can check we are compatible
Go to Top of Page

rockmoose
SQL Natt Alfen

3279 Posts

Posted - 2006-06-30 : 05:11:27
"Can't you send me the URL for his Schema instead, then I can check we are compatible"
Funny she has the same name as you too!
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-07-01 : 05:39:45
Don't bother with the schema, I can see we are birds of a feather!

Kristen
Go to Top of Page

rockmoose
SQL Natt Alfen

3279 Posts

Posted - 2006-07-01 : 15:36:30
Is this thread still on topic?
- Guess so, the word file, schema or xml figures in every post!

Hope it works out for you guys (K&K)


rockmoose
Go to Top of Page

manohar
Starting Member

6 Posts

Posted - 2006-07-03 : 07:27:37
Try this

CREATE TABLE T (XmlColumn xml NOT NULL)

insert into T select * from openrowset(bulk 'D:\databasexmlfiles\oracle_schema.xml',single_clob) as XmlColumn
Go to Top of Page

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2006-07-03 : 10:33:44
quote:
Originally posted by manohar

Try this

CREATE TABLE T (XmlColumn xml NOT NULL)

insert into T select * from openrowset(bulk 'D:\databasexmlfiles\oracle_schema.xml',single_clob) as XmlColumn

I already suggested 2005, but the poster nixed it.
Go to Top of Page

Meno
Starting Member

2 Posts

Posted - 2007-03-09 : 08:27:41
hi.. i tried the code posted by manhour in sql server 2000 but it doesn't work.. any another idea plz

If you have built castles in the air, your work need not be lost; that is where they should be.
Now put foundations under them.
Henry David Thoreau
Go to Top of Page
   

- Advertisement -