VBA to T-SQL via TDD: Step 4
Step 4. Use the results of your Access query to populate the test table
![VBA to T-SQL via TDD: Step 4](/content/images/size/w2000/2021/09/Step4-1.png)
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
![](https://nolongerset.com/content/images/2021/09/image-35.png)
![](https://nolongerset.com/content/images/2021/09/image-36.png)
![](https://nolongerset.com/content/images/2021/09/image-37.png)
![](https://nolongerset.com/content/images/2021/09/image-38.png)
![](https://nolongerset.com/content/images/2021/09/image-39.png)
Referenced articles
![](https://nolongerset.com/content/images/2021/09/caterpillars-2869783_1920.jpg)
![](https://nolongerset.com/content/images/2021/09/president-67550_1920.jpg)
![](https://nolongerset.com/content/images/2021/09/Step2-1.png)
![](https://nolongerset.com/content/images/2021/09/Step3-1.png)
External references
![](https://docs.microsoft.com/en-us/media/logos/logo-ms-social.png)