Script runtime execution time limit

One thing you could do (this of course depends on what you are trying to accomplish) is: Store the necessary information (i.e. like a loop counter) in a spreadsheet or another permanent store(i.e. ScriptProperties). Have your script terminate every five minutes or so. Set up a time driven trigger to run the script every five … Read more

Run all SQL files in a directory

Create a .BAT file with the following command: for %%G in (*.sql) do sqlcmd /S servername /d databaseName -E -i”%%G” pause If you need to provide username and passsword for %%G in (*.sql) do sqlcmd /S servername /d databaseName -U username -P password -i”%%G” Note that the “-E” is not needed when user/password is provided … Read more

Batch update/delete EF5

There are two open source projects allowing this: EntityFramework.Extended and Entity Framework Extensions. You can also check discussion about bulk updates on EF’s codeplex site. Inserting 100k records through EF is in the first place wrong application architecture. You should choose different lightweight technology for data imports. Even EF’s internal operation with such big record … Read more

tech