Justin Cooney

Web Development Tips and Examples

Category: tSQL

  • Problem: I encountered an interesting problem today. I had a SQL Server table with many records in it that I needed to clean up. Specifically, I needed to find all duplicate records in the table, but keep the first of each of the duplicate records. The table also contained several rows of detail information that…

  • Running an ad-hoc query from SQL Server SSMS to an Excel spreadsheet is amazingly straightforward using the OpenRowset command. Here’s how it’s done… For starters, copy the Excel spreadsheet to a location where the installed version of SQL Server can access it. This is necessary since your query in SSMS (SQL Server Management Studio) will…

  • What is the best way to see the full properties of all of the Linked Servers in SQL Server in one go? A SQL query is naturally the best way using SQL Server’s system tables! UI-Based Solutions: The properties view in the SSMS UI does not show sufficient information about the set-up and history of…