T-sql doesn't support array and you can't use table variable in sp, but you can save value of taxtboxes to temp table and let your sp get them from that temp table. In your sp, you can either build dynamic sql to get all rows for all textboxes or use cursor to get rows for each textbox.
T-sql doesn't support array and you can't use table variable in sp, but you can save value of taxtboxes to temp table and let your sp get them from that temp table. In your sp, you can either build dynamic sql to get all rows for all textboxes or use cursor to get rows for each textbox.
Thanks for your reply!
can u plz provide me with an example of it , i mean the one u have mentioned?
[If any other ideas, plz post!)
Last edited by zathrone; 08-29-2006 at 11:12 AM.
Reason: additional comment
WHILE @runner <= LEN(@person_str)
BEGIN
--add name to table variable
INSERT INTO @mynames (the_name)
VALUES (SUBSTRING(@person_str, @runner,CHARINDEX(@break_str, @person_str, @runner+1)-@runner) )
--move to next breaking string
SELECT @runner = CHARINDEX(@break_str, @person_str, @runner+1) + 1
END
SELECT my.the_name AS person_name, COUNT(tbl.person_name) AS num_of_records
FROM @mynames my
LEFT JOIN db_table tbl ON tbl.person_name = my.the_name
GROUP BY my.the_name
WHILE @runner <= LEN(@person_str)
BEGIN
--add name to table variable
INSERT INTO @mynames (the_name)
VALUES (SUBSTRING(@person_str, @runner,CHARINDEX(@break_str, @person_str, @runner+1)-@runner) )
--move to next breaking string
SELECT @runner = CHARINDEX(@break_str, @person_str, @runner+1) + 1
END
SELECT my.the_name AS person_name, COUNT(tbl.person_name) AS num_of_records
FROM @mynames my
LEFT JOIN db_table tbl ON tbl.person_name = my.the_name
GROUP BY my.the_name
Thanks a lot for ur nice effort ! I really appreciate ur reply.