Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Most effective way to insert many recs to SQL Server?
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00127997
Message ID:
00128361
Views:
45
Try this. SQL Pass through

nc=SQLCONNECT("Sales","sa","")
select sales
Go Top
Scan
cSQL = "Insert INTO SALES (STORE,REGISTER,journal,cbarcode,nprice,ncost,nqty, "
+;
"nnetprice,ngrossprice,date ) " + ;
"Values ("+;
allt(str(laDB[x,2]))+ ", " + ;
allt(str(sales.register))+ ", " + ;
allt(str(Sales.Journal))+ ", " + ;
"'" + allt(sales.cbarcode) + "', " + ;
allt(str(Sales.nPrice))+ ", " + ;
allt(str(Sales.ncost))+ ", " + ;
allt(str(Sales.nqty))+ ", " + ;
allt(str(Sales.nNetPrice))+ ", " + ;
allt(str(Sales.nGrossPrice))+ ", '" + ttoc(dtot(sales.date)) +"' )"
nerror =SQLExec(nc,cSQL)
EndScan
Fred Besterwitch, MCP

The harder you work. The luckier you get.
Previous
Reply
Map
View

Click here to load this message in the networking platform