2012年2月16日星期四

Batch SQL

QuestionsI need to batch a set of update commands. Can that be done and if so what are the possible ramfications? Can one mix / match Deletes/Inserts and Updates into a SQL command via the semi-colon in a batch set? (Is this the appropriate forum?)

WHYI am unable to use the

dynamic sql building found in the dataset due to a multiple table

contstraints. I have built classes that will extract the differences

from two datasets and report on the updates/deletes and inserts

required. Since I have multiple SQL statements, it would be nice to combine them into one statement.


Platform.Net 2C#IIS6SQL Server 2000 is the eventual target database for the generated SQL

advTHANKSance

Regarding Transact-SQL it is possible to combine multiple statement into one batch. Separate the statements with semi-colon.

If possible I would look into using stored procedures instead. It will help keeping more logic on the backend and allowing re-usal if you want to build a client for another platform.

没有评论:

发表评论