Viewing 15 posts - 76 through 90 (of 921 total)
SELECT Goods, SUM(Quantity) Both, SUM(CASE WHEN Quantity > 0 THEN Quantity END) Pos, SUM(CASE WHEN Quantity < 0 THEN Quantity END) Neg
FROM Table
GROUP BY Goods
ORDER BY Goods, Both
March 11, 2004 at 5:42 am
The method depends upon whether and how you have used DRI...
If, as your "schema" pseudocode implies, you have not used DRI, you can just use UPDATE statements on each table. ...
March 11, 2004 at 5:11 am
There are no "on-disk compiled versions of the stored procedures."
March 11, 2004 at 5:03 am
No, but you could try something like this:
DECLARE @v-2 nvarchar(258)
DECLARE ViewCur CURSOR FOR
SELECT QUOTENAME(Table_Schema + '.' + Table_Name)
FROM INFORMATION_SCHEMA.VIEWS
OPEN ViewCur
FETCH NEXT FROM ViewCur INTO @v-2
WHILE @@FETCH_STATUS = 0
BEGIN
EXEC('EXEC sp_refreshview '...
March 10, 2004 at 4:31 pm
March 10, 2004 at 3:45 pm
Sorry, I guess that's jargon.
OLTP is OnLine Transaction Processing and DSS is Decision Support System. Although I think the term DSS is now...
March 10, 2004 at 7:07 am
March 10, 2004 at 5:54 am
A UDF will both perform worse and cause the maintenance programmer to deal with another object. I see nothing wrong with the readablity of the OP's solution, and that's the reason...
March 10, 2004 at 5:47 am
The way I usually do this in an OLTP system by creating an inventory transaction table. That way one can ascertain inventory balances at any point, plus you have the added...
March 10, 2004 at 5:21 am
DELETE p
FROM Prod p JOIN Audit a ON p.UserID = a.UserID AND p.EventID = a.EventID AND p.Event_Date = a.Orig_Event_Date
March 9, 2004 at 7:40 pm
You could use the SUM() aggregate function along with a CASE expression:
SUM(CASE WHEN Pupil_Details.LeaveDate BETWEEN @StartDate AND @EndDate THEN 1 END) AS 'LeaverCount'
March 9, 2004 at 3:01 pm
Actually, that doesn't help much. That could (with some nasty manual reformatting) be turned into sample data, but we (well, I, anyway) need more than just that. Script out and...
March 9, 2004 at 2:27 pm
Viewing 15 posts - 76 through 90 (of 921 total)