Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is wrong with this code?
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01654671
Message ID:
01654673
Views:
58
>>Hi,
>>
>>I am adding records from DBF to SQL Server.
>>
>>If I use this syntax (below) I am limited to adding only 1000 records:
>>
>>cSqlInsert = cSqlInsert + "; select SCOPE_IDENTITY() AS NEW_PK "
>>nResult = SQLEXEC(hCon, cSqlInsert,"cur_identity")	
>>
>>
>>But if I remove the part that selects the SCOPE_IDENTITY, I have not limit. Why? Below the example that works:
>>
>>*-- Commented. cSqlInsert = cSqlInsert + "; select SCOPE_IDENTITY() AS NEW_PK "
>>nResult = SQLEXEC(hCon, cSqlInsert )    && <-- removed "cur_identity"	
>>
>
>Did you try tracing with SQL Server Profiler? I see no reason for that behavior unless you had the SET ROWCOUNT somewhere in your connection that limits number of rows per operation.

I don't have the time. So I changed the code. I removed the SCOPE_IDENTITY(), add record without it. Then execute a SELECT PK_FIELD and use it. This allows me to add more than 1000 records.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform