| Top 10 Questions at a glace |
| What is ACID property in SQL? |
Automicity : Group of T-SQL stmts act in a batch .
Consistency : All or none concept.
Isolation: Visibility of resources used in one transaction to concurrent
transactions
Durability : Once changes are commited to database they are permanent |
|
What's
the difference between a primary key and a unique key?
|
|
Both primary key and unique enforce uniqueness of the column on which they are
defined. But by default primary key creates a clustered index on the column,
where are unique creates a nonclustered index by default. Another major
difference is that, primary key doesn't allow NULLs, but unique key allows one
NULL only.
|
| How to create html file from SQL server ?
|
execute sp_makewebtask
@outputfile=N'G:\test.html',
@query = N'Select * from dbo.ReportDetails',
@dbname = N'StayNtravel',
@webpagetitle = N'webpagetitle',
@resultstitle = N'resultstitle'
|
| What is the difference between @@identity and scope_identity() ? |
| when you are developing stored procedures and other database objects during Sql
server development. Use the scope_identity() function as opposed to @@Identity
when retrieving the last inserted identifier. The reason @@Identity can go
wrong is where a trigger is added to a table that causes another row to be
inserted then @@Identity no longer holds the correct value. scope_identity()
will give you the value you are looking for. Note: scope_identity() is not
supported in SQL server 7
|
| Indexing in SQL (Clustered and Nonclustered) |
-
Neither clustered nor non-clustered index does create uniqueness by default,
which means indexed column can have duplicate value. In order to make that we
can create an index with unique keyword.
Example:
Create unique clustered Index ix_IndexName on
TableName(ColumnName)
Create unique nonclustered Index ix_IndexName on TableName(ColumnName)
-
Clustered index re-arrange the data, and help in faster search.
-
If the table has a primarykey it will not allow to create a clustered index on
it, because primarykey itself is a clustered index.
-
Nonclustered index does not make any changes on position of data, helps in
faster searching.
|
| How to insert multiple record with the use of XMLdocument |
| Here is the complete implementation, the document demonstarte how to insert
a xml documet into sql 2005 table, the use of
sp_xml_preparedocument, OPENXML and sp_xml_removedocument now lets look at the code
click here to download also take a look at the sql implementation |
| |