SQL Tricks: CSV To Table Rows And Vice Versa

I was looking for a one-line SQL statement to convert a comma-separated value list string to table rows and vice-versa and below is what I found.  I prefer not to put logic in my SQL code (I prefer to limit it with just the simple CRUD statements) but if no other choice then these two …

Continue reading SQL Tricks: CSV To Table Rows And Vice Versa

Advertisements

SQL Server: Hiding your prod data and built-in function STUFF()

If you need to use production data for your testing and don't want to expose any sensitive data on your development environment, you should look at obfuscating them.  This article shows the common obfuscation methods in use: character scrambling, repeating character masking, numeric variance, nulling, artificial data generation, truncating, encoding, and aggregating. Also, if you are …

Continue reading SQL Server: Hiding your prod data and built-in function STUFF()

SQL Server: My Quick and Dirty Way of Debugging Stored Procedure

I use the below SQL script to debug a stored procedure in chunks, replacing or adding into it the rest of the stored procedure code until every code checks out fine.  Since I use transactions, changes are temporary and it rolls back the transaction at the end.  I also used the error handling in SQL Server to catch …

Continue reading SQL Server: My Quick and Dirty Way of Debugging Stored Procedure