473,395 Members | 1,738 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.

large arrays, UDFs and the text datatype

I have a bunch of SPs that all rely on a UDF that parses a comma
delimitted list of numbers into a table. Everything was working fine,
but now my application is growing and I'm starting to approach the 8000
character limit of the varChar variable used to store the list.

I would like to change the UDF only and avoid having to dig through all
of my stored procedures. I was hoping to use the text datatype to
allow for much larger lists, but I am unable to perform any
manipulations necessary to parse the list into a table. I have tried
PATINDEX, but it alone is not enough without the text maniuplations and
I don't think the sp_xml_preparedocument can be used in a UDF.

Anyone with any thoughts on managing large arrays in t-sql?
thanks,

Matt Weiner

Jul 23 '05 #1
2 1404
Check out Erland's article at http://www.sommarskog.se/arrays-in-sql.html.

--
Hope this helps.

Dan Guzman
SQL Server MVP

<ma************@med.nyu.edu> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
I have a bunch of SPs that all rely on a UDF that parses a comma
delimitted list of numbers into a table. Everything was working fine,
but now my application is growing and I'm starting to approach the 8000
character limit of the varChar variable used to store the list.

I would like to change the UDF only and avoid having to dig through all
of my stored procedures. I was hoping to use the text datatype to
allow for much larger lists, but I am unable to perform any
manipulations necessary to parse the list into a table. I have tried
PATINDEX, but it alone is not enough without the text maniuplations and
I don't think the sp_xml_preparedocument can be used in a UDF.

Anyone with any thoughts on managing large arrays in t-sql?
thanks,

Matt Weiner

Jul 23 '05 #2
[posted and mailed, please reply in news]

(ma************@med.nyu.edu) writes:
I have a bunch of SPs that all rely on a UDF that parses a comma
delimitted list of numbers into a table. Everything was working fine,
but now my application is growing and I'm starting to approach the 8000
character limit of the varChar variable used to store the list.

I would like to change the UDF only and avoid having to dig through all
of my stored procedures. I was hoping to use the text datatype to
allow for much larger lists, but I am unable to perform any
manipulations necessary to parse the list into a table. I have tried
PATINDEX, but it alone is not enough without the text maniuplations and
I don't think the sp_xml_preparedocument can be used in a UDF.

Anyone with any thoughts on managing large arrays in t-sql?
thanks,


Dan gave you an pointer to my article, but since it's quite long here is a
direct link to an example on how to this:
http://www.sommarskog.se/arrays-in-s...st-of-integers
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #3

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

Similar topics

4
by: Zion Zadik | last post by:
Dear all, I have a set of c# data classes which i need to fill their data from xml files. serialization looks to be the best way to accomplish this task. Since the data classes are compiled and...
7
by: Rhino | last post by:
I am updating some Java UDFs from DB2GENERAL to DB2JAVA as suggested in the manuals for DB2 Version 8 but I'm having problems with setSQLstate() and setSQLmessage(). If I'm reading the manuals...
3
by: Rhino | last post by:
I am trying to figure out if a UDF can accept a UDT (User-defined Distinct Type, *not* structured type) as one of its parameters. I'm running DB2 for Linux, Unix, and Windows V8.2 (FP 8) on Windows...
7
by: mef526 | last post by:
I have had this problem for months now and it has been nagging me. I have a large project that has several C++ DLL's, one of them uses malloc / calloc / free for the other DLL's. I process very...
5
by: Louis LeBlanc | last post by:
Hey folks. I'm new to the list, and not quite what you'd call a DB Guru, so please be patient with me. I'm afraid the lead up here is a bit verbose . . . I am working on an application that...
12
by: divya | last post by:
1. If The size of the array is unknown during programming time then how is such array declared?? Suppose there is an Array named arrClashname(size unknown at start), Now when the clash occurs...
4
by: bcomeara | last post by:
I am writing a program which needs to include a large amount of data. Basically, the data are p values for different possible outcomes from trials with different number of observations (the p...
6
by: Carsten | last post by:
Hello Folks, I encountered a problem with SQL server 2000 and UDFs. I have a scalar UDF and a table UDF where I would like the scalar UDF to provide the argument for the table UDF like in: ...
0
by: JamesOo | last post by:
I have the code below, but I need to make it searchable in query table, below code only allowed seach the table which in show mdb only. (i.e. have 3 table, but only can search either one only,...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
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.