Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Return into Array
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01329359
Message ID:
01329367
Views:
21
This message has been marked as the solution to the initial question of the thread.
>Hi All!!
>
>In Vfp we can return to Array using SQL statement. Can some body let me know how I can do the same in SQL Server. I have a list that I need to display into a Textbox and the Designer did not let me present the list in the detail band of the report so the next control that allow me to show a list is the textbox in the header band. But then I need to find the way to return 1 record that have the 5 or 10 name of the list.

No, you can't return an array. But if this is only display and you want a list like:'name1, name2, name3 ...'
You could use variable and the return a recordset with that variable:
DECLARE @StrList varchar(8000)
SELECT @StrList = ISNULL(@StrList+',' ,'')+Name FROM YourTable
SELECT @StrList
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform