dbTalk Databases Forums  

update a field drom another table

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss update a field drom another table in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
cemal
 
Posts: n/a

Default update a field drom another table - 03-11-2007 , 04:09 PM






hi guys.

I have two table ; categories and products
categories table; catid (int) catname, and products table has
catid(int), catname

I want to update products.catid=catgory.catid where
category.catname=products.catname

never mind please, as soon as I started writing my message I figured
it out.

UPDATE Products
SET catid = Categories.CategoryID
FROM Products INNER JOIN
Categories ON Products.CategoryID =
Categories.CategoryName

this sql command solved my issue.

thank you all for creating an option to get help.

Cemal
Milwaukee


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.