I have a function that reads thru an array that looks like the first array below in order to look for each input name on a ASP form. The question is, is there a better way than the bulky crap below to select a table with it's column names in this format.
Thanks!
-Coolhand2120
Example of desired output (array 2D comma and crlf delemeted):
ContactID,{D31CCA6F-0A2B-4
4B2-AD45-F
3B2B713AE5
2}
FirstName,Bob
LastName,Rogers
Addresss,12345 E 4th St.
etc...
Rather than (what you'd get with getrows())
{D31CCA6F-0A2B-44B2-AD45-F
3B2B713AE5
2},0
Bob,0
Rogers,0
12345 E 4th St.,0
Bulky thing I'm using now
ALTER PROCEDURE contactArray (@contactID as uniqueidentifier)
AS
select 'ContactID', (select contactID from contacts where contactID = @contactID)
union all
select 'FirstName',(select FirstName from contacts where contactID = @contactID)
union all
select 'LastName',(select LastName from contacts where contactID = @contactID)
union all
select 'Address1',(select Address1 from contacts where contactID = @contactID)
union all
select 'Address2',(select Address1 from contacts where contactID = @contactID)
union all
select 'City',(select City from contacts where contactID = @contactID)
union all
select 'State',(select State from contacts where contactID = @contactID)
union all
select 'ZIP',(select ZIP from contacts where contactID = @contactID)
union all
select 'Country',(select Country from contacts where contactID = @contactID)
union all
select 'HomePhone',(select HomePhone from contacts where contactID = @contactID)
union all
select 'WorkPhone',(select WorkPhone from contacts where contactID = @contactID)
union all
select 'Email',(select Email from contacts where contactID = @contactID)
union all
select 'SpecialInstructions',(sel
ect SpecialInstructions from contacts where contactID = @contactID)
union all
select 'Comments',(select Comments from contacts where contactID = @contactID)
Start Free Trial