Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Update Problem Expand / Collapse
Author
Message
Posted Friday, July 19, 2013 4:44 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 3:17 PM
Points: 2,305, Visits: 2,783
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’! **
Post #1475370
Posted Friday, July 19, 2013 5:56 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Tuesday, September 9, 2014 3:27 AM
Points: 1,893, Visits: 2,329
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/
Post #1475406
Posted Friday, July 19, 2013 12:40 PM


SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, June 17, 2014 10:17 AM
Points: 30, Visits: 278
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



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.
Post #1475642
Posted Friday, July 19, 2013 10:52 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Today @ 3:00 AM
Points: 100, Visits: 306
Thanks Hanshi my problem is solve
Post #1475726
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse