Forum Replies Created

Viewing 15 posts - 1,591 through 1,605 (of 3,544 total)

  • RE: TOP 1000.....

    Only if there is a unique key which you can use as part of the select to get greater than the value in the last row retrieved. I don't think...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Stored procedure problem

    As far as I can tell the insert will always take place as @RetCode is never set to zero because you

    declare @InvoiceCheck and @InvoiceDetailCheck but do not set their values...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Determining first unit total by month window

    Don't know about slick but

    SELECT MyGroup,MIN(MyMonth) AS [MyMonth]

    FROM (SELECT a.MyGroup,a.MyMonth,SUM(b.MyUnits) As [MyUnits]

    FROM #MyHistory a

    INNER JOIN #MyHistory b

    ON b.MyGroup = a.MyGroup

    AND b.MyMonth >= a.MyMonth AND...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Sum or aggregate operation......

    What is the delimiter for the csv file (hard to tell from the post)

    The data you posted is formatted as 6 char columns (although one maybe date) before the numbers,...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Programming Regular Expressions

    Unless there is more complex validation, I would not use regx, I would

    create errormicrtable to contain invalid data

    create micrtable containing valid MICR codes

    and use the following to validate and test...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Merging 3 statements to 1

    The update statement I posted will retrieve the latest value (@before), update the value (+1) and retrieve the new value (@after) in one go.

    I presume you want the current value...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Merging 3 statements to 1

    What is the purpose of ldoclock, is it to stop other processes updating the record

    What do the values 0 and 1 for ldoclock indicate

    How many rows are there in wdoctyp...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: quoted identifiers in stored procedure

    Avoid the use of double quotes and use single quotes

    select 'exec sp_dropuser ' + '''' + [name] + '''' from sysusers where sid > 0x01 and (isntuser = 1 or...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Table joining question. I want to join these two tables into this result. Can anyone help me?

    It works for me

    Are you sure you are creating  and using the two temp tables and inserting your current data into them...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Table joining question. I want to join these two tables into this result. Can anyone help me?

    DECLARE @TableA TABLE (rowid int IDENTITY(1,1),portid ...)

    INSERT INTO @TableA (portid,acid,adDate,adTime,adPort,adType)

    SELECT portid,acid,adDate,adTime,adPort,adType FROM [TableA] ORDER BY portid ASC

    DECLARE @TableB TABLE (rowid int IDENTITY(1,1),portid ...

    INSERT INTO @TableB (portid,acid,adDate,adTime,adPort,adType)...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: sp_executesql and result set

    Yes, lookup sp_executesql in BOL

    Your example would like like this

    DECLARE @count int

    EXEC sp_executesql N'SELECT @count = count(*) FROM mytable', N'@count int output', @count OUTPUT

    SELECT @count

    Although you do...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: String occurence in a ntext column

    quoteI'm confused when you say Charindex can't be used on this datatype

    Because CHARINDEX only works with short 'character...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Last update/insert

    Add a timestamp column to the table

    and use

    SELECT TOP 1 * FROM  ORDER BY [timestampcolumn] DESC

    to find the last row inserted or updated

     

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: String occurence in a ntext column

    One way

    SELECT COUNT(*)

    FROM a

    INNER JOIN [Number] n

    ON SUBSTRING(a.[ntextcolumn],n.N,3) = N'xyz'

    AND n.N < (DATALENGTH(a.x) / 2)

    providing number table contains numbers upto max len of column

    not...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • RE: Grouping, eliminate un-matched pairs?

    You could try this

    SELECT pid,part,dos,MAX(post) AS [post],DATEDIFF(day,dos,MAX(post)) AS [lag],SUM(volume),SUM(charges)

    FROM

    GROUP BY pid,dos,part

    HAVING SUM(charges) <> 0

    It will give you the greatest lag for pid,part,dos and since you...

    Far away is close at hand in the images of elsewhere.
    Anon.

Viewing 15 posts - 1,591 through 1,605 (of 3,544 total)