Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create string and insert inside the SP
Message
From
30/08/2007 08:48:35
 
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
01251213
Message ID:
01251348
Views:
15
sorry, 2005.
I know I picked that when I started this thread.
>And SQL Server version?
>
>>10 records is the max in a group.
>>
>>the result table is used for reports.
>>
>>>How many records (max) can be in a group? SQL Server version? What result table is used for?
>>>
>>>>Sorry, was missing a field in the first table, that id's the groups.
>>>>
>>>>>Hi Beth,
>>>>>
>>>>>It's not clear how do you know which records to combine?
>>>>>
>>>>>>
>>>>>>Okay, In the calling vfp program, I create a huge temp table called #bptable. Then I want to call this stored procedure that gets information for several different tables, including another temp table. I take the result of that select statement, and build a string, because I use many records for the result to create one record in the temp table:
>>>>>>
>>>>>>
>>>>>>result table
>>>>>>st_id  name          place          time         rtw_id
>>>>>>  1    First         Missoula       12:01 PM       1
>>>>>>  2    Second        Billings       06:35 AM       1
>>>>>>  5    Third         Canada         08:44 AM       1
>>>>>>  8    First         Lincoln        08:00 AM       2
>>>>>>
>>>>>>
>>>>>>New Temp Table
>>>>>>newid  st_id  name     place     time     st_id1   name1      place1   time1   st_id2  name2     place2    time2
>>>>>>  1      1    First    Missoula  12:01 PM   2      Second     Billings 06:35 AM  5     Third     Canada     08:44 AM
>>>>>>  2      8    First    Lincoln    08:00 AM
>>>>>>
>>>>>>
>>>>>>
>>>>>>In vfp, I loop through the records and do an insert after each string is completely built.
>>>>>>
>>>>>>Is there a better way to do this?
>>>>>>Can this string be built in SP?
>>>>>>
>>>>>>TIA
>>>>>>Beth
Previous
Reply
Map
View

Click here to load this message in the networking platform