Difference between TRUNCATE and DELETE in Sql Server?Truncate:TRUNCATE is a DDL command and cannot be rolled back.Truncate will actually remove all the rows from a table and all of the memory space is released back to the server.TRUNCATE is much faster.You cannot TRUNCATE a table that has any foreign key constraints. You will have to remove the contraints, TRUNCATE the table, and reapply the contraints.TRUNCATE will reset any identity columns to the default seed value. This means if you have a table with an identity column and you have 264 rows with a seed value of 1, your last record will have the value 264 (assuming you started with value 1) in its identity columns. After TRUNCATEing your table, when you insert a new record into the empty table, the identity column will have a value of 1.Truncate = delete+commit (so we cant roll back)Delete:DELETE is a DML command and can be rolled back.Delete command removes the rows from a table based on the condition that we provide with a WHERE clause.You can DELETE any row that will not violate a constraint, while leaving the foreign key or any other contraint in place.DELETE will not do this. In the same scenario, if you DELETEd your rows, when inserting a new row into the empty table, the identity column will have a value of 265.Delete = delete (so it can be rolled back)------------------------------------------------------------------------------------------------Difference between Function and Stored Procedure?UDF can be used in the SQL statements anywhere in the WHERE/HAVING/SELECT section where as Stored procedures cannot be.------------------------------------------------------------------------------------------------What is the difference between a HAVING CLAUSE and a WHERE CLAUSE?Specifies a search condition for a group or an aggregate.HAVING can be used only with the SELECT statement.HAVING is typically used in a GROUP BY clause.WHERE Clause is used to apply condition to a row.------------------------------------------------------------------------------------------------Properties of Sub-QueryA subquery must be enclosed in the parenthesis.A subquery must be put in the right hand of the comparison operator, andA subquery cannot contain a ORDER-BY clause.A query can contain more than one sub-queries.------------------------------------------------------------------------------------------------What are types of sub-queries?Single-row subquery, where the subquery returns only one row.Multiple-row subquery, where the subquery returns multiple rows,.andMultiple column subquery, where the subquery returns multiple columns.------------------------------------------------------------------------------------------------What is a transaction and what are ACID properties?A transaction is a logical unit of work in which, all the steps must be performed or none. ACID stands for Atomicity, Consistency, Isolation, Durability. These are the properties of a transaction-------------------------------------------------------------------------------------------------------------------------------------SQL SERVER - QUOTED_IDENTIFIER ON/OFF and ANSI_NULL ON/OFF Explanation:
When create or alter SQL object like Stored Procedure, User Defined Function in Query Analyzer, it is created with following SQL commands prefixed and suffixed. What are these - QUOTED_IDENTIFIER ON/OFF and ANSI_NULL ON/OFF?SET QUOTED_IDENTIFIER ONGOSET ANSI_NULLS ONGO--SQL PROCEDURE, SQL FUNCTIONS, SQL OBJECTGOSET QUOTED_IDENTIFIER OFFGOSET ANSI_NULLS ONGO
ANSI NULL ON/OFF:This option specifies the setting for ANSI NULL comparisons. When this is on, any query that compares a value with a null returns a 0. When off, any query that compares a value with a null returns a null value.
QUOTED IDENTIFIER ON/OFF:This options specifies the setting for usage of double quotation. When this is on, double quotation mark is used as part of the SQL Server identifier (object name). This can be useful in situations in which identifiers are also SQL Server reserved words.http://blog.sqlauthority.com/2007/03/05/sql-server-quoted_identifier-onoff-and-ansi_null-onoff-explanation/
Posted by P. Bixam at 2:38 AM 0 comments
Wednesday, December 12, 2007
AJAX Code snippets
Meta Refresh Taghttp://webdesign.about.com/od/metataglibraries/a/aa080300a.htmQ. Javascript code for Rotating Images.
script language="javascript" type="text/javascript"var intval=15;var nofImgs=6;arrImgs=new Array(nofImgs);arrImgs[0]="Images/col.gif";arrImgs[1]="Images/hand.gif";arrImgs[2]="Images/logo1.gif";arrImgs[3]="Images/msnet.gif";arrImgs[4]="Images/Thanks.gif";arrImgs[5]="Images/white_flow.gif";ImageofBrowser = ManipulateImages();currImg = 0;setInterval("nextSlide()",intval*350);function ManipulateImages(){if(document.images)return true;elsereturn false;}function nextSlide(){currImg=(currImg+1)%nofImgsloadImage(arrImgs[currImg]);}function loadImage(imgURL){if(ImageofBrowser){document.slide.src=imgURL;return false;}elsereturn true;}/script
http://www.microsoft.com/express/download/
http://download.microsoft.com/download/9/a/e/9ae0f6cc-7032-408e-9ca7-989f9e4af4ec/VS2008Readme.htm
http://www.microsoft.com/downloads/details.aspx?FamilyId=D95598D7-AA6E-4F24-82E3-81570C5384CB&displaylang=en
http://www.microsoft.com/downloads/details.aspx?familyid=333325FD-AE52-4E35-B531-508D977D32A6&displaylang=en
http://www.microsoft.com/express/vwd/
http://msdn2.microsoft.com/en-us/beginner/bb964635.aspx
Sunday, March 23, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment