Tag Archives: T-SQL

Reading SQL Server Error Logs

I wrote a script to allow me to look at the last few days of errors in the SQL error logs. It was rather useful at a previous site, and I wrote them a little note about it, which I … Continue reading

Posted in SQLServerPedia Syndication | Tagged , | 8 Comments

DBCC DBINFO() – Don’t rely on undocumented commands

Don’t Rely on Undocumented Commands – A Cautionary Tale Looking at the output for the (undocumented) DBCC DBINFO() command, I noticed a typo in one of the field names. I wondered about submitting it as a bug, but then looked … Continue reading

Posted in SQLServerPedia Syndication | Tagged , | 3 Comments

OBJECT_ID()’s second parameter

I received a supplier-supplied maintenance / check / troubleshooting script that did a whole heap of looking-to see-if-a-default-value-exists-and-if-it-doesn’t-then=create-it type stuff. As you would expect, it’s a load of They could have saved themselves a bit of typing (or, let’s be … Continue reading

Posted in SQLServerPedia Syndication | Tagged | Leave a comment

A Problem with Boolean Logic

Your requirement: to find the things where either A or B is true and C is true. Your first draft might be this: (field, table, function, logic all anonymised to protect the perpetrator) What’s the problem? Operator Precedence, that’s the … Continue reading

Posted in SQLServerPedia Syndication | Tagged , , , , | 2 Comments

T-SQL Tuesday – Bad Habits – Fixed by SQLPrompt

T-SQL Tuesday again. And it’s been a few months since I last blogged, let alone for this blog-party, but, hey, I’m here now. This time, Aaron Bertrand (blog|@aaronbertrand) has given two options – and, given the amount time I’ve been … Continue reading

Posted in T-SQL Tuesday | Tagged , , , | Leave a comment

SQL Server Non-Unique Clustered Indexes Are Evil!

Non-Unique Clustered Indexes Are Evil And We Have The Proof. You won’t believe it when you see it. Face it – I can’t write click-bait… I was reading Grant Fritchey’s (Blog|@gfritchey) comments in the SQL Server Central forum thread “Advice … Continue reading

Posted in SQLServerPedia Syndication | Tagged , , | 2 Comments

Setting SQL Server Maximum Memory

One of the dafter defaults in SQL Server is the Maximum Server Memory (MB) – set to a value of 2147483647. Who has a server with 2PB RAM? Give me a call if you do – I want to have … Continue reading

Posted in SQLServerPedia Syndication | Tagged , , , | 2 Comments