Take rest :-)

Your quest ends here( konchem .Net, konjam SQL, thoda lifestyle, kurachu movie info)

Archive for July, 2008

How to make her fall in love with you

Posted by chandru14 on July 28, 2008

How to make her fall in love with you

You have the swankiest car, but no one special to take out on a long drive. You are the most good looking bloke in your neighbourhood, but no one to appreciate it. You have been to the best restaurants in town, but no one to share the table with. You get the premiere tickets to all the latest flicks, but no one to take for a  movie date. In short, you have everything going for you, except the one who makes your heart do a somersault everytime you see her! Chill! Its all about polishing your techniques and you will have her in your arms and that is a promise!
How to make her fall in love with you
By Arya Rai
 
Stop pursuing her: Do your friends actually have to fold your tongue back into your mouth every time she passes by? Sheesh! How do you ever expect her to pay you any attention!? Buddy the trick is to act all cool and aloof in her presence and you will have her hovering around you. Pay too much attention and the chase gets tougher with her running even faster. Act like you don’t care whether she is coming or going. Turn a blind eye even when she’s looking her hottest best, difficult but stick to this. You will soon see the results. But hey, don’t give in too soon, make her earn your attention.
 
Get groomed: This one isn’t about visiting the salon every 15 days. Its about  dressing right, having a regular shower, wearing a deodorant at all times and not wearing the same tee Monday to Sunday! For more tips on grooming
 
Master that look: Women quiver in the knees when a man looks deep down into her eyes. Take it from me, I speak on behalf of all my sisters out there, who are collectively disgusted about guys who think their body starts neck down! A woman loves it if a guy pays attention to her face, passes an unusual comment about the mole above her lips or the twinkle in her eyes or the angelic curve of her bow shaped lips…got the idea?
 
Mark your focus: When you are talking to her, let the whole world be damned! There are innumerable scenes in movies, when the world around freezes or goes into slo-mo mode when the hero locks eyes with his gal. You have to do exactly that, make her blush with your gaze and perfect this art. You have do it everytime you see her, chances are by the fifth round you will be doing that in her dreams!
 
Be a good listener: When she talks, listen. Ask encouraging questions. Pass flattering remarks. Act like your life depends on her story. Respond with feelings. And when you are talking to her, ask for her opinion, and show that you value them. After this her phone bills will rise…you will be on her speed dial!
Be Mr Popular: Try and be a ray of sunshine in your circle of friends. Women love men who are fun to be with and who can make others laugh. Be the life of parties.
 
Learn to play the guitar: Enrol in a guitar class. A cute guy walking around with a guitar is romantic balm for many girls. And if you are good enough to play the guitar at parties, you will have a lot of hearts waiting to ensnare you! Believe me you, A guitar is one of the best babe magnets around! Singing comes a close second. Singing soulful numbers, provided you have the voice for it, melts the toughest female heart. 
 
Do you have more tips to add? CLick here

Posted in Relationships | Tagged: , | Leave a Comment »

Top 20 malayalam movie sites

Posted by chandru14 on July 28, 2008

Site URL

Content

www.malayalam.galatta.com

Movie news, reviews, gossips, galleries

www.malayalampadam.com

Movie news, reviews, gossips, galleries

www.keralamax.com

Movie news, reviews, gossips, galleries

www.malayalamcinema.com

Movie news, reviews, gossips, galleries

www.malayalammovie.com

Movie news, reviews, gossips, galleries

www.spiderkerala.com

Movie downloads, mp3 songs

www.keralaeverything.com

Movie news, reviews, gossips, galleries, downloads

www.chithrageetham.com

Movie download, songs, trailers, galleries

www.kerals.com/malayalammovie/index.htm

Movie news, reviews, gossips, galleries

www.cckerala.com

Movie news, reviews, gossips, galleries

www.malayalam.indiavilas.com

Movie news, reviews, gossips, galleries, Interviews

www.malluforum.com

Movie news, reviews, gossips, galleries

www.mallustars.com

Movie news, reviews, gossips, galleries

www.malayalamvideos.org

Movie downloads, galleries, reviews

www.moviekerala.blogspot.com

Movie news, reviews, gossips, galleries

www.cinemalayalam.net

Movie news, reviews, gossips, galleries

www.malayalam-movie-world.com

Movie downloads

www.malayalam.cinesouth.com

Movie news, reviews, gossips, galleries

www.malluhut.com

Movie download, mp3 songs

www.keralapals.com

Movie galleries

Posted in Top movie sites | Tagged: , , , , | 2 Comments »

Ranking functions in SQL Server

Posted by chandru14 on July 27, 2008

Hello friends J,

 

SQL Server 2005 has introduced some new ranking functions which make our job more easy when ever we want to assign ranks to employees / stundets based on different criteria.

 

Some of us might argue over that we can achieve the same ranking using ROW_NUMBER() function but the problem here is it always provides sequential values like 1,2,3,4 etc even though two are more records have the same ranking criteria. To avoid such issues, we can use RANK() or DENSE_RANK() based on the requirement.

 

I hope you find this article useful for you J. Here is the example.

Click here to download the script

Example:-

CREATE TABLE Dept( Dept_id INT PRIMARY KEY, DeptName VARCHAR(100), Loc VARCHAR(100))

GO

 

INSERT INTO Dept VALUES(101,‘Admin’,‘Chennai’)

INSERT INTO Dept VALUES(102,‘Sales’,‘Hyderabad’)

INSERT INTO Dept VALUES(103,‘Operations’,‘Delhi’)

INSERT INTO Dept VALUES(104,‘IT’,‘Banglore’)

 

GO

CREATE TABLE Employee(Emp_id INT PRIMARY KEY, EmpName VARCHAR(100),DOJ DATETIME, Salary MONEY, Dept_id INT REFERENCES Dept(Dept_id))

 

GO

INSERT INTO Employee VALUES(1001,‘Chandra’,’15-Dec-2004′,10000,104)

INSERT INTO Employee VALUES(1002,‘VVS’,’01-Jan-2005′,30000,104)

INSERT INTO Employee VALUES(1003,‘Pagalavan’,’15-Oct-2005′,40000,104)

INSERT INTO Employee VALUES(1004,‘ASN’,’10-Feb-2006′,20000,104)

INSERT INTO Employee VALUES(1005,‘Sathish’,’19-Dec-2005′,10000,104)

INSERT INTO Employee VALUES(1006,‘Sri’,’06-Sep-2007′,50000,104)

INSERT INTO Employee VALUES(1007,‘Sangeetha’,’10-Nov-2007′,15000,104)

INSERT INTO Employee VALUES(1008,‘Manick’,’25-Jan-2006′,20000,104)

INSERT INTO Employee VALUES(1009,‘Kanchana’,’15-Feb-2005′,19000,104)

INSERT INTO Employee VALUES(1010,‘Arun’,’15-Mar-2005′,12000,103)

INSERT INTO Employee VALUES(1011,‘Zahed’,’05-Apr-2004′,11000,103)

INSERT INTO Employee VALUES(1012,‘Rajesh’,’14-May-2005′,60000,103)

INSERT INTO Employee VALUES(1013,‘Ila’,’15-Jun-2006′,80000,102)

INSERT INTO Employee VALUES(1014,‘Remya’,’15-Jul-2006′,40000,102)

INSERT INTO Employee VALUES(1015,‘Tito’,’15-Aug-2008′,70000,102)

INSERT INTO Employee VALUES(1016,‘RP’,’11-Sep-2007′,30000,102)

INSERT INTO Employee VALUES(1017,‘Khiroj’,’18-Oct-2008′,40000,102)

INSERT INTO Employee VALUES(1018,‘Gopi’,’20-Nov-2005′,60000,101)

INSERT INTO Employee VALUES(1019,‘Venkat’,’12-Dec-2007′,10000,101)

INSERT INTO Employee VALUES(1020,‘JJR’,’12-Jan-2006′,15000,101)

INSERT INTO Employee VALUES(1021,‘Shivan’,’15-Feb-2008′,25000,101)

GO

/* Either of the following queries provide the rank for each employee based on salary.*/

SELECT Top 5 *, RANK() OVER (ORDER BY Salary DESC) AS Rank FROM Employee

 

Output :-

Emp_id

EmpName

DOJ

Salary

Dept_id

Rank

1013

Ila

6/15/2006

80000

102

1

1015

Tito

8/15/2008

70000

102

2

1012

Rajesh

5/14/2005

60000

103

3

1018

Gopi

11/20/2005

60000

101

3

1006

Sri

9/6/2007

50000

104

5

 

 

SELECT Top 5 *, DENSE_RANK() OVER (ORDER BY Salary DESC) AS Rank FROM Employee

 

Output :-

Emp_id

EmpName

DOJ

Salary

Dept_id

Rank

1013

Ila

6/15/2006

80000

102

1

1015

Tito

8/15/2008

70000

102

2

1012

Rajesh

5/14/2005

60000

103

3

1018

Gopi

11/20/2005

60000

101

3

1006

Sri

9/6/2007

50000

104

4

 

 

Using Partition BY clause:-

/* Either of the following queries provide the rank for each employee based on salary grouped by department*/

SELECT *, RANK() OVER (PARTITION BY Dept_id ORDER BY Salary DESC) AS Rank

FROM Employee

 

GO

SELECT *, DENSE_RANK() OVER (PARTITION BY Dept_id ORDER BY Salary DESC) AS Rank

FROM Employee

 

Note:-

There is a slight difference between RANK() and DENSE_RANK().

In case of RANK() function If two or more rows tie for a rank, each tied rows receives the same rank.

For example, if the two top employees have the same salary, they are both ranked one. The employee with next highest salary is ranked number three

 

In case of DENSE_RANK() If two or more rows tie for a rank , each tied rows receives the same rank.

For example, if the two top employees have the same salary, they are both ranked one. The employee with the next highest salary is ranked number two.

 

Posted in SQL Server | Tagged: , , | Leave a Comment »

Top 20 tamil / kollywood movie sites

Posted by chandru14 on July 27, 2008

Site URL

Content

www.behindwoods.com

Movie news, galleries, reviews

www.ayngaran.com

Movie news, galleries, reviews

www.galatta.com

Movie news, galleries, reviews

www.tamilflame.com

Movie news, galleries, reviews, mp3 songs

www.tamilmovie.com

Movies, mp3 songs, reviews, galleries, news

www.tamilgrounds.com

Movies, mp3 songs, news, galleries

www.tamilo.com

Movie news, galleries, reviews

www.cinesouth.com

Movie news, galleries, reviews

www.thiraipadam.com

Movie database

www.thenisai.com

Movie news, gossips, galleries

www.tamilstar.com

Movie news, gossips, galleries

www.tamilmp3world.com

Movie clips, mp3 songs

www.tamilpakkam.com

Movie news, reviews galleries

www.tamilpeek.com

Mp3 songs, movie clips,

www.tamil.galatta.com

Movie news, galleries, reviews

www.machchan.com

Movie news, galleries, reviews

www.tamilwire.com

Movie news, galleries, downloads

www.tamiltorrents.net

Movie downloads

www.poongamovies.com

Video downloads

www.chennaivision.com

Movie news, galleries, reviews

Posted in Top movie sites | Tagged: , , , , , | 2 Comments »

Top 20 telugu / tollywood movie sites

Posted by chandru14 on July 25, 2008

Telugu

www.GreatAndhra.com

Gossips, movie reviews, galleries

 

www.Idlebrain.com

Movie reviews, gallaries

www.AndhraVilas.com

Movie reviews, galleries,gossips,MP3 download, video songs downloads

www.saradaga1.com

Movie news, galleries, reviews

www.telugu.galatta.com

Movie news, galleries

www.vendithera.com

Movie news, galleries

www.ragalahari.com

New songs, mp3 downloads, movie news

www.raaga.com

New songs, mp3 downloads, movie news

www.telugucinema.com

Movie news, reviews, galleries

www.navatarangam.com

Gossips, movie reviews, galleries

www.nonstopcinema.com

Gossips, movie reviews, galleries

www.chitramala.com

Gossips, movie reviews, galleries

www.totaltollywood.com

Gossips, movie reviews, galleries

www.wowtelugu.com

Gossips, movie reviews, galleries

www.telugucinemastills.com

Gossips, movie reviews, galleries

www.telugupeople.com

Gossips, movie reviews, galleries

www.cinegoer.com

Gossips, movie reviews, galleries

www.searchandhra.com

Gossips, movie reviews, galleries

www.telugudreams.com

Gossips, movie reviews, galleries

Posted in Top movie sites | Tagged: , , , , , | 2 Comments »

Pagination in SQL Server / Selecting a specific range of records from a table or resultset in SQL Server

Posted by chandru14 on July 24, 2008

Hello Friends J,

 

Generally Paging / Pagination concept is used in ASP.Net to display the records in multiple pages instead of displaying all at once and this increases the response time of the web page also.

 

So far this paging is being handled by ADO.Net( I don’t know how it works internally  L) and we used to implement the logic with a complex logic in SQL server earlier

 

But in SQL Server 2005, very easyly we can apply the pagination / select specific range of records from a result seet with the help of WITH common table expression and ROW_NUMBERR() which is a ranking function

 

I hope you find this article useful J

 

Click here to download the script

 

Example:-

CREATE TABLE Dept( Dept_id INT PRIMARY KEY, DeptName VARCHAR(100), Loc VARCHAR(100))

GO

 

INSERT INTO Dept VALUES(101,‘Admin’,‘Chennai’)

INSERT INTO Dept VALUES(102,‘Sales’,‘Hyderabad’)

INSERT INTO Dept VALUES(103,‘Operations’,‘Delhi’)

INSERT INTO Dept VALUES(104,‘IT’,‘Banglore’)

 

GO

CREATE TABLE Employee(Emp_id INT PRIMARY KEY, EmpName VARCHAR(100),DOJ DATETIME, Salary MONEY, Dept_id INT REFERENCES Dept(Dept_id))

 

GO

INSERT INTO Employee VALUES(1001,‘Chandra’,’15-Dec-2004′,10000,104)

INSERT INTO Employee VALUES(1002,‘VVS’,’01-Jan-2005′,30000,104)

INSERT INTO Employee VALUES(1003,‘Pagalavan’,’15-Oct-2005′,40000,104)

INSERT INTO Employee VALUES(1004,‘ASN’,’10-Feb-2006′,20000,104)

INSERT INTO Employee VALUES(1005,‘Sathish’,’19-Dec-2005′,10000,104)

INSERT INTO Employee VALUES(1006,‘Sri’,’06-Sep-2007′,50000,104)

INSERT INTO Employee VALUES(1007,‘Sangeetha’,’10-Nov-2007′,15000,104)

INSERT INTO Employee VALUES(1008,‘Manick’,’25-Jan-2006′,20000,104)

INSERT INTO Employee VALUES(1009,‘Kanchana’,’15-Feb-2005′,19000,104)

INSERT INTO Employee VALUES(1010,‘Arun’,’15-Mar-2005′,12000,103)

INSERT INTO Employee VALUES(1011,‘Zahed’,’05-Apr-2004′,11000,103)

INSERT INTO Employee VALUES(1012,‘Rajesh’,’14-May-2005′,60000,103)

INSERT INTO Employee VALUES(1013,‘Ila’,’15-Jun-2006′,80000,102)

INSERT INTO Employee VALUES(1014,‘Remya’,’15-Jul-2006′,40000,102)

INSERT INTO Employee VALUES(1015,‘Tito’,’15-Aug-2008′,70000,102)

INSERT INTO Employee VALUES(1016,‘RP’,’11-Sep-2007′,30000,102)

INSERT INTO Employee VALUES(1017,‘Khiroj’,’18-Oct-2008′,40000,102)

INSERT INTO Employee VALUES(1018,‘Gopi’,’20-Nov-2005′,60000,101)

INSERT INTO Employee VALUES(1019,‘Venkat’,’12-Dec-2007′,10000,101)

INSERT INTO Employee VALUES(1020,‘JJR’,’12-Jan-2006′,15000,101)

INSERT INTO Employee VALUES(1021,‘Shivan’,’15-Feb-2008′,25000,101)

  

GO

/*Displays Employee records ranging from 11 to 20*/

          WITH EmpDetails AS

          (

          SELECT *, ROW_NUMBER() OVER (ORDER BY Emp_id DESC) AS RowNum FROM Employee

          )

          SELECT * FROM EmpDetails WHERE RowNum BETWEEN 11 AND 20

 

 

/*Displays Top two employees who are getting highest salary in each department*/

         

          WITH EmpDetails AS

          (

          SELECT *, ROW_NUMBER() OVER (PARTITION BY Dept_id ORDER BY Salary DESC) AS RowNum FROM Employee

          )

          SELECT * FROM EmpDetails WHERE RowNum BETWEEN 1 AND 2

Posted in SQL Server | Tagged: , , , | 2 Comments »

How to display records of a table in random order in SQL Server

Posted by chandru14 on July 21, 2008

Hello friends,

You might have come across some situations where you need to display the records from a table in a random order. Especially this is a common task for applications which conducts online examinations. 

 

We can handle this situation very easily using a SQL function NewID() which generates a unique value of type uniqueidentifier with every call

 

Example:-

CREATE TABLE Question(Question_id INT, QuestionText VARCHAR(2000))

GO

INSERT INTO Question VALUES(101,‘Tallest building?’)

INSERT INTO Question VALUES(102,‘Longest bridge?’)

INSERT INTO Question VALUES(103,‘Total countries in world?’)

INSERT INTO Question VALUES(104,‘fastest animal?’)

INSERT INTO Question VALUES(105,‘Total no of states in india?’)

INSERT INTO Question VALUES(106,‘abc?’)

INSERT INTO Question VALUES(107,‘xyz?’)

INSERT INTO Question VALUES(108,’123?’)

INSERT INTO Question VALUES(109,‘mtr?’)

GO

SELECT

           Question_id

          ,QuestionText

          ,NEWID() AS RandomKey

FROM Question

ORDER BY RandomKey

 

Click here to download the script

 

Posted in SQL Server | Tagged: , | Leave a Comment »

Generating insert statements for a table in SQL Server

Posted by chandru14 on July 20, 2008

 

 

Hello Friends,

 

As a part of maintenance tasks, some times I had to database fixes like inserting new records into the tables.Since we are following a release process, we have to insert the same data in all dev, qa and live environments. But most of the times I forgot to keep these insert statements. In such cases I always endup with using DTS even for a samll lookup table which contains small amout of data, which is a time consuming task especially at the time of releases.

 

To simplify this data transfer task, I have written the followng sproc which will generate the executable insert statements for the given table.

 

I hope you find this article is useful in your job J

 

CREATE  PROCEDURE GenerateInsertStatement(@TableName AS VARCHAR(100))

AS

BEGIN

          DECLARE @ColumnName AS VARCHAR(50)

          DECLARE @ColumnType AS VARCHAR(50)

          DECLARE @ColumnLength AS VARCHAR(50)

          DECLARE @SqlQry AS VARCHAR(8000)

          DECLARE @Values AS VARCHAR(8000)

          DECLARE CInsert CURSOR

                   LOCAL

                   FORWARD_ONLY

                   STATIC

          FOR

                   SELECT  a.[Name] As ColumnName, b.[Name] As ColumnType, a.Length  FROM SysColumns a

                   INNER JOIN SysTypes b

                   ON a.Xtype = b.XType

                   WHERE Id IN(SELECT Id FROM Sysobjects WHERE [Name] = @TableName) AND b.[Name] <> ‘sysname’

 

          SET NOCOUNT ON

 

          SET @SqlQry =

          SET @Values =

          SET @SqlQry = @SqlQry +‘SELECT ‘ +CHAR(13)+””+ ‘INSERT INTO ‘ + @TableName

          SET @SqlQry = @SqlQry + ‘(‘ +CHAR(13)

 

          OPEN CInsert

         

          FETCH NEXT FROM CInsert INTO @ColumnName, @ColumnType, @ColumnLength

         

          WHILE @@FETCH_STATUS = 0

          BEGIN

                   IF @ColumnType = ‘nchar’ OR @ColumnType = ‘nvarchar’

                   BEGIN

                             SET @SqlQry =  @SqlQry + ‘[' + @ColumnName + ']‘ + ‘,’ + CHAR(13)

                             SET @values =  @values + ”” + ‘N’ + ””+ ‘+’ + ””””” + ‘+’ + ‘REPLACE(CAST(['+@ColumnName+'] As NVARCHAR(4000)),””””,””””””)’ + ‘+’ + ””””” + ‘+’ + ”’,”’ +‘+’+CHAR(13)

                   END

                   ELSE

                   BEGIN

                             SET @SqlQry =  @SqlQry + ‘[' + @ColumnName + ']‘ + ‘,’ + CHAR(13)

                             SET @values =  @values +  ””””” + ‘ + ‘ + ‘REPLACE(CAST(['+@ColumnName+'] As VARCHAR(8000)),””””,””””””)’ + ‘+’ + ””””” + ‘+’ + ”’,”’ +‘+’+CHAR(13)

                   END

                   FETCH NEXT FROM CInsert INTO @ColumnName, @ColumnType, @ColumnLength

          END

 

          SET @SqlQry = SUBSTRING(@SqlQry,1,LEN(@SqlQry)-2)+‘)’+CHAR(13)+ ‘VALUES’+‘(‘  + ””+ ‘+’ + CHAR(13)

          SET @Values = SUBSTRING(@Values,1,LEN(@Values)-4)+‘)’+””

          SET @SqlQry = @Sqlqry + @Values + CHAR(13) + ‘ FROM ‘ + @TableName

 

          SELECT @SqlQry

 

          CLOSE CInsert

          DEALLOCATE CInsert

END

 

Go

 

 

Example:-

 

Create Table Employee (Employee_id Int, FirstName Varchar(100), LastName Varchar(40), DOB DateTime)

Go

 

Insert Into Employee values(101,‘Chandra’,‘Y’,’01-01-1980′)

Insert Into Employee values(101,‘VVS’,‘V’,’01-01-1981′)

Insert Into Employee values(101,‘Satish’,‘S’,’01-01-1980′)

Insert Into Employee values(101,‘Shivan’,‘M’,’01-01-1983′)

 

Go

Exec GenerateInsertStatement ‘Employee’ This statement produces a select statement as below, copy this into SQL Editor and run the query

 

Go

SELECT  ‘INSERT INTO Employee( [Employee_id], [DOB], [FirstName], [LastName]) VALUES(‘+ ”” + REPLACE(CAST([Employee_id] As VARCHAR(8000)),””,”””)+””+‘,’+ ”” + REPLACE(CAST([DOB] As VARCHAR(8000)),””,”””)+””+‘,’+ ”” + REPLACE(CAST([FirstName] As VARCHAR(8000)),””,”””)+””+‘,’+ ”” + REPLACE(CAST([LastName] As VARCHAR(8000)),””,”””)+””+‘)’  FROM Employee

 

OutPut:-

INSERT INTO Employee( [Employee_id], [DOB], [FirstName], [LastName]) VALUES(’101′,‘Jan  1 1980 12:00AM’,‘Chandra’,‘Y’)

INSERT INTO Employee( [Employee_id], [DOB], [FirstName], [LastName]) VALUES(’101′,‘Jan  1 1981 12:00AM’,‘VVS’,‘V’)

INSERT INTO Employee( [Employee_id], [DOB], [FirstName], [LastName]) VALUES(’101′,‘Jan  1 1980 12:00AM’,‘Satish’,‘S’)

INSERT INTO Employee( [Employee_id], [DOB], [FirstName], [LastName]) VALUES(’101′,‘Jan  1 1983 12:00AM’,‘Shivan’,‘M’)

 

Click here to download the script

Note:-

1.We can add where clause to the above Statement like any other SQL query to fitler the output.

2.Currently the above sproc doesn’t work properly if the table contains large data types like ntext, text etc

3.If any column / field in a particular record contains NULL value then insert statement for that record will be NULL

Posted in SQL Server | Tagged: , , , , | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.