[AccessD] SQL Server - Turn field list into string

John W Colby jwcolby at gmail.com
Wed Mar 18 09:10:13 CDT 2009


Right you are. 

So I created a table to hold the field names, populated that table, and 
then use that table to create cursors in the three different stored 
procedures where I need to generate dynamic sql with the field names.

John W. Colby
www.ColbyConsulting.com



Arthur Fuller wrote:
> I don't believe you can do this, JC.
>
> A.
>
> On Wed, Mar 18, 2009 at 7:50 AM, John W Colby <jwcolby at gmail.com> wrote:
>
>   
>> I have learned how to do this with a cursor, however now I need to learn
>> to pass cursors.
>>
>> I perform this action the first time when I take the difference in
>> fields between a base data table and a view with criteria.  I want to
>> get the criteria fields, whatever they might be, and append them to the
>> tblOrderData.  However... I then go on to do some processing, and then
>> later need that same list of tables.  The problem is that by then the
>> base tblOrderData has the fields added to it so there no longer is a
>> difference in fields between tblOrderData and vOrderCriteria, so I can
>> no longer get that difference.  For this reason I need to get the cursor
>> in the first step, then hold it open and pass it off to other stored
>> procedures later on.
>>
>> I have never looked at passing a cursor to a stored procedure.  Is a
>> cursor a data type that I can just pass in and out of a stored procedure?
>>
>>
>>     



More information about the AccessD mailing list