Posts
1150
Comments
891
Trackbacks
1
T-SQL: Using Top 100% in Views

In SQL Server 2000, you can do something like:

Create view myView as select top 100 percent column1, column2 from mytable order by column1

to allow for ordered views.  It isn't 'supposed' to work, but it does.

It doesn't in SQL Server 2005.  However, this does:

Create view myView as select top 99.9999999999999 percent column1, column2 from mytable order by column1

If you count, there are 13 decimal places.  If you add a 14th decimal place it doesn't work.

Go figure.

http://sqladvice.com/blogs/repeatableread/archive/2006/06/14/18682.aspx

 

posted on Friday, July 27, 2007 1:31 PM Print
Comments
No comments posted yet.

Post Comment

Title *
Name *
Email
Url
Comment *  
Please add 2 and 5 and type the answer here: