SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 update two tables help
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

learntsql
Aged Yak Warrior

India
507 Posts

Posted - 02/01/2010 :  09:49:40  Show Profile  Reply with Quote
Hi...
I have two tables Child table and Master table
Child table contans morethan twenty Datetime columns where i am currently storing Actual dateTime values.
and Master table contains DateID which is autogenerated and DateValue(contains Actual dateTime value) columns.

Now My requirement is I have to update child table's all DateTime Columns ActualData(dateTime) with DateID column data(Master table ID).
What is the best way to update.?
TIA.

DonAtWork
Flowing Fount of Yak Knowledge

2143 Posts

Posted - 02/01/2010 :  10:38:17  Show Profile  Reply with Quote
Inner join should work, as long as you are not using hh:mm:ss, or at least setting it all to 0.

http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspx
How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page

learntsql
Aged Yak Warrior

India
507 Posts

Posted - 02/02/2010 :  00:37:55  Show Profile  Reply with Quote
In child table it has more than one datetime columns but in master table only one datetime column.
How would be the join condition?
Go to Top of Page

harsh_athalye
Flowing Fount of Yak Knowledge

India
5509 Posts

Posted - 02/02/2010 :  01:35:26  Show Profile  Visit harsh_athalye's Homepage  Click to see harsh_athalye's MSN Messenger address  Send harsh_athalye a Yahoo! Message  Reply with Quote
Could you please post actual table structure and what the expected output should look like?

Harsh Athalye
http://www.letsgeek.net/
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000