Advantage and Disadvantage
Sunday, December 28, 2014
Is there a way to loop through a table variable in without using a cursor?
http://searchsqlserver.techtarget.com/tip/Avoid-cursors-in-SQL-Server-with-these-methods-to-loop-over-records
http://stackoverflow.com/questions/61967/is-there-a-way-to-loop-through-a-table-variable-in-tsql-without-using-a-cursor
http://stackoverflow.com/questions/1578198/can-i-loop-through-a-table-variable-in-t-sql
Monday, December 22, 2014
Paging a Query
Sometimes it is necessary to optimize the data returned by a query, removing unnecessary fields from a SELECT statement, and including conditions in your WHERE clause so that the user can retrieve only the data that really needed.
It is very important in the critical conditions for small companies, with limited hardware or software. The places where Internet access is limited and slow we also have the need to reduce network traffic data.
These are factors that require a query to retrieve only the data that will be displayed in the User Interface screen, excluding the extra that maybe used in another page, displaying of a "Grid View" or "Report".
One of the features that can be used to meet these requirements is the Paging in the SQL Server.
The main objective of this article is to show how a simple T-SQL script can be useful, when well implemented.
http://social.technet.microsoft.com/wiki/contents/articles/23811.paging-a-query-with-sql-server.aspx
Pages and Extents
The fundamental unit of data storage in Microsoft® SQL Server™ is the page. In SQL Server 2000, the page size is 8 KB. This means SQL Server 2000 databases have 128 pages per megabyte.
The
start of each page is a 96-byte header used to store system
information, such as the type of page, the amount of free space on the
page, and the object ID of the object owning the page.
Subscribe to:
Posts (Atom)