Click here to Skip to main content
15,889,808 members
Home / Discussions / Database
   

Database

 
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 
GeneralRe: Need your opinion on querying data for presentation on winforms / web page and for reports Pin
Nayan Ambaliya12-May-13 15:10
Nayan Ambaliya12-May-13 15:10 
QuestionCannot insert the value NULL into column Pin
Member 991209112-May-13 12:33
Member 991209112-May-13 12:33 
AnswerRe: Cannot insert the value NULL into column Pin
Mycroft Holmes12-May-13 15:02
professionalMycroft Holmes12-May-13 15:02 
AnswerRe: Cannot insert the value NULL into column Pin
Bikash Prakash Dash13-May-13 19:27
Bikash Prakash Dash13-May-13 19:27 
GeneralRe: Cannot insert the value NULL into column Pin
Mycroft Holmes13-May-13 20:55
professionalMycroft Holmes13-May-13 20:55 
QuestionComparing 2 values in same column SQL (C#) Pin
Member 991209111-May-13 5:56
Member 991209111-May-13 5:56 
AnswerRe: Comparing 2 values in same column SQL (C#) Pin
Eddy Vluggen11-May-13 6:08
professionalEddy Vluggen11-May-13 6:08 
GeneralRe: Comparing 2 values in same column SQL (C#) Pin
Member 991209112-May-13 6:22
Member 991209112-May-13 6:22 
AnswerRe: Comparing 2 values in same column SQL (C#) Pin
PIEBALDconsult11-May-13 7:22
mvePIEBALDconsult11-May-13 7:22 
AnswerRe: Comparing 2 values in same column SQL (C#) Pin
Mycroft Holmes11-May-13 12:50
professionalMycroft Holmes11-May-13 12:50 
QuestionQuestion Related Database transfer Pin
shubham Dev10-May-13 21:09
shubham Dev10-May-13 21:09 
AnswerRe: Question Related Database transfer Pin
Sandeep Mewara10-May-13 23:31
mveSandeep Mewara10-May-13 23:31 
QuestionNo new tables in database after executed query Pin
Member 991209110-May-13 12:50
Member 991209110-May-13 12:50 
AnswerRe: No new tables in database after executed query Pin
JammoD8710-May-13 21:36
JammoD8710-May-13 21:36 

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.