update one coulmn of data

Posted by Venkatesh under Sql Server on 4/27/2011 | Points: 10 | Views : 881 | Status : [Member] | Replies : 5
Hi

i want dates in one table, these dates i want update in another table.

Thanks
Venkatesh.p




Responses

Posted by: Ndebata on: 4/27/2011 [Member] Starter | Points: 25

Up
0
Down
If I have understood your requirement

you want to automatically update dates in 2nd table , when there is an update in date in the 1st table, you use a trigger for update in the 1st table on data fields,

Else please describe your requirement.

Venkatesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Prabhakar on: 4/27/2011 [Member] [MVP] Starter | Points: 25

Up
0
Down
HI Venkatesh

say ur full requirement . . in which condition u want to do this . .some columns are same in both 2 table ... so update the base on same column . .




Best Regard's
Prabhakar

Venkatesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Venkatesh on: 4/27/2011 [Member] Starter | Points: 25

Up
0
Down
ok

i have table in that it will countinues dates from april like 01/04/2011 to 02/04/2011
in another table 5 records are there in that having one coulmn is there like createddate

i need update this column with those dates like

01/04/2011
02/04/2011
03/04/2011
04/04/2011

I need like this in first table which is having 5 records

Thanks
Venkatesh.P



Venkatesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Lakn2 on: 5/13/2011 [Member] Starter | Points: 25

Up
0
Down
UPDATE mytable SET mytable.jdate = '2011-05-14'
FROM mytable INNER JOIN mytable1
ON mytable.jdate = mytable1.jdate where mytable.jdate='2011-05-13'


try the above query

Thanks&Regards
LakshmiNarayana Nalluri.

Venkatesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Lakn2 on: 5/13/2011 [Member] Starter | Points: 25

Up
0
Down
Try using below link .i hopeit helps you

http://blogs.msdn.com/b/sqltips/archive/2005/06/13/output-clause.aspx

Thanks&Regards
LakshmiNarayana Nalluri.

Venkatesh, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response