dbTalk Databases Forums  

xml into mssql 2000

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss xml into mssql 2000 in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AJA
 
Posts: n/a

Default xml into mssql 2000 - 03-22-2007 , 02:26 AM






Hello
I watchet some posts but did not find answer to my question : how to
import data from xml into mssql 2000 using t-sql?

i tried:

USE Northwind
if(object_id('dbo.test_xml') is not null)
drop table dbo.test_xml
go
create table dbo.test_xml (Id int identity(1,1), col1 text)
go
insert into test_xml(col1) values('')
go
declare @cmd varchar(512)
set @cmd = 'D:\Progra~1\Micros~3\MSSQL\Binn\TextCopy.exe /S /U
[user] /P [password] /D Northwind /F c:\pobierz.xml /T
test_xml /C col1 /I /W "where Id = 1"'
exec master..xp_cmdshell @cmd, 'no_output'
go
declare
@hdoc int
, @doc varchar(1000)
select @doc = col1 from dbo.test_xml
exec sp_xml_preparedocument @hdoc out, @doc
select @hdoc as hdoc
-- ...
select * from openxml(@hdoc, ...

--...
exec sp_xml_removedocument @hdoc

But my documet have more than 1000characters and more than max varchar. So
how to do that?


Best regards
AJA


Reply With Quote
  #2  
Old   
Tom
 
Posts: n/a

Default Re: xml into mssql 2000 - 03-25-2007 , 01:02 PM






You should be able to do up to 8000 characters, reset where you have 1000
and replace it with 8000.
If you have a requirement for more than 8000 , reply and I'll send you a
stored procedure that handles this problem

--

Jack Vamvas
___________________________________
Advertise your IT vacancies for free at - http://www.ITjobfeed.com



"AJA" <ajanospam74 (AT) gazeta (DOT) pl> wrote

Quote:
Hello
I watchet some posts but did not find answer to my question : how to
import data from xml into mssql 2000 using t-sql?

i tried:

USE Northwind
if(object_id('dbo.test_xml') is not null)
drop table dbo.test_xml
go
create table dbo.test_xml (Id int identity(1,1), col1 text)
go
insert into test_xml(col1) values('')
go
declare @cmd varchar(512)
set @cmd = 'D:\Progra~1\Micros~3\MSSQL\Binn\TextCopy.exe /S /U
[user] /P [password] /D Northwind /F c:\pobierz.xml /T
test_xml /C col1 /I /W "where Id = 1"'
exec master..xp_cmdshell @cmd, 'no_output'
go
declare
@hdoc int
, @doc varchar(1000)
select @doc = col1 from dbo.test_xml
exec sp_xml_preparedocument @hdoc out, @doc
select @hdoc as hdoc
-- ...
select * from openxml(@hdoc, ...

--...
exec sp_xml_removedocument @hdoc

But my documet have more than 1000characters and more than max varchar. So
how to do that?


Best regards
AJA



Reply With Quote
  #3  
Old   
AJA
 
Posts: n/a

Default Re: xml into mssql 2000 - 03-26-2007 , 03:47 AM



Quote:
You should be able to do up to 8000 characters, reset where you have 1000
and replace it with 8000.
If you have a requirement for more than 8000 , reply and I'll send you a
stored procedure that handles this problem
It will be about 20MB XML file. So more than 8000 characters. Thank you for
reply and I'm waiting for procedure.

Best Regards
AJA

Quote:
--

Jack Vamvas
___________________________________
Advertise your IT vacancies for free at - http://www.ITjobfeed.com



"AJA" <ajanospam74 (AT) gazeta (DOT) pl> wrote in message
news:ettb3e$9lj$1 (AT) inews (DOT) gazeta.pl...
Hello
I watchet some posts but did not find answer to my question : how to
import data from xml into mssql 2000 using t-sql?

i tried:

USE Northwind
if(object_id('dbo.test_xml') is not null)
drop table dbo.test_xml
go
create table dbo.test_xml (Id int identity(1,1), col1 text)
go
insert into test_xml(col1) values('')
go
declare @cmd varchar(512)
set @cmd = 'D:\Progra~1\Micros~3\MSSQL\Binn\TextCopy.exe /S /U
[user] /P [password] /D Northwind /F c:\pobierz.xml /T
test_xml /C col1 /I /W "where Id = 1"'
exec master..xp_cmdshell @cmd, 'no_output'
go
declare
@hdoc int
, @doc varchar(1000)
select @doc = col1 from dbo.test_xml
exec sp_xml_preparedocument @hdoc out, @doc
select @hdoc as hdoc
-- ...
select * from openxml(@hdoc, ...

--...
exec sp_xml_removedocument @hdoc

But my documet have more than 1000characters and more than max varchar.
So how to do that?


Best regards
AJA




Reply With Quote
  #4  
Old   
Tom
 
Posts: n/a

Default Re: xml into mssql 2000 - 03-26-2007 , 08:36 AM



http://www.quicksqlserver.com/2007/0...l_more_th.html

--

Jack Vamvas
___________________________________
Advertise your IT vacancies for free at - http://www.ITjobfeed.com



"AJA" <ajanospam74 (AT) gazeta (DOT) pl> wrote

Quote:
You should be able to do up to 8000 characters, reset where you have 1000
and replace it with 8000.
If you have a requirement for more than 8000 , reply and I'll send you a
stored procedure that handles this problem

It will be about 20MB XML file. So more than 8000 characters. Thank you
for reply and I'm waiting for procedure.

Best Regards
AJA


--

Jack Vamvas
___________________________________
Advertise your IT vacancies for free at - http://www.ITjobfeed.com



"AJA" <ajanospam74 (AT) gazeta (DOT) pl> wrote in message
news:ettb3e$9lj$1 (AT) inews (DOT) gazeta.pl...
Hello
I watchet some posts but did not find answer to my question : how
to import data from xml into mssql 2000 using t-sql?

i tried:

USE Northwind
if(object_id('dbo.test_xml') is not null)
drop table dbo.test_xml
go
create table dbo.test_xml (Id int identity(1,1), col1 text)
go
insert into test_xml(col1) values('')
go
declare @cmd varchar(512)
set @cmd = 'D:\Progra~1\Micros~3\MSSQL\Binn\TextCopy.exe /S /U
[user] /P [password] /D Northwind /F c:\pobierz.xml /T
test_xml /C col1 /I /W "where Id = 1"'
exec master..xp_cmdshell @cmd, 'no_output'
go
declare
@hdoc int
, @doc varchar(1000)
select @doc = col1 from dbo.test_xml
exec sp_xml_preparedocument @hdoc out, @doc
select @hdoc as hdoc
-- ...
select * from openxml(@hdoc, ...

--...
exec sp_xml_removedocument @hdoc

But my documet have more than 1000characters and more than max varchar.
So how to do that?


Best regards
AJA






Reply With Quote
  #5  
Old   
AJA
 
Posts: n/a

Default Re: xml into mssql 2000 - 03-28-2007 , 07:35 AM



Quote:
http://www.quicksqlserver.com/2007/0...l_more_th.html
It workink on small XML file but i have XML file largest than 10MB so there
must be declarations of about 5000 variables?
Have you any other idea??
I made new thread and sample sql which create dinamicly variables but the
same problem statement must have 8000- characters but for that file
must have much more (


Best Regards
AJA

Quote:
--

Jack Vamvas
___________________________________
Advertise your IT vacancies for free at - http://www.ITjobfeed.com



"AJA" <ajanospam74 (AT) gazeta (DOT) pl> wrote in message
news:eu7tql$dff$1 (AT) inews (DOT) gazeta.pl...
You should be able to do up to 8000 characters, reset where you have
1000 and replace it with 8000.
If you have a requirement for more than 8000 , reply and I'll send you a
stored procedure that handles this problem

It will be about 20MB XML file. So more than 8000 characters. Thank you
for reply and I'm waiting for procedure.

Best Regards
AJA


--

Jack Vamvas
___________________________________
Advertise your IT vacancies for free at - http://www.ITjobfeed.com



"AJA" <ajanospam74 (AT) gazeta (DOT) pl> wrote in message
news:ettb3e$9lj$1 (AT) inews (DOT) gazeta.pl...
Hello
I watchet some posts but did not find answer to my question : how
to import data from xml into mssql 2000 using t-sql?

i tried:

USE Northwind
if(object_id('dbo.test_xml') is not null)
drop table dbo.test_xml
go
create table dbo.test_xml (Id int identity(1,1), col1 text)
go
insert into test_xml(col1) values('')
go
declare @cmd varchar(512)
set @cmd = 'D:\Progra~1\Micros~3\MSSQL\Binn\TextCopy.exe /S /U
[user] /P [password] /D Northwind /F c:\pobierz.xml /T
test_xml /C col1 /I /W "where Id = 1"'
exec master..xp_cmdshell @cmd, 'no_output'
go
declare
@hdoc int
, @doc varchar(1000)
select @doc = col1 from dbo.test_xml
exec sp_xml_preparedocument @hdoc out, @doc
select @hdoc as hdoc
-- ...
select * from openxml(@hdoc, ...

--...
exec sp_xml_removedocument @hdoc

But my documet have more than 1000characters and more than max varchar.
So how to do that?


Best regards
AJA







Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.