To copy data from one table to another, use INSERT…SELECT for an existing table or SELECT…INTO for a new one. The tests here show what SELECT…INTO carries over and what it drops, the errors you can hit, and a quick way to check the copy.
Finding the Error Log Folder and Other Paths From T-SQL
Pasted a server path into File Explorer and found nothing? The folder is on the server, not your laptop. Here are the queries that tell you where.
SQL SERVER – Move Database Files MDF and LDF to Another Location
Your new database sits in the default location and keeps growing. Here is how to move the MDF and LDF database files to another disk or drive.
Gapless Invoice Numbers That Restart Every Year
Finance hates a missing invoice number. A small counter table and one short transaction keep the numbers gapless and restart them each year.
Merging Overlapping Date Ranges Into Continuous Periods
Use running end dates when merging overlapping ranges, choose boundary rules, and return continuous periods without losing nested intervals.
SQL SERVER – Find First Non-Numeric Character from String
No built-in function finds the first non-numeric character in a string, so I use PATINDEX. Here is a quick script with sample data you can try.
Cleaning Address Data in T-SQL: Trimming, Casing and Standardizing
Start cleaning address data with preserved originals, normalized spaces, careful casing, street-word mappings, and postal-code review flags.






