Click here to Skip to main content
15,903,388 members
Home / Discussions / Database
   

Database

 
GeneralRe: Create a procedure to change date value of a column in a table ? (SQL) Pin
Corporal Agarn16-May-13 3:49
professionalCorporal Agarn16-May-13 3:49 
AnswerRe: Create a procedure to change date value of a column in a table ? (SQL) Pin
Eddy Vluggen16-May-13 3:16
professionalEddy Vluggen16-May-13 3:16 
GeneralRe: Create a procedure to change date value of a column in a table ? (SQL) Pin
taibc16-May-13 3:34
taibc16-May-13 3:34 
GeneralRe: Create a procedure to change date value of a column in a table ? (SQL) Pin
Eddy Vluggen16-May-13 3:48
professionalEddy Vluggen16-May-13 3:48 
GeneralLooking for the best solution Pin
MacAriel15-May-13 8:40
MacAriel15-May-13 8:40 
QuestionDeploying SSIS Package and calling it from Console application Pin
indian14315-May-13 7:28
indian14315-May-13 7:28 
AnswerRe: Deploying SSIS Package and calling it from Console application Pin
unclepaul15-May-13 8:47
unclepaul15-May-13 8:47 
AnswerRe: Deploying SSIS Package and calling it from Console application Pin
Mycroft Holmes15-May-13 18:00
professionalMycroft Holmes15-May-13 18:00 
QuestionCreate trigger that executes on date Pin
damokk15-May-13 3:54
damokk15-May-13 3:54 
AnswerRe: Create trigger that executes on date Pin
Corporal Agarn15-May-13 6:31
professionalCorporal Agarn15-May-13 6:31 
AnswerRe: Create trigger that executes on date Pin
Mycroft Holmes15-May-13 17:55
professionalMycroft Holmes15-May-13 17:55 
GeneralRe: Create trigger that executes on date Pin
damokk15-May-13 23:06
damokk15-May-13 23:06 
GeneralRe: Create trigger that executes on date Pin
damokk15-May-13 23:08
damokk15-May-13 23:08 
GeneralRe: Create trigger that executes on date Pin
Mycroft Holmes15-May-13 23:33
professionalMycroft Holmes15-May-13 23:33 
GeneralRe: Create trigger that executes on date Pin
damokk15-May-13 23:47
damokk15-May-13 23:47 
QuestionRegarding SSIS (SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "Excel" failed with error code 0xC0202009.) Pin
Ravikiran72p14-May-13 21:09
Ravikiran72p14-May-13 21:09 
AnswerRe: Regarding SSIS (SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "Excel" failed with error code 0xC0202009.) Pin
Mycroft Holmes14-May-13 23:24
professionalMycroft Holmes14-May-13 23:24 
QuestionRegarding DB2 Rows to Column String Concatenation Pin
SenthilKumar-8313-May-13 5:05
SenthilKumar-8313-May-13 5:05 
QuestionHow to Update this request Balance Column Pin
Robymon13-May-13 1:49
Robymon13-May-13 1:49 
AnswerRe: How to Update this request Balance Column Pin
Blue_Boy13-May-13 4:14
Blue_Boy13-May-13 4:14 
AnswerRe: How to Update this request Balance Column Pin
gvprabu13-May-13 5:36
gvprabu13-May-13 5:36 
AnswerRe: How to Update this request Balance Column Pin
Jörgen Andersson13-May-13 23:53
professionalJörgen Andersson13-May-13 23:53 
I wouldn't do that. It's against the "Rules" of normalization. You don't want to make a row dependant on another row in the same table.
Think of all the fuzz to update the table when you find out someone inserted some wrong data last year, or when HR decides to change the rules (quite probable actually).

So you should make a query that gets you the result you want instead.
Hint, checkout ROLLUP.
For example:
SQL
SELECT EmpID,
       CASE WHEN (GROUPING(Leave_Year) = 1) THEN 'Total Balance'
            ELSE ISNULL(Leave_Year, 'UNKNOWN')
       END AS Leave_Year,
       SUM(Balance) AS Balance
FROM   MyTable
GROUP BY EmpID, Leave_Year WITH ROLLUP


I haven't tested this code, but it should give you an idea.
I also assumed SQLServer, Different Databases have different syntax. Use Google.
Be excellent to each other. And... PARTY ON, DUDES!
Abraham Lincoln

QuestionMigration process. Pin
nagesh2113-May-13 0:00
nagesh2113-May-13 0:00 
QuestionNeed your opinion on querying data for presentation on winforms / web page and for reports Pin
Nayan Ambaliya12-May-13 12:53
Nayan Ambaliya12-May-13 12:53 
AnswerRe: Need your opinion on querying data for presentation on winforms / web page and for reports Pin
Mycroft Holmes12-May-13 15:05
professionalMycroft Holmes12-May-13 15:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.