Typically when workflow rules are setup they are individual updates or inserts for a single account. They can be run in bulk when made available for a specific saved search. When run in bulk it would run the single SQL statement for each row in selected in the saved search results. This can take a while if there are alot of items and sometimes if the logic is to create a log for all items or a note for all items the SQL can be simplified.
Here is an example of simple workflow rule that will insert a specific account note. If run in bulk it will insert all at once instead of looping through each item.
The user should have prior knowledge of SQL language and understand the structure of the existing database before attempting to construct a SQL statement.
Example SQL Select:
select {ClientCredID}
Example SQL Update:
INSERT INTO IssueNotes(CreatedUserID, NoteDate, Notes, NoteType, ClientID, ClientCredID)
SELECT '{UserID}', GETDATE(), 'Test bulk insert for list ', 'QuickNote', cc.ClientID, cc.ClientCredID
FROM dbo.IDListToTable({SavedSearch_RecordIDs}
) t
INNER JOIN clientcred cc ON t.ListID = cc.ClientCredID
Note the use of the bookmark {SavedSearch_RecordIDs}. That will be replaced with the list of ClientCredIDs from the selected rows on in the saved search. Example 100,101, 102. We use the function IDListToTable to turn that string of IDs into a table of IDs that we can join to ClientCred.