My table consists of multiple phone number columns and I want to select multiple columns (say phone numbers) into an array for my store procedure. I am trying to use SELECT
but it returns only one value as shown in the sample code
DECLARE @phone VARCHAR(15)
SELECT @phone = phone1 FROM AddressTable
PRINT @phone
Now I want get the values of more than one column value into one variable. I know for this purpose we normally use arrays. But I am not sure how to use. Any Help...!!!
1 Answer 1
SQL doesn't support arrays. You can use something like a table variable or a comma delimited string
Explore related questions
See similar questions with these tags.
SELECT @phone = phone1 + ', ' + phone2 ...