-->
Showing posts with label SQL. Show all posts
Showing posts with label SQL. Show all posts

Jun 23, 2014

Local Temp Table Vs Global Temp Table

Local Temp Table Vs Global Temp Table
S.NoParticularsLocal Temp TableGlobal Temp Table
1AvailableSQL Server session or connection (means single user).all SQL Server sessions or connections (means all the user).
2DeletedThese are automatically deleted when the session that created the tables has been closed.These can be created by any SQL Server connection user and these are automatically deleted when all the SQL Server connections have been closed.
3Stared with signLocal temporary table name is stared with single hash ("#") sign.Global temporary table name is stared with double hash ("##") sign.

Jun 18, 2014

Store Procedure Vs Function

Store Procedure Vs Function
S.NoParticularsStore ProcedureFunction
1ReturnNo return value.Must return Value.
2ParameterInput/Output.Input.
3Callcan't called to Function.can called to Store Procedure.
4Mandatory Input Paramenternot Mandatory.Mandatory.
5DML/SelectAllow DML/Select.Allow Select.
6Exceptioncan be handled.can not be handled .

Jun 10, 2014

Primary Key vs Unique Key

Primary Key vs Unique Key
S.NoParticularsPrimary KeyUnique Key
1null valuecan't accept null values.can accept Only One null value.
2keyonly one Primary key in a table.more than one Unique key in a table.

Jun 9, 2014

Primary Key vs Foreign Key

Primary Key vs Foreign Key
S.NoParticularsPrimary KeyForeign Key
1null valuecan't accept null values.can accept Only One null value.
2keyonly one Primary key in a table.more than one foreign key in a table.

Jun 6, 2014

Store Procedure Vs LINQ

Store Procedure Vs LINQ
S.NoParticularsStore ProcedureLINQ
1FasterFaster than LINQ.Slower than Store Procedure.
2DebugNot Allowed.Allowed.
3writing complex queriesBest Way.Not Possible.
4DeploySQL script for deployment.easy and simple.