Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Update Problem


Update Problem

Author
Message
HanShi
HanShi
Hall of Fame
Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)

Group: General Forum Members
Points: 3051 Visits: 3633
P.S.: No need to use all capital letters


You can execute a simple update command to alter the value in the shift_table (the @new_value and @shift_id are variables with the values from the grid)
update shift_table
set shift = @new_value
where shift_id = @shift_id



If you also need to update the DATA table with the date of the modification, you need to additionally execute the update statement below (use the same value for @shift_id as above statement):

update data
set date = getdate()
where shift_id = @shift_id



** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
kapil_kk
kapil_kk
SSCrazy
SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

Group: General Forum Members
Points: 2427 Visits: 2763
PLease provide the proper DDL statements and data so that we can help you in your problem....
Refer this link whever you post any problem:
http://www.sqlservercentral.com/articles/Best+Practices/61537/

_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Voide
Voide
SSC Rookie
SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)

Group: General Forum Members
Points: 30 Visits: 280
immaduddinahmed (7/19/2013)
I AM MAKING A APPLICATION IN c# THERE IS A GRID THAT SHOWS

SHIFT ID , SHIFT AND DATE

USER SEARCH DATE AND IN GRID DATE , SHIFT AND SHIFT ID SHOWS

THEN USER CHANGE SHIFT AND ON SHIFT TABLE THAT SHIFT NAME CHANGE OF THAT ID.

SHIFT ID AND DATE COME FROM SHIFT DETAILS TABLE

THIS IS A DATA

SHIFT ID----------DATE
-----1------------1/1/2013
-----2------------2/1/2013
-----3-----------4/5/2013
-----4------------6/24/2013

AND SHIFT COME FROM SHIFT TABLE

THIS IS A DATA OF SHIFT TABLE

SHIFT ID----------SHIFT
-----1------------A
-----2------------B
-----3-----------C
-----4------------D


WHEN USER EXECUTE UPDATE QUERY ITS CHANGES SHIFT COLUMN VALUE OF SHIFT TABLE

I HOPE U UNDER STAND SIR

ONE THING MORE HE CAN ONLY CHANGE A SHIFT FROM THE GRID HE CANNOT CHANGE ID



Ermm Really no need to start posting in all caps when the people here are actually trying to help you considering your tone. "don't fix values plz" isn't a valid response to someone who is attempting to generate code out of thin air because you haven't posted a single line of your own.

No-one is here to work for you.
immaduddinahmed
immaduddinahmed
SSC-Enthusiastic
SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)

Group: General Forum Members
Points: 147 Visits: 420
Thanks Hanshi my problem is solve
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search