Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What are mdf,ndf,ldf files and how to see the data in those
files?

Answer Posted / arunyadav007

For reading the log files (.ldf) an undocumented system
stored procedure sp_readerrorlog is there. This SP allows
you to read the contents of the SQL Server error log files
directly from a query window and also allows you to search
for certain keywords when reading the error file. This is
not new to SQL Server 2005, but this tip discusses how this
works for SQL Server 2005.

This is a sample of the stored procedure for SQL Server
2005. You will see that when this gets called it calls an
extended stored procedure xp_readerrorlog.

This procedure takes four parameters:

Value of error log file you want to read: 0 = current, 1 =
Archive #1, 2 = Archive #2, etc...
Log file type: 1 or NULL = error log, 2 = SQL Agent log
Search string 1: String one you want to search for
Search string 2: String two you want to search for to
further refine the results

If you do not pass any parameters this will return the
contents of the current error log.

Example 1

EXEC sp_readerrorlog 6

This statement returns all of the rows from the 6th
archived error log.

Example 2

EXEC sp_readerrorlog 6, 1, '2005'

This returns just 8 rows wherever the value 2005 appears.
Example 3

EXEC sp_readerrorlog 6, 1, '2005', 'exec'

This returns only rows where the value '2005' and 'exec'
exist.

Even though sp_readerrolog accepts only 4 parameters, the
extended stored procedure accepts at least 7 parameters.

If this extended stored procedure is called directly the
parameters are as follows:

Value of error log file you want to read: 0 = current, 1 =
Archive #1, 2 = Archive #2, etc...
Log file type: 1 or NULL = error log, 2 = SQL Agent log
Search string 1: String one you want to search for
Search string 2: String two you want to search for to
further refine the results
?
?
Sort order for results: N'asc' = ascending, N'desc' =
descending

Is This Answer Correct ?    15 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Tell me what is sql profiler?

1031


Tell me what is difference between clustered and non clustered index?

944


How to make a remote connection in a database?

977


What is a self join in sql server?

1137


Explain an incremental backup?

1003


What is difference between createstatement and preparedstatement?

1090


What are indexes in ms sql server?

1060


How to enter comments in transact-sql statements?

944


How to find index size for each index on table?

1003


Explain the working of sql privileges?

1093


I have a table Events Events containing cardno,time,id,name--each id has a cardno my requirement is every day each employee swipe the card several times i want to calculate first and last time of each card the output should be name 1 2 6 7 in out in out holiday holiday xxx 09:30 06:30 09:40 06:45 where 1,2...... are dates for example january 1,2, etc. 6 and 7 are saturday and sunday how it is posssible

2241


What is spatial and temporal data?

1007


What is query processing?

942


you have separate development and production systems you want to move a copy of a development database into production to do this, you do a backup on the development system and restore to the production system after a few minutes, you begin getting calls from several customers saying that they are denied access to the system why? : Sql server administration

985


What are drilldown reports?

154