473,395 Members | 2,446 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

xml into mssql 2000

AJA
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

Mar 22 '07 #1
4 4983
Tom
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" <aj*********@gazeta.plwrote in message
news:et**********@inews.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

Mar 25 '07 #2
AJA
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" <aj*********@gazeta.plwrote in message
news:et**********@inews.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

Mar 26 '07 #3
Tom
http://www.quicksqlserver.com/2007/0...l_more_th.html

--

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

"AJA" <aj*********@gazeta.plwrote in message
news:eu**********@inews.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" <aj*********@gazeta.plwrote in message
news:et**********@inews.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


Mar 26 '07 #4
AJA
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
>
--

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

"AJA" <aj*********@gazeta.plwrote in message
news:eu**********@inews.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" <aj*********@gazeta.plwrote in message
news:et**********@inews.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


Mar 28 '07 #5

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

Similar topics

7
by: mj | last post by:
Hello, thanks for the help. I am running a WinXP Pro w/ SP2 (my home computer, with ZoneAlarm firewall) Apache 2.0.52 MySQL 4.1.7 PHP 5.1.0-dev I have developed a PHP/MySQL web app that...
1
by: sumGirl | last post by:
Hi all. We have a mix of informix and mssql server and I want to know if something we do in informix has an analogous feature in MSSQL. We can define a "row type" in informix, like so: create...
8
by: Yusuf INCEKARA | last post by:
I have a stored procedure : CREATE PROCEDURE STP_GETSTORELIST @RETCUR CURSOR VARYING OUTPUT AS set @RETCUR = CURSOR FORWARD_ONLY STATIC FOR SELECT ID,STORE_NAME FROM T_INF_STORE ORDER BY...
3
by: gharmel | last post by:
I'm trying to get some clues on why I get (much) slower responses from my PHP applications when dealing with a remote sql server as opposed to a local sql server. Here's my situation: Server...
16
by: davemateer | last post by:
Hi We have a current system: Linux / Apache / PHP4.x talking to Microsoft SQL 2000 Thinking about going to: Windows 2003 / PHP4.x talking to the same Microsoft SQL 2000 box...
8
by: php-taz | last post by:
I built a PHP website on Windows 2000 (using IIS) that connects to a SQL Server 2000 database using the mssql functions. I migrated the website and the database onto a Windows 2003 machine, and...
1
by: brosner | last post by:
I installed MSSQL 2000 on my desktop (running NT 2000). No problem. I created an adp and attached it to a database within MSSQL 2000, no problem. When I go into MS Access, on another PC (running...
0
by: Derftics | last post by:
Hi Guys, Is there anyone who have tried installing MSSQL 2000 and MSSQL 2005 servers in one desktop computer? I have tried using MSDE and successfully install the MSSQL 2000 server but when I...
4
by: ThePhenix | last post by:
Hi everybody, I have recently been doing a conversion for my boss for a access 2000 database (both front and backend) to a MSSQL backend. I finished the conversion today (as quite a lot of the...
0
by: ruchika mahajan | last post by:
Hi all...MSSQL serevr 2000 Trace Event Column ObjectType gives value 17 for object table for events Object:Created and Object:deleted.Can anyone tell me all the possible values for MSSQL 2000 Trace...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...

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.