This is Part 4 of my series on converting a VBA function to a SQL Server scalar function using test driven development. As a proof of concept, I will be re-implementing the VBA Round function (which uses bankers rounding) as a SQL Server scalar function.
- Execute the test table population query
- Press Ctrl + A to select all the rows in the query
- Press Ctrl + C to copy the rows to the clipboard
- Create a New Query window in your development database in SSMS
- Press Ctrl + V to paste the rows from the clipboard (delete or comment out the header row)
- Press F5 to execute the T-SQL statements