Ads

04 July 2013

.TUF file

TUF file is a Microsoft SQL Server Transaction Undo file. .TUF File contains the information regarding any modifications that were made as part of incomplete transactions at the time the backup was performed.

A transaction undo(.TUF) file is required if a database is loaded in read-only state. In this state, further transaction log backups may be applied.

if  .TUF file is deleted then log shipping restoration job will not work.


01 July 2013

OLE DB error: OLE DB or ODBC error: You do not have permission to run 'SP_TRACE_CREATE'.; 42000

OLE DB error: OLE DB or ODBC error: You do not have permission to run 'SP_TRACE_CREATE'.; 42000

 

Answer:- 

 

USE master
GO
GRANT ALTER TRACE TO [LOGINNAME]
GO

16 May 2013

Health Tip- Easy Way To Burn Calories

For anyone trying to lose weight, this question is an exciting one! If you simply want to know if your body burns calories warming up the water, the answer is yes. But if you want to know if drinking a lot of ice water can help you lose weight, or keep weight off, this "yes" needs to be qualified with some calculations.
First of all, calories are case-sensitive. There are calories and then there are Calories. Calories with a big "c" are the ones used to describe the amount of energy contained in foods. A calorie with a little "c" is defined as the amount of energy it takes to raise the temperature of 1 gram of water 1 degree Celsius.
What most people think of as a Calorie is actually a kilo-calorie: It takes one Calorie to raise the temperature of 1 kilogram of water 1 degree Celsius. So when you drink a 140-Calorie can of cola, you are ingesting 140,000 calories. There is no cause for alarm, because the conversion applies across the board. When you burn 100 Calories jogging a mile, you are burning 100,000 calories.
So, considering that the definition of a calorie is based on raising the temperature of water, it is safe to say that your body burns calories when it has to raise the temperature of ice water to your body temperature. And unless your urine is coming out ice cold, your body must be raising the temperature of the water. So calories are being burned.
Let's figure out exactly what you're burning when you drink a 16-ounce (0.5 liter) glass of ice water:
  • The temperature of ice water can be estimated at zero degrees Celsius.
  • Body temperature can be estimated at 37 degrees Celsius.
  • It takes 1 calorie to raise 1 gram of water 1 degree Celsius.
  • There are 473.18 grams in 16 fluid ounces of water.
So in the case of a 16-ounce glass of ice water, your body must raise the temperature of 473.18 grams of water from zero to 37 degrees C. In doing so, your body burns 17,508 calories. But that's calories with a little "c." Your body only burns 17.5 Calories, and in the grand scheme of a 2,000-Calorie diet, that 17.5 isn't very significant.
But let's say you adhere to the "eight 8-ounce glasses of water a day" nutritional recommendation. In 64 ounces of water, there are 1,892.72 grams. So to warm up all that water in the course of a day, your body burns 70,030 calories, or 70 Calories. And over time, that 70 Calories a day adds up. So, while you definitely shouldn't depend on ice water consumption to replace exercise or a healthy diet, drinking cold water instead of warm water does, in fact, burn some extra Calories!


http://health.howstuffworks.com/wellness/diet-fitness/weight-loss/question447.htm

08 May 2013

ALTER PARTITION SCHEME




ALTER PARTITION SCHEME NEXT USED ALTER PARTITION FUNCTION SPLIT RANGE ('100') Go


Example:-


ALTER PARTITION SCHEME cover NEXT USED [SSD] ALTER PARTITION FUNCTION covern() SPLIT RANGE ('201') Go

ALTER PARTITION SCHEME cover  NEXT USED [SSD] ALTER PARTITION FUNCTION covern() SPLIT RANGE ('202') Go

ALTER PARTITION SCHEME cover NEXT USED [SSD] ALTER PARTITION FUNCTION covern() SPLIT RANGE ('203') Go



30 April 2013

VI Editor Commands

Common Vi / Vim File Savings Related Commands (ex mode)

You need to press [Esc] key followed by the colon (:) before typing the following commands:
CommandDescription
q Quit
q! Quit without saving changes i.e. discard changes
r fileName Read data from file called fileName
wq Write and quit (save and exit)
w fileName Write to file called fileName (save as)
w! fileName Overwrite to file called fileName (save as forcefully)

04 April 2013

Query To Get Table Size and Rowcount

 SELECT
    t.NAME AS TableName,
    p.rows AS RowCounts,
    (SUM(a.total_pages) * 8 )/1024 AS TotalSpaceMB ,
    (SUM(a.used_pages) * 8 )/1024 AS UsedSpaceMB,
    ((SUM(a.total_pages) - SUM(a.used_pages)) * 8)/1024 AS UnusedSpaceMB
FROM
    sys.tables t
INNER JOIN     
    sys.indexes i ON t.OBJECT_ID = i.object_id
INNER JOIN
    sys.partitions p ON i.object_id = p.OBJECT_ID AND i.index_id = p.index_id
INNER JOIN
    sys.allocation_units a ON p.partition_id = a.container_id
WHERE
    t.NAME NOT LIKE 'dt%'
    AND t.is_ms_shipped = 0
    AND i.OBJECT_ID > 255
GROUP BY
    t.Name, p.Rows
ORDER BY
     TotalSpaceMB desc