Forum Replies Created

Viewing 15 posts - 721 through 735 (of 2,171 total)

  • RE: Getting the first date of next year

    Not according to OP requirements.

    He is only storing dates with "no time information", ie time set to 00:00:00

    And he wants dates for January 1st of every year to remain to...


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Getting the first date of next year

    Sergiy, that will not work for January 1st dates.

    However, you are not that far from a working suggestion.

    Try this

    DECLARE@Sample TABLE

    (

    Eno int,

    Date datetime

    )

    Insert@Sample

    select 1,'2006-06-30' union all

    select 2,'2004-05-31' union all

    select 3,'2007-01-01' union...


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Checksum gotchas?

    Jacob Luebbers (7/29/2008)


    How likely is a collision? Probably not very - but can your process accept this small chance of inconsistency? If so great, if not consider alternatives like using...


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Checksum gotchas?

    http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=70832


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Covering index is too long, but needed ... what to do?

    Also see similar behaviour here

    http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=109678


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Compare Sales with last year sales

    DECLARE@Sample TABLE

    (

    ID INT PRIMARY KEY CLUSTERED,

    Product VARCHAR(10),

    DateValue DATETIME,

    Value MONEY

    )

    INSERT@Sample

    SELECT 1, 'Yak', 'Oct 17 2007 12:00AM', 0 UNION ALL

    SELECT 2, 'Yak', 'Oct 17 2008 12:00AM', 2 UNION ALL

    SELECT 4,...


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Re: Exclusively acquiring newly insert id before insertion

    Something similar to this

    CREATE TRIGGER dbo.trgMyTrigger ON Crawler_Depth

    AFTER INSERT

    AS

    SET NOCOUNT ON

    UPDATEcd

    SETcd.Hierarchy = cd.Hierarchy + CAST(cd.pkColumnNameHere AS VARCHAR(100)) + '.'

    FROMCrawler_Depth AS cd

    INNER JOINinserted AS i ON i.pkColumnNameHere = cd.pkColumnNameHere


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: looping query

    DECLARE@Sample TABLE (c CHAR(1))

    INSERT@Sample

    (

    c

    )

    SELECTCHAR(Number)

    FROMmaster..spt_values

    WHEREType = 'P'

    AND Number BETWEEN 65 AND 90

    SELECTc,

    CHAR(65 + (ASCII(c) - 64) % 26)

    FROM@Sample


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: looping query

    There are other ways to obfuscate the data.


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: SQL Programming

    Yes.

    select top 1 DEPTID from @t1

    where EMPID = a.EMPID and WEFDATE <= a.DATE

    order by WEFDATE desc

    But there is still the...


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: numeric sort of a varchar field

    It will work! 😛

    ISNUMERIC('Spagetti') equals to 0.


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Cursor

    With that attitude, please let him use cursors...


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: numeric sort of a varchar field

    Add this sample data

    UNION ALL

    SELECT '$1500,0'

    and run your query again...


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: Using a datetime variable in stored procedure

    Or you can pass dates according ISO standard?

    EXECUTE dbo.usp_ECL_Stock_Receipts '20080625', 'John Smith'

    never fails.


    N 56°04'39.16"
    E 12°55'05.25"

  • RE: SQL Programming

    On large tables, there might be a performance issue due to the "triangular join" in the correlated subquery.


    N 56°04'39.16"
    E 12°55'05.25"

Viewing 15 posts - 721 through 735 (of 2,171 total)