Skip to main content

Posts

Showing posts from August, 2010

Translate my page with google translate

A s we all know the world is getting multilingual,in our daily lives, specially on internet we find the things which are in another language and we need a way to translate it into the language we understand As we all know about Google Translate is the place we all will go and paste the content that we want to translate,but what if we have power of that tool into our website or web page,yes it is possible with GOOGLE TRANSLATE (which is able to translate the page into more than 50 languages) to have that integrated into your own website,today we will see how with example This tool is available from quite sometimes now,but the point is very less of the people from developer community are aware of this,so the reason behind this post is to show how any developer can make use of it and make it so simple to translate their pages... The process... The only need to have the power of translation on your website is copy and paste snippet of following code into your web page <di

Delete duplicate records from table even when there is no key field

Hi all,yesterday only i was discussing with my colleague Kamlesh Samnani who is MCTS about deleting records which does not have any primary key field based on which we can delete the data (actually he only fired this question yesterday to me) so i thought to write a blog post about it,there are many posts which talk about deleting duplicate records from the table which has some key field,so i started working on the query and what i got is what i am gonna write here. Lets start creating the table and after inserting some data in it,we will fire our query in that and will check the output as well CREATE TABLE [dbo].[Employee]( [EmployeeId] [int] NULL, [Salary] [money] NULL ) ON [PRIMARY] INSERT INTO Employee VALUES(1,1000) INSERT INTO Employee VALUES(1,2000) INSERT INTO Employee VALUES(1,3000) INSERT INTO Employee VALUES(2,2000) INSERT INTO Employee VALUES(3,3000) INSERT INTO Employee VALUES(3,4000) INSERT INTO Employee VALUES(4,4000) INSERT INTO Employee VALUES(4,5000

Roll back truncate command

How many times it has happened that somebody asks u a difference of Truncate and Delete,Atleast i am the person who used to say the very first point is that "TRUNCATE CAN NOT BE ROLLED BACK" untill i came across the blog post of Pinal Dave So,the best way to understand any point is start with sample,here what we will do is we will create one table and we will create one transaction and under which we will be doing our truncate thing...and finally we will observe the result Lets us start it by creating sample table and our transaction like following as shown below CREATE TABLE temp (Name varchar(50)) INSERT INTO temp SELECT 'Moe' INSERT INTO temp SELECT 'Larry' INSERT INTO temp SELECT 'Curley' BEGIN TRAN SELECT * FROM temp TRUNCATE TABLE temp SELECT * FROM temp ROLLBACK TRAN SELECT * FROM temp DROP TABLE temp Now if you just copy and paste this above in your query editor and hit F5 (RUN),you would be surprise to see that even