Showing posts with label amount. Show all posts
Showing posts with label amount. Show all posts

Monday, March 12, 2012

How to return large amount of data in the XML format

I have SQL 2000 and need to retrieve fairly large amout of data (~
50.000 characters) in XML format and then insert it into the field of
the text type.
As 'FOR XML' can't be used with either local variables, INSERT INTO or
SELECT INTO this makes "XML support" quite useless in many aspects.

Can anyone please help me in solving this.
Thanks a lot for your help and time.

PavelPavel (p.golobokov@.ausbulk.com.au) writes:
> I have SQL 2000 and need to retrieve fairly large amout of data (~
> 50.000 characters) in XML format and then insert it into the field of
> the text type.
> As 'FOR XML' can't be used with either local variables, INSERT INTO or
> SELECT INTO this makes "XML support" quite useless in many aspects.

You can try:

INSERT tbl (xmlcol)
SELECT * FROM OPENQUERY(LOCALSVR, 'SELECT ... FOR XML')

Where LOCALSVR has been created as

EXEC sp_addlinkedserver
@.server = 'LOCALVR',
@.srvproduct = '',
@.provider = 'MSDASQL',
@.datasrc = 'LocalServer'

That is, you use the deprecated OLE DB over ODBC provider. This works
so far that you get XML back. However, you may find that the text
has been broken into many rows. (If you would use SQLOLEDB, the real
SQL Server provider, you get a blob back.)

If this does not work out, you will have a find a client to pick up the
XML and send it back.

In SQL 2005, the XML support is considerably enhanced, and you should
be able to do this without weird workarounds.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Friday, February 24, 2012

How to retrieve data between two dates

For e.g
I want the amount of a customer between 2nd March 2004 and 2nd October
2004.
Basically How to filter this as i cannot put it in a where clause.i.e
customer name in rows amount in columns.
Is this in SQL Server or AS?
If the former, please post DDL, sample data, and sample output.
http://www.aspfaq.com/etiquette.asp?id=5006
If the latter, I will let someone else handle this question
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
"Amit Asawa" <amit.asawa@.capgemini.com> wrote in message
news:814276fc.0412022212.7d57e2da@.posting.google.c om...
> For e.g
>
> I want the amount of a customer between 2nd March 2004 and 2nd October
> 2004.
> Basically How to filter this as i cannot put it in a where clause.i.e
> customer name in rows amount in columns.
|||If u have got solution to this problem can u please forward it to me at mailketna@.yahoo.com.
I have same problem in asp.net in crystal reports.
Thankyou
************************************************** ********************
Sent via Fuzzy Software @. http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
|||Can you post DDL, sample data, and sample output? I'll help you out, but
not via e-mail. Let's keep this public so that others can benefit from the
discussion as well.
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
"jalpa patel" <mailketna@.yahoo.com> wrote in message
news:u%23l$ihn4EHA.3388@.TK2MSFTNGP15.phx.gbl...
> If u have got solution to this problem can u please forward it to me at
mailketna@.yahoo.com.
> I have same problem in asp.net in crystal reports.
> Thankyou
> ************************************************** ********************
> Sent via Fuzzy Software @. http://www.fuzzysoftware.com/
> Comprehensive, categorised, searchable collection of links to ASP &
ASP.NET resources...

How to retrieve data between two dates

For e.g
I want the amount of a customer between 2nd March 2004 and 2nd October
2004.
Basically How to filter this as i cannot put it in a where clause.i.e
customer name in rows amount in columns.Is this in SQL Server or AS?
If the former, please post DDL, sample data, and sample output.
http://www.aspfaq.com/etiquette.asp?id=5006
If the latter, I will let someone else handle this question
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--
"Amit Asawa" <amit.asawa@.capgemini.com> wrote in message
news:814276fc.0412022212.7d57e2da@.posting.google.com...
> For e.g
>
> I want the amount of a customer between 2nd March 2004 and 2nd October
> 2004.
> Basically How to filter this as i cannot put it in a where clause.i.e
> customer name in rows amount in columns.|||If u have got solution to this problem can u please forward it to me at mail
ketna@.yahoo.com.
I have same problem in asp.net in crystal reports.
Thankyou
****************************************
******************************
Sent via Fuzzy Software @. http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET
resources...|||Can you post DDL, sample data, and sample output? I'll help you out, but
not via e-mail. Let's keep this public so that others can benefit from the
discussion as well.
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--
"jalpa patel" <mailketna@.yahoo.com> wrote in message
news:u%23l$ihn4EHA.3388@.TK2MSFTNGP15.phx.gbl...
> If u have got solution to this problem can u please forward it to me at
mailketna@.yahoo.com.
> I have same problem in asp.net in crystal reports.
> Thankyou
> ****************************************
******************************
> Sent via Fuzzy Software @. http://www.fuzzysoftware.com/
> Comprehensive, categorised, searchable collection of links to ASP &
ASP.NET resources...