Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What's the equivalent of VFP's Scan...Endscan in SQL?
Message
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
01217180
Message ID:
01217214
Views:
28
>>>Hi, Jess,
>>>
>>>Can you be a little more specific as to what kind of data manipulation you want/need to do with your result set from the stored proc?
>>
>>First, the data manipulation will done inside the Stored Procedure. What I mean is, inside the Stored Procedure, I can do "Update From " or "Delete From" or "Insert Into...". These statements will be executed inside the loop if there is any.
>
>Jess,
>Can you write a simple VFP code that you want to translate it to T-SQL?

Boris,

Visual Foxpro
Select mytable
Scan
    cCode = mytable.code
    cSql1 = "Update mytable1 Set .... where code = '" + cCode +"'"
    cSql2 = "Delete from mytable2 where code = '" + cCode +"'"
    =SqlExec(cSql1)
    =SqlExec(cSql2)
Endscan
C#.Net
string cCode;
foreach (DataRow rw in MyTable.Rows)
{
    cCode = (string)rw["code"];
    this.ExecNonQuery("Update mytable1 Set .... where code = '"+ cCode +"'");
    this.ExecNonQuery("Delete from mytable2 where code = '"+ cCode + "'";
}
SQLServer
???? via SP
JESS S. BANAGA
Project Leader - SDD division
...shifting from VFP to C#.Net

CHARISMA simply means: "Be more concerned about making others feel good about themselves than you are in making them feel good about you."
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform