Dynamic Order By NewID() - is this approach correct?
I need to select some records from a table, and order them based on the value of a procedure argument (bit field). Something like this:
CREATE PROC myProc
@random bit = 0
SELECT * FROM myTable
CASE WHEN @random = 1 THEN CAST(NEWID() AS SQL_VARIANT)
Am I correct in casting NewID to type SQL_Varient. If I just use NewID I get an error saying that "Implicit conversion from uniqueidentifier is not allowed".
Although the above seems to work I need to know I'm not setting myself up for a future disaster...! Thanks.
With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.