See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope> is optional
| If Not Exists (Select 1 From INFORMATION_SCHEMA.ROUTINES Where SPECIFIC_SCHEMA = 'dbo' And SPECIFIC_NAME = 'fnIndexExists' And ROUTINE_TYPE = 'FUNCTION') | |
| Begin | |
| Exec(' | |
| Create Function [dbo].[fnIndexExists](@table_name nvarchar(max), @index_name nvarchar(max)) | |
| Returns bit | |
| Begin | |
| Return (Select Cast(Count(*) as Bit) From sys.indexes Where object_id = Object_Id(@table_name) AND name = @index_name); | |
| End') | |
| End |
| # ps. writing this from my head so there is probably a few errors | |
| # calculate total number of lines across the files | |
| TOTAL_LINES=`cat *.json | wc -l` | |
| # calculate what 1/4 would be (for a quad core box) | |
| let SPLIT_SIZE=$TOTAL_LINES/4 | |
| # split the original input into files of this size, can end up with 5 files due | |
| # to rounding of /4 but doesnt matter too much |