Wednesday, July 11, 2012

Why Use SQL Profiler in Microsoft SQL server

Uses of SQL Profiler in Microsoft SQL server

SQL Profiler captures SQL Server events from a server. These events are saved in a trace file that can be used to analyze and diagnose problem.

There are many other useful function of SQL Profiler, these are following :

  • SQL Profiler used to find the cause of the problem by stepping through problem queries.
  • SQL Profiler is very useful to analyze the cause of slow running queries.
  • SQL Profiler can be used to tune workload of the Microsoft SQL server.
  • SQL Profiler also stores security-related actions that can be reviewed by a security administrator.
  • SQL Profiler also supports auditing the actions performed on instances of Microsoft SQL Server.


Why Use Full Text Query in Microsoft SQL Server

Full Text Query in Microsoft SQL Server

Full Text Query search used to search for the entire text instead of using “%”. We use it to search for text with data type TEXT or NOTE etc . 

Some predicates like FREETEXT, CONTAINS are used in full text query search. FREETEXT finds the word or words you give it anywhere in the search column. For example

SELECT Apparel FROM Products WHERE FREETEXT (Apparel, 'Van' )

The output of above query will be : Best Van Huesen trousers

Complete Phases of Transaction in Microsoft SQL Server


There are several phases of transaction in Microsoft sql server. These are following :

When transaction starts, database is in consistent state .

BEGIN TRANSACTION statement starts the transaction explicity.

Transaction generates the first record for data modification and write these records to log.

Modification starts one table at time, at this stage database is in inconsistent state.

Upon successful completion of all modification, database is once again consistent, and then application commits the transaction.

In case some errors occur, it rolls back all the modifications processed on data. This process returns the database to the point of consistency it was at before the transaction started.


Uses of XPath language

XPath is a language defined by the W3C. It used to select nodes from XML documents. 


Microsoft SQL Server 2000 supports XPath language that helps to retrieve data from XML documents. 


Microsoft SQL server uses a mapping schema to define an XML based view of the data in one or more SQL Server tables and views. The mapping schema is then used to retrieve data.

Tuesday, July 10, 2012

Constraints for Designing of Files and File groups in Microsoft SQL Server

There are some constraints for designing files and file group in Microsoft SQL server. These constraints are following :


A file or file group can only be used by one database. For example, the files abcd.mdf and abcd.ndf contains data and objects for abc database, cannot be used by any other database.

A file can be a member of only one file group
.


Data and transaction log information cannot be part of the same file or file group.

Transaction log files can't be part of a file group.