Wednesday, April 2, 2008

Sql Server Query

How to select Duplicate Rows from a table
select email,count(*) from finaldatabase_Amit group by email having count(*)>1

Insert rows/records from one table to another table
insert into tbl_logo_Info_event (ImageURL_link,ImageURL_Show, Image_Name,Image_Title, Image_Profile) select ImageURL_link,ImageURL_Show,Image_Name,Image_Title,Image_Profile from tbl_logo_Info where ImageID='16'

Select two random rows from SQL server database table
Select top 2 * from tbl_news order by newid()

Select desired rows from table by IN Keyword
select * from tbl_logo_Info where ImageID IN(4,6,10) order by image_Title asc

Searching in a column of any table by a substring
Example : Searching 'Independence day' text in column name leave_desc for 'epen' substring.
SELECT leave_desc FROM tbl_calendar WHERE substring(leave_desc, 4, 4) = 'epen'

Tuesday, April 1, 2008

About Classic ASP

  • What is ASP?
    ASP stands for Active Server Pages
    ASP is a program that runs inside IIS
    IIS stands for Internet Information Services
    IIS comes as a free component with Windows 2000
    IIS is also a part of the Windows NT 4.0 Option Pack
    The Option Pack can be downloaded from Microsoft
    PWS is a smaller - but fully functional - version of IIS
    PWS can be found on your Windows 95/98 CD

    ASP Compatibility
    ASP is a Microsoft Technology
    To run IIS you must have Windows NT 4.0 or later
    To run PWS you must have Windows 95 or later
    ChiliASP is a technology that runs ASP without Windows OS
    InstantASP is another technology that runs ASP without Windows
    What is an ASP File?
    An ASP file is just the same as an HTML file
    An ASP file can contain text, HTML, XML, and scripts
    Scripts in an ASP file are executed on the server
    An ASP file has the file extension ".asp"
    How Does ASP Differ from HTML?
    When a browser requests an HTML file, the server returns the file
    When a browser requests an ASP file, IIS passes the request to the ASP engine. The ASP engine reads the ASP file, line by line, and executes the scripts in the file. Finally, the ASP file is returned to the browser as plain HTML