Viewing 15 posts - 751 through 765 (of 897 total)
There is no easy way to remove a negative condition. It depends on the data in the table and the indexes. Try converting the query using a positive condition as...
May 13, 2010 at 11:45 pm
WayneS (5/13/2010)
h2sut (5/13/2010)
Hello: This worked!! I really appreciate your help on this i cant thank you a enough. Thanks againbe bless
I would caution you: if you can't...
May 13, 2010 at 10:35 pm
h2sut (5/13/2010)
I not sure how that works. I have over 959 rows of data. I saw that you mention i could use a function that did the same thing....
May 13, 2010 at 7:02 am
This should give you the expected result
DECLARE@tblTable TABLE
(
Col1 INT,
Col2 INT,
Col3 INT,
Col4 INT
)
INSERT@tblTable
SELECT65,55,0,67 UNION ALL
SELECT1,3,2,5 UNION ALL
SELECT24, 21, 3, 19
; WITH cte_Table AS
(
SELECTROW_NUMBER() OVER ( ORDER BY Col1 ) ID, *
FROM@tblTable
),...
May 12, 2010 at 11:35 pm
You can also use a CASE statement for the same
UPDATEdbo.Mytable
SET@Path = COALESCE( @Path, '' ),
@PathReadOnly = COALESCE( @PathReadOnly, '' ) ,
Path = CASE WHEN @Path = '' THEN Path ELSE...
May 12, 2010 at 5:33 am
You gave us what you didn't want instead of what you wanted.
But still, i hope this will give you what you want
; WITH cte_Dates AS
(
SELECTcode, DateTimes, Amount
FROM@Table
UNION ALL
SELECTcode, DateTimes +...
May 7, 2010 at 5:45 am
This should give you the expected output without a Tally table
UPDATEfprj
SETfprj.periodid = ISNULL( fper.periodid, 1 ) + fprj.rownum - 1
FROM(
SELECTROW_NUMBER() OVER( PARTITION BY prjid ORDER BY periodid ) rownum, periodid,...
May 7, 2010 at 5:28 am
Jason P. Burnett (5/4/2010)
May 4, 2010 at 11:33 pm
I think you can use an INSTEAD OF trigger for the same. There you have to make sure that you delete/update the related data in proper order and then delete/update...
May 4, 2010 at 11:19 pm
You will have to run an UPDATE query like below
UPDATEform5Test
SETIndUniqId = STUFF(IndUniqId, 7, 1, '/0')
April 23, 2010 at 12:23 am
This should work for you
SELECTCOALESCE( A.RowID, B.RowID ) RowID, DataValueA, DataValueB
FROM(
SELECTROW_NUMBER() OVER ( PARTITION BY RowID ORDER BY DataValueA ) RowNum, *
FROM@TableA
) A
FULL OUTER JOIN(
SELECTROW_NUMBER() OVER ( PARTITION BY RowID...
April 22, 2010 at 11:23 pm
I hope this helps..
UPDATES
SETCountUsedTogether = S.CountUsedTogether - 1
FROMSummary S
INNER JOIN deleted D1 ON S.IdItem1 = D1.IdItem
INNER JOIN deleted D2 ON S.IdItem2 = D2.IdItem
WHERED1.IdTrans = D2.IdTrans
April 22, 2010 at 10:49 pm
ard_dicted (4/22/2010)
When I delete a transaction which using item with ID 2,3, and 4
Does this mean you are running the query
DELETE FROM DetailTrans WHERE IdItem IN (2,3,4)
And how is DetailTrans...
April 22, 2010 at 3:40 am
Nice question. Not many know that even a TRUNCATE can be rolled back.
Some people as mentioned might get tricked by the INSERT statement and may choose the wrong answer.
But on...
April 22, 2010 at 12:32 am
It would be of great help if you provide the table structure of the table on which you are creating the trigger and the table on which you are doing...
April 21, 2010 at 10:28 pm
Viewing 15 posts - 751 through 765 (of 897 total)