VBA to T-SQL via TDD: Step 4
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.
After building a "test table population query" in Step 2 and creating the test table structure itself in Step 3, populating the SQL Server test table is a simple matter of copy and paste.
- 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