Viewing 13 posts - 1 through 13 (of 13 total)
Andy DBA (8/10/2009)
August 11, 2009 at 10:59 pm
Robert,
You can stop an update from occurring by issuing a rollback within the trigger.
October 14, 2008 at 5:44 pm
In another thread you mentioned that you are using SQL2000, so this code won't work for you, sorry. As this is a SQL2005 forum I assumed you were using...
July 14, 2008 at 9:49 pm
CTEs and ranking functions are not compatible with SQL2000. You will have to use the derived table approched mentioned earlier.
July 14, 2008 at 9:47 pm
Create the tables using three part names, then you don't need any USE statements in your procedure.
CREATE TABLE DatabaseName.dbo.TableName ...
July 14, 2008 at 9:34 pm
I'm going to assume that items are in a separate table to order.
with BuyerOrder as
(
select
b.order_id, b.buyer_id, o.order_desc, i.item_desc,...
July 14, 2008 at 9:26 pm
Assuming this is SQL2005 the following query will work.
with BuyerOrder as
(
select
b.order_id, b.buyer_id, o.order_desc,
row_number() over (partition by b.buyer_id order by b.order_id) as RowNum
from buyer b
join [order] o
on b.order_id = o.order_id
)
select...
July 14, 2008 at 8:55 pm
OK, based on the original question posed, your solution is valid.
I guess I got carried away and lost sight of the "requirements" :blush:
October 9, 2007 at 1:24 am
Sure, the value 9876504321.1203456 as used in the examples above. Even after changing the code to use DECIMAL(38, 12) the result is 98765043211203461 instead of 98765043211203456.
October 9, 2007 at 12:55 am
Peter Larsson (10/8/2007)
DECLARE@Original DECIMAL(10, 5)SET@Original = 1078.734
SELECT@Original,
REPLACE(REPLACE(REPLACE(RTRIM(REPLACE(REPLACE(STR(@Original, 15, 5), ' ', '#'), '0', ' ')), ' ', '0'), '#', ''), '.', '')
Unfortunately the STR function takes a float as a...
October 8, 2007 at 5:34 pm
The error in Jeff's code is easy to fix by setting @Result to FLOOR(@Original) before the loop, however this makes it identical to test 2 except for the fact that...
October 7, 2007 at 7:58 pm
I believe the following code will do what you want. It should also handle the case where the GroupStartDOW = 7 and GroupEndDOW = 1.
SELECT @RateGroupID = RateDeckGroupID
FROM TelecomRateDeckGroup
WHERE...
September 26, 2007 at 5:57 pm
I would try using the IBM DB2 UDB for iSeries IBMDASQL OLD DB Provider.
Check out Optimizing Distributed Queries for details of what queries are passed through to the remote server. Also...
September 24, 2007 at 5:55 pm
Viewing 13 posts - 1 through 13 (of 13 total)