(32S) SQL Server Size Converter
|
05-16-2015, 10:59 PM
Post: #1
|
|||
|
|||
(32S) SQL Server Size Converter
In case there are any other SQL Server DBAs here...
SQL Server stores data in "pages", which are simply 8 KB allocation units within a data file, and the smallest unit of measure by which SQL Server allocates storage space. Object sizes are frequently reported in pages, rather than bytes. Disk I/O is performed in a minimum unit of storage called an "extent", which is simply a 64 KB block of 8 pages. Here's a program to quickly convert between pages, extents, KB, MB, and GB. This is based on the cyclical style of unit converters presented in the 32S manual. So XEQ D to start the program, and either enter the number of pages at the "P?" prompt, or press R/S until the unit you wish to enter is displayed. After selecting the appropriate unit and entering the input value, press R/S to cycle through the units until the desired output unit is displayed. Example: Convert 256 MB to pages. Code: Input Display Answer: 32,768 pages. Note that the program temporarily sets FIX 4 to round the number of pages to prevent small errors when converting from GB back to pages. You can either delete lines D02 through D04 if you wish to eliminate this behavior, or change the ALL instruction in line D04 to switch back to your display mode of choice. Program listing: Code: D01 LBL D - 46.5 bytes, 80BA |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)