SELECT TOP 100 PERCENT?

My Microsoft SQL Server VIEW create statement has a TOP 100 PERCENT in the SELECT clause. Why would you use SELECT TOP 100 PERCENT in a SQL Server 2000 query?

A VIEW in Microsoft SQL Server will not allow you to have an ORDER BY statement. However, if you put a TOP 100 PERCENT in the SELECT statement, SQL Server will allow the ORDER BY.

Details can be found here:

http://techrepublic.com.com/5208-9592-0.html?forumID=88&threadID=165375&messageID=2077343

I came across this while editing some VIEWS for a co-worker. He created the views using SQL Server’s visual tools. The tools automatically add this piece of code to the top of the CREATE statement for the views.

Files in Source Code Control

I’m using Visual Studio 2003 (2005, 2008)  and I’m not sure which files I should be putting under version control.

We are currently transitioning our source code control to SVN. As I’m moving files and checking things in I occasionally see a few files that I wonder if we should be versioning at all. So, I looked them up. Here’s what I found from this page.

You can add the following files to Visual Studio source control:

  • Solution files (*.sln).

  • Project files, for example, *.csproj, *.vbproj files.

  • Application configuration files, based on XML, used to control run-time behavior of a Visual Studio project.

Files that you cannot add to source control include the following:

  • Solution user option files (*.suo).

  • Project user option files, for example, *.csproj.user, *.vbproj.user files.

  • Web information files, for example, *.csproj.webinfo, *.vbproj.webinfo, that control the virtual root location of a Web project.

  • Build output files, for example, *.dll and *.exe files.

The main one that I see often is the .suo file. I’m going to kill those files in my SVN tree right now . . .