Forum Replies Created

Viewing 15 posts - 91 through 105 (of 135 total)

  • RE: Numbers - getting the right decimal places

    Found some things and put them together to get this,

    work in progress but promising

    DECLARE @TestNum float

    SET @TestNum = 99.001 --0.123456780000000 --99.1 --90

    select Case when (CHARINDEX('.',REVERSE(@TestNum))-PATINDEX('%[^0]%',REVERSE(@TestNum))) >...

  • RE: Numbers - getting the right decimal places

    Sorry,

    when I run these I get

    10.1

    and

    10.8

    when really I would like

    10.08

    and

    10.8

    Many Thanks for your help,

    Oliver

  • RE: Numbers - getting the right decimal places

    Sorry, thats what I did try. Did you mean to change the two lines.

    Many Thanks,

    Oliver

  • RE: Numbers - getting the right decimal places

    Hi,

    Thanks for the reply using numeric

    SELECT CAST(10.086 AS NUMERIC(20 , 2))

    SELECT CAST (10.8 AS NUMERIC(20 , 2))

    returns

    10.09

    and 10.80 - but I would like it to report 10.8 because otherwise...

  • RE: Speeding up a Spatial query

    See below.

    Thanks for your help

    CREATE TABLE [dbo].[SPATIAL_USGS_PROVINCE](

    [OBJECT_ID] [int] IDENTITY(1,1) NOT NULL,

    [numeric](25, 5) NULL,

    [PERIMETER] [numeric](25, 5) NULL,

    [WEP_PRVG_] [numeric](11, 0) NULL,

    [WEP_PRVG_I] [numeric](11, 0) NULL,

    [int] NULL,

    [NAME] [varchar](50) NULL,

    [TYPE] [varchar](2) NULL,

    [REG] [smallint]...

  • RE: Speeding up a Spatial query

    Hi,

    Yes I would be very interested to see what function you have developed. I am trying to find out what polygon the lat long point lies in for thousands of...

  • RE: Speeding up a Spatial query

    Hi,

    Thank you for your continued support. I already have Alastair's superb book.

    I have attached the 3 execution plans to for the 3 queries in your post. They all use the...

  • RE: Speeding up a Spatial query

    Sorry for the incorrect execution plans, I was running a query which included the function.

    The core part of my scalar function is

    DECLARE @intersect nvarchar(255)

    declare @fet geometry

    declare @longitude float

    declare @latitude float

    set...

  • RE: Speeding up a Spatial query

    Hi,

    Thanks for the reply I have put the code into the modified trigger as below

    ALTER FUNCTION [dbo].[GET_USGS_PROVINCE]

    (@latitude float, @longitude float)

    RETURNS nvarchar(255)

    AS

    BEGIN

    -- Declare the return variable here

    DECLARE @intersect nvarchar(255)

    declare @fet geometry

    --...

  • RE: Trigger with merge statement

    Hi thank you for your continued help with this.

    I added the trigger and got an error trying to run it, it still looks like I cant reference a vairable outside...

  • RE: Speeding up a Spatial query

    Hi,

    Many thanks for the response.

    I have uploaded two sql plans one before rebuilding the spatial index on after.

    For 500 rows it took 1min 40secs

    Currently running SP1 SQL Server Standard.

    Thanks for...

  • RE: Trigger with merge statement

    Thank you very much for taking the time to work on this I really appreciate it.

    I added you code and when I try to run it I get this error

    Msg...

  • RE: Trigger with merge statement

    Hi thanks for the reply,

    yes this does work, the only issue with this is that I only want it to delete records that I have deleted in the table, not...

  • RE: Trigger with merge statement

    Also I have tried with this slight code change.

    But get error:

    Msg 5334, Level 16, State 2, Procedure POP_HEADER_LOGS, Line 108

    The identifier 'deleted.PK_INDEX' cannot be bound. Only target columns are allowed...

  • RE: Trigger help

    Thanks for your comments.

    The issue I am having with this is that when I append many rows to the table with the trigger on I recieve and error, however when...

Viewing 15 posts - 91 through 105 (of 135 total)