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
Referenced articles
How to Convert a VBA Function to a SQL Server Scalar Function
MS Access Developers Can Remove All the Risk From This Complex Process With These 3 Words
Trust But Verify
What Ronald Reagan’s Words Can Teach Us About the Sample Code We Find on the Internet
VBA to T-SQL via TDD: Step 2
Step 2. Build a “test table population query” in Microsoft Access
VBA to T-SQL via TDD: Step 3
Step 3. Create a temporary test table in SQL Server
External references
Download SQL Server Management Studio (SSMS) - SQL Server Management Studio (SSMS)
Download the latest version of SQL Server Management Studio (SSMS).