Click here to Skip to main content
15,889,216 members
Home / Discussions / Database
   

Database

 
GeneralRe: Copy data In table Pin
kibromg19-Feb-08 9:19
kibromg19-Feb-08 9:19 
GeneralRe: Copy data In table Pin
Mark J. Miller19-Feb-08 11:16
Mark J. Miller19-Feb-08 11:16 
GeneralRe: Copy data In table Pin
kibromg19-Feb-08 23:21
kibromg19-Feb-08 23:21 
GeneralRe: Copy data In table Pin
kibromg19-Feb-08 23:48
kibromg19-Feb-08 23:48 
GeneralRe: Copy data In table Pin
Mark J. Miller20-Feb-08 6:54
Mark J. Miller20-Feb-08 6:54 
GeneralAPPLICATION TO RUN EVERY FEW SECONDS Pin
kibromg21-Feb-08 5:27
kibromg21-Feb-08 5:27 
QuestionAdvice sought, how do I best handle saving an array in a SQL database? Pin
Per Sderberg19-Feb-08 5:06
Per Sderberg19-Feb-08 5:06 
GeneralRe: Advice sought, how do I best handle saving an array in a SQL database? Pin
Mark J. Miller19-Feb-08 8:26
Mark J. Miller19-Feb-08 8:26 
There are a few ways to save arrays to SQL Server, but none of them built in (that will change for SQL 2008 with table-value parameters).

It would be easier to answer your question if I knew what your target schema is. You mention separate tables and a large number of variables, so I'm picturing (based on your array declaration) that we're looking at 6 tables with 50 columns each (plus primary key??).

You can submit a delimited array to SQL Server as a varchar parameter (varchar(max) if you're using 2005) and then write a user defined function to parse it in the database (I'd recommend writing a CLR function if you're using SQL 2005 as it would be much, much faster).

Here's a link to an article I wrote on passing arrays to SQL Server. http://www.codeproject.com/KB/database/TableValuedFnsAsArrays.aspx[^]

As for parsing the delimited string the article only addresses arrays with a single dimension. You'll need to alter the code to handle multiple dimensions, but it can be done without too much trouble. Or you can submit the data as 6 separate queries (one for each of the major dimensions).

A method not mentioned in the article is sending XML instead of a delimited string, I can't imagine it would be faster than the methods in the article, but it's an alternative nonetheless. I know I've seen an article about it here on codeproject, but I don't remember which one.

Without more information it's difficult to be more specific.


GeneralRe: Advice sought, how do I best handle saving an array in a SQL database? Pin
Per Sderberg19-Feb-08 21:41
Per Sderberg19-Feb-08 21:41 
QuestionHow do I merge data into one record Pin
KreativeKai19-Feb-08 4:16
professionalKreativeKai19-Feb-08 4:16 
GeneralRe: How do I merge data into one record Pin
Mark J. Miller19-Feb-08 8:12
Mark J. Miller19-Feb-08 8:12 
Questionimages in ms-access database. Pin
avvaru.murali19-Feb-08 2:43
avvaru.murali19-Feb-08 2:43 
GeneralRe: images in ms-access database. Pin
Kschuler19-Feb-08 10:49
Kschuler19-Feb-08 10:49 
Questionembedded database Pin
avvaru.murali19-Feb-08 2:36
avvaru.murali19-Feb-08 2:36 
GeneralRe: embedded database Pin
Colin Angus Mackay19-Feb-08 4:24
Colin Angus Mackay19-Feb-08 4:24 
GeneralProblem with update statement. Pin
matjame19-Feb-08 1:59
matjame19-Feb-08 1:59 
GeneralRe: Problem with update statement. Pin
Mark J. Miller19-Feb-08 8:32
Mark J. Miller19-Feb-08 8:32 
QuestionHow to retrive the transactions back using log files Pin
Satish - Developer18-Feb-08 23:07
Satish - Developer18-Feb-08 23:07 
AnswerRe: How to retrive the transactions back using log files Pin
Mark J. Miller19-Feb-08 8:35
Mark J. Miller19-Feb-08 8:35 
QuestionCan stored procedures retrun more than one value. Pin
Satish - Developer18-Feb-08 23:03
Satish - Developer18-Feb-08 23:03 
AnswerRe: Can stored procedures retrun more than one value. Pin
J4amieC18-Feb-08 23:20
J4amieC18-Feb-08 23:20 
AnswerRe: Can stored procedures retrun more than one value. Pin
Giorgi Dalakishvili18-Feb-08 23:26
mentorGiorgi Dalakishvili18-Feb-08 23:26 
Generalquery + access database Pin
ritu432118-Feb-08 20:40
ritu432118-Feb-08 20:40 
GeneralRe: query + access database Pin
Paddy Boyd19-Feb-08 0:22
Paddy Boyd19-Feb-08 0:22 
Generalaccess database Pin
ritu432118-Feb-08 20:10
ritu432118-Feb-08 20:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.