Forum Replies Created

Viewing 15 posts - 3,856 through 3,870 (of 5,502 total)

  • RE: Intermitent Primary key violation in Nightly jobs

    Quoting the OP's first post:

    We have jobs that perform inserts into a table with an alphanumeric primary key...

    it seems like the major issue is the alphanumeric key. Therefore neither...

  • RE: How can I fire a trigger for each row when a BULKUPDATE happen..?

    What is the business case you need to deal with?

    Basically I see two options:

    1) if possible at all modify the trigger to deal with all rows at once or

    2) import...

  • RE: Removing duplicates and keeping 1 record with no PK

    olie480 (4/2/2010)


    Jeff Moden (4/2/2010)


    Deleting data that is supposedly duplicated by FirstName and LastName is a very good way to have a sudden and very unwelcome career change. There must...

  • RE: Performance Tuning Big Table

    Grant Fritchey (4/2/2010)


    ...

    But seriously, I was thinking, and I'm assuming Lutz was thinking, adding a number or or substituting a number for the char field. Idle chatter really.

    Your assumption is...

  • RE: Improve Between performance

    cgreathouse (4/2/2010)


    Excellent! I'm now getting a duration of 1 ms and with only 3 reads!!

    Could you explain what's going on here to make it so much faster?

    Thanks!

    ....

    this one

    WHERE...

  • RE: Improve Between performance

    Thank you Jason for detecting my simple but most relevant mistake.

    Since my error rate increase dramatically at the moment (in another thread I just forgot that table variables where introduced...

  • RE: Improve Between performance

    CirquedeSQLeil (4/2/2010)


    ...

    My concern is due to the ands

    WHERE LOW >= 982827279

    AND LOW < 982827279 +1000

    AND HIGH <= 982827279

    Since the High and Low are the same value - it...

  • RE: Removing duplicates and keeping 1 record with no PK

    Btw: What do you mean by "query manager"?

    If you're using SQL Server 2000, the query shouldn't run at all since table variable as well as ROW_NUMBER function that I've used...

  • RE: Removing duplicates and keeping 1 record with no PK

    That's weird...

    Here's the result in the Results window when running the modified query as you posted:

    CustNumberFirstNameLastNameCity

    345321JohnDoeKellogg

    459978JohnDoeKellogg

    Message window output:

    (4 row(s) affected)

    (2 row(s) affected)

    The total number of columns doesn't really matter as...

  • RE: Improve Between performance

    CirquedeSQLeil (4/2/2010)


    lmu92 (4/2/2010)


    Is there any change to have a known maximum range between LOW and HIGH?

    If so, you could base your query on the LOW column to narrow down the...

  • RE: Improve Between performance

    Is there any change to have a known maximum range between LOW and HIGH?

    If so, you could base your query on the LOW column to narrow down the number of...

  • RE: Removing duplicates and keeping 1 record with no PK

    You could use Row_Number() to find the dupes...

    Something like this:

    DECLARE @tbl TABLE

    (

    CustNumber INT, FirstName VARCHAR(30), LastName VARCHAR(30), City VARCHAR(30)

    )

    INSERT INTO @tbl

    SELECT 345321 ,'John','Doe','Kellogg' UNION ALL

    SELECT 459978...

  • RE: Performance Tuning Big Table

    Grant Fritchey (4/2/2010)


    Using a number does make sense, but I wouldn't suggest you use NUMERIC. The NUMERIC(12,0) suggested is 9 bytes in size. An INT is only 4 bytes and...

  • RE: Performance Tuning Big Table

    scziege (3/30/2010)


    ...

    Another pain is the creation of new codes

    we have a stored procedure which checks if a code exists and if not it will be inserted. ...

    I truly hope the...

  • RE: patindex - search for either value

    Something like this?

    CREATE TABLE #TableA ( id INT,columnA VARCHAR(200))

    INSERT INTO #TableA

    SELECT 1,'here is my phone number 12345678. but my cell is 44444444.' UNION ALL

    SELECT 2,'987654321 is my balance' UNION ALL

    SELECT...

Viewing 15 posts - 3,856 through 3,870 (of 5,502 total)