Justin Cooney

Web Development Tips and Examples

Category: SQL Server 2005

  • 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…

  • There are three commands that can be used in SQL Server to query version information or information about the server hosting SQL Server. These commands can be run in SSMS directly, or can be used in code, for example to tailor queries for a particular database version. The commands are xp_msver, @@Version, and sp_server_info. I…

  • Global Temporary tables are defined on creation by adding the double pound sign (##) as a prefix. Unlike temporary tables they are available to all SQL Server sessions until the table is destroyed/the creating session goes out of scope. Global Temporary tables are similar to regular temporary tables in that they exist in tempdb and…