using the alias name in the update stmt using t-sql script

Today I have learnt that we can use the alias name in the Update statement in SQL Server. I thought it would be helpful if I post this. Below is the explanation for this

We have taken a table that need to be updated by joining multiple tables. Here, we can see that in the “Update table” statement we have used an alias name “emp”:

UPDATE emp SET 
       ename = temp.ename
FROM #WTemp_Emp temp
INNER JOIN dbo.TBL_Employee emp
   ON emp.EmpID=temp.EmpID

The above statement updates the ename in EMP table in the database by joining the two table emp and temp table (which contains the eid, ename information).

Leave a comment

33 Comments

  1. Wow, amazing weblog structure! How long have you been blogging for?
    you make running a blog look easy. The full glance of your site is
    excellent, as neatly as the content material!

  2. Wonderful beat ! I wish to apprentice at the same time as you amend your site, how could i subscribe for a blog
    site? The account aided me a applicable deal. I have been
    tiny bit acquainted of this your broadcast offered vibrant clear
    idea

  3. Thanks for sharing your thoughts about powerful bodybuilding supplements.

    Regards

  4. Way cool! Some extremely valid points! I appreciate you
    writing this article and also the rest of the site is also really good.

  5. Very shortly this site will be famous among all blogging viewers, due to it’s nice articles or reviews

  6. Awesome post! I will keep an on eye on your blog.

  7. An engrossing communication is worth note. I guess that you should make many on this topic, it power not be a bias topic but generally people are not enough to utter on much topics.

  8. Of course high resolution film quality consists of much memory, that’s why it gives you better feature.

  9. There is evidently a lot to know about this. I believe you made some good points also.

  10. Couldn’t have said it better myself.

  11. Awesome post! I will keep an on eye on your blog.

  12. Awesome post! I will keep an on eye on your blog.

  13. This is by far my favorite blog! Keep up the good work!

  14. Couldn’t have said it better myself.

  15. I love reading this blog. Keep up the good work!

  16. Very insightful post. I will keep an eye on your blog in the future.

  17. I got what you will, thanks for swing up. Woh I am happy to maturate this website through google. Thanks For Share using the alias name in the update stmt using t-sql script Suneetha's Blog.

  18. I got what you destine, thanks for swing up. Woh I am glad to conclude this website finished google. Thanks For Share using the alias name in the update stmt using t-sql script Suneetha's Blog.

  19. I got what you mean, thanks for putting up. Woh I am cheerful to label this website through google. Thanks For Share using the alias name in the update stmt using t-sql script Suneetha's Blog.

  20. An engrossing communicating is designer statement. I think that you should create more on this topic, it might not be a preconception individual but mostly group are not enough to utter on such topics. To the next. Cheers like your using the alias name in the update stmt using t-sql script Suneetha's Blog.

  21. An stimulating communication is designer statement. I believe that you should pen statesman on this substance, it mightiness not be a prejudice field but generally grouping are not enough to talk on such topics. To the next. Cheers like your using the alias name in the update stmt using t-sql script Suneetha's Blog.

  22. Couldn’t have said it better myself.

  23. Incomparable Blog. I tot up this Blog to my bookmarks.Thanks for alluring the in the nick of time b soon to examine this, I lean to strongly yon it and fondness information more on this topic.

  24. Love your blog!

  25. I would like to see you write about web hosting and social network as they are very interesting topics as well.
    Continue!!!

  26. A formidable share, I just given this onto a colleague who was doing a bit of evaluation on this. And he the truth is bought me breakfast as a result of I discovered it for him.. smile. So let me reword that: Thnx for the treat! But yeah Thnkx for spending the time to debate this, I really feel strongly about it and love reading more on this topic. If doable, as you become expertise, would you mind updating your weblog with extra particulars? It’s highly useful for me. Massive thumb up for this blog publish!

  27. This really answered my drawback, thank you!

  28. Couldn’t have said it better myself.

  29. Incomparable Blog. I tot up this Blog to my bookmarks.Thanks for alluring the in the nick of time b soon to examine this, I lean to strongly yon it and fondness information more on this topic.

  30. An really intriguing examine, I may possibly not agree completely, but you do make some quite legitimate factors. 94622

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: