Tag Archives: cte

Selecting random ids using TOP and a CTE

While testing visualizations in a Flex application, I needed to do some underlying data cleanup in SQL Server.  One of my tasks was to manually update an entity table and set the status column to one of three possibilities.  Status … Continue reading

Posted in database, SQL, tips and tricks, tsql | Tagged , , , , , , , | Leave a comment

Select random value from a range of values

Earlier I blogged about creating random numbers using tsql functions.  Here are two techniques for selecting a random value from a pre-defined range of values in a tsql script.  The first technique uses a table variable ( MSSQL 2000 + … Continue reading

Posted in database, development, microsoft, tips and tricks, tsql | Tagged , , , , , , , , | 1 Comment