CONVERT() to float using scientific notation

April 20, 2016 Andy 2

Someone posted to #sqlhelp on Twitter, asking the following: “Wondered if anyone could enlighten me as to why ISNUMERIC(‘7d8’) returns 1?” Sure enough, SELECT ISNUMERIC(‘7d8′) returns a 1. WTF? d isn’t numeric! OK, sure, if you say “seven-dee-eight” out loud it sounds like a number, but “d” is a … [Read More]

No Picture

Decoding sql_handle

February 29, 2016 Andy 0

If you’ve ever looked at sys.sysprocesses or sys.dm_exec_requests (or a number of other DMVs), you’ve noticed there is a column called “sql_handle” that contains some binary gobbledygook. Books Online gives the (un)helpful definition as “Hash map of the SQL text of the request.” sp_WhoIsActive In … [Read More]

No Picture

sp_executesql with output parameters

January 22, 2015 Andy 2

One of my coworkers asked me about output parameters from dynamic SQL today. I pointed him at sp_executesql, which allows for passing parameters into or out of dynamic SQL. The syntax can be confusing at first blush (especially for a new DBA or developer), but … [Read More]