Justin Cooney
Web Development Tips and Examples
Category: SQL
-
Often while writing SQL queries I encounter situations where I want to display dates. In the past I would write applications that enforced dates to be in the mm/dd/yyyy format, but more often than not this led to confusion and mistakes for the users of an application when working with the dates. I am not sure…
-
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…