1,266 reputation
515
bio website
location
age
visits member for 2 years, 6 months
seen Nov 19 at 21:35

Nov
15
awarded  Enlightened
Nov
15
awarded  Nice Answer
May
23
comment QUERY - pivot multiple columns, variable number of rows
If your version IDs are different for every recipe, then you're either going to end up with two columns for every row in your table, or your version in the column name would not match the version ID.
May
19
revised How to SELECT multiple COUNT(*) columns with each GROUP BY having a different WHERE clause?
added 288 characters in body
May
19
answered How to SELECT multiple COUNT(*) columns with each GROUP BY having a different WHERE clause?
May
17
comment Performance hit of CONVERT from nvarchar to money (SQL Server)
Mostly I was thinking of Aaron's arguments against it, but sqlblog.com/blogs/aaron_bertrand/archive/2009/10/12/… doesn't have a lot of detail, and the SO question he links to suffers the same problem of the accepted answer not having the interesting info
May
17
awarded  Yearling
May
16
comment List of fallback values in SQL
Something like SELECT TOP (1) FolderName FROM dbo.FallbackFolders WHERE FolderExists = 1 ORDER BY Precedence?
May
16
comment Performance hit of CONVERT from nvarchar to money (SQL Server)
You probably don't want to use MONEY--go DECIMAL. See stackoverflow.com/questions/582797/…
May
16
answered Query plan cache bloated by ad-hoc queries, even with “Optimize for Ad-hoc Workloads”
May
16
awarded  Enlightened
May
16
awarded  Nice Answer
May
14
comment How to find duration in a dataset
It needed a slight change in how the NULLs were filtered. It still doesn't match the desired output exactly, as it shows the first and last PollTime for a NULL set, rather than the first of the NULL set and the first of the following set. May do the trick, though, if a simple "+1" is appropriate for your application.
May
14
revised How to find duration in a dataset
`WHERE Value IS NULL` in the CTE breaks the "gaps and islands" construct. Filter out the unwanted groups in the outer query.
May
14
suggested suggested edit on How to find duration in a dataset
May
14
comment Loading image from file system into SQL query using openrowset
It's not going to work that way without using dynamic SQL. See stackoverflow.com/questions/6935598/….
Feb
12
comment Timeout while using table valued parameter
Re: MERGE -- I really want MERGE to work well/reliably. I've gotten comfortable with the syntax and find it convenient for my most common tasks--especially when I'm dumping the output to a log table. Most of the issues I've read about seem to be with features we don't make heavy use of (indexed views, filtered indexes, triggers), so I haven't abandoned it (for this environment at least)--though I realize it may bite me later.
Feb
12
comment Timeout while using table valued parameter
I started using the #temp with this pattern (unless the data set is fairly small) after starting to run into performance issues using large table variables. I'm operating under an assumption that a TVP is equivalent to a table variable inside of a proc--but even so, it may well be an overreaction to be using the #temp without specific indication to need it in this circumstance. There is no PK on the TVP (it isn't by definition unique--but I could move the row_number upstream to make it so).
Feb
12
revised Timeout while using table valued parameter
added 1931 characters in body
Feb
12
comment Timeout while using table valued parameter
@Thomas -- That's what I was looking for! I'd found references to that attached to a connection string, but not to the SqlCommand, and I didn't make the connection. cmd.CommandTimeout = 0; let it complete successfully! Now to figure out if this was a good idea to begin with...