Skip to main content

Posts

Showing posts from July, 2011

ASP.Net : Send mail through Html

Add this page to your project with name of mail.asp and save following code into it. <% if Request.ServerVariables("REQUEST_METHOD") = "POST" then     txtname = Request.Form("txtname")     'txtcompanyname= Request.Form("txtcompanyname")     txtadd = Request.Form("txtadd")     txtzip= Request.Form("txtzip")     txtcity = Request.Form("txtcity")     txtstate = Request.Form("txtstate")     txtcountry = Request.Form("txtcountry")     txtph = Request.Form("txtph")     txtfax = Request.Form("txtfax")     txtemail = Request.Form("txtemail")     txtquery = Request.Form("txtquery")     MailBody="Enquiry Form <br>" _              & "Name: " & txtname & "<br>" _              & "Address: " & txtadd & "<br>" _              & "City: " &

SQL SERVER : Standard Date Formats

Standard Date Formats Date Format SQL Statement Sample Output Mon DD YYYY 1 HH:MIAM (or PM) SELECT CONVERT(VARCHAR(20), GETDATE(), 100) Jan 1 2005 1:29PM 1 MM/DD/YY SELECT CONVERT(VARCHAR(8), GETDATE(), 1) AS [MM/DD/YY] 11/23/98 MM/DD/YYYY SELECT CONVERT(VARCHAR(10), GETDATE(), 101) AS [MM/DD/YYYY] 11/23/1998 YY.MM.DD SELECT CONVERT(VARCHAR(8), GETDATE(), 2) AS [YY.MM.DD] 72.01.01 YYYY.MM.DD SELECT CONVERT(VARCHAR(10), GETDATE(), 102) AS [YYYY.MM.DD] 1972.01.01 DD/MM/YY SELECT CONVERT(VARCHAR(8), GETDATE(), 3) AS [DD/MM/YY] 19/02/72 DD/MM/YYYY SELECT CONVERT(VARCHAR(10), GETDATE(), 103) AS [DD/MM/YYYY] 19/02/1972 DD.MM.YY SELECT CONVERT(VARCHAR(8), GETDATE(), 4) AS [DD.MM.YY] 25.12.05 DD.MM.YYYY SELECT CONVERT(VARCHAR(10), GETDATE(), 104) AS [DD.MM.YYYY] 25.12.2005 DD-MM-YY SELECT CONVERT(VARCHAR(8)

SQL SERVER : Difference between DELETE TABLE and TRUNCATE TABLE ?

DELETE TABLE is a logged operation, so the deletion of each row gets logged in the transaction log, which makes it slow. TRUNCATE TABLE also deletes all the rows in a table, but it won't log the deletion of each row, instead it logs the deallocation of the data pages of the table, which makes it faster. TRUNCATE TABLE can be rolled back.

SQL SERVER :Define candidate key, alternate key, composite key

A candidate key is one that can identify each row of a table uniquely. Generally a candidate key becomes the primary key of the table. If the table has more than one candidate key, one of them will become the primary key, and the rest are called alternate keys. A key formed by combining at least two or more columns is called composite key.