Tag Archives: T-SQL

Obtaining a random result set in PowerShell

Given a set of data how does one return an arbitrary subset?  Well in T-SQL we’d do this: So how can we do this in PowerShell?  Well in pretty much the same way actually.  Pipe to Sort-Object and then to … Continue reading

Posted in Off-topic, Scripting | Tagged , , , | Leave a comment

sp_executeSQL to the rescue

(a.k.a. my DEFAULT constraints aren’t working –NULL is being written to the DB.  Where are my default values?) I encountered a bug in a stored procedure I’d written that took me a little longer to fix than it should have … Continue reading

Posted in Off-topic, SQL Server, Troubleshooting | Tagged , , , , , , , , | Leave a comment