Forum Replies Created

Viewing 15 posts - 4,141 through 4,155 (of 8,753 total)

  • RE: The Most Common Query Blunders...

    Alan.B (12/28/2015)


    The most common/easiest to fix mistakes:

    Someone beat me to it but NOLOCK table hints are the #1 mistake I have seen. I would go so far as to say...

  • RE: To Get fixed periodic rownumbers by rounding the number to closest integer

    harishyarlagadda2020 (12/28/2015)


    Thank you Eirikur! I am using rownum% value= 0 rather than '<1'.

    This helped.

    You are very welcome.

    😎

  • RE: To Get fixed periodic rownumbers by rounding the number to closest integer

    Ed Wagner (12/28/2015)


    Nice job, Eirikur. I was working on the same approach, but was shooting for = 0 instead of < 1. The ceiling of the decimal division...

  • RE: To Get fixed periodic rownumbers by rounding the number to closest integer

    This is straight forward, select from the table where (Row_Number % Divisor) is less than one, rounding will not give the right results because of the loss of precicion.

    😎

    Quick sample

    ;WITH...

  • RE: The Most Common Query Blunders...

    Eric M Russell (12/28/2015)


    In addition to what's already been mentioned above:

    On the fly data type conversion and transformations, both explicit and implicit

    Distributed queries (ie: joining tables between multiple instances...

  • RE: Possible to insert unaffected by rollback?

    SQL Server is fully ACID (Atomicity, Consistency, Isolation, Durability), if you need functionality outside the ACID then use Jeff's suggestion and output the log to a file, that temp table...

  • RE: Get two sales item code exclusively from invoice

    Another wild guess

    😎

    USE tempdb;

    GO

    IF OBJECT_ID(N'dbo.TBL_SALES_ITEMS') IS NOT NULL DROP TABLE dbo.TBL_SALES_ITEMS;

    CREATE TABLE dbo.TBL_SALES_ITEMS

    (

    SI_ID INT IDENTITY(1,1) ...

  • RE: Copy all data from Database A. to Database B.

    Jeff Moden (12/27/2015)


    C@mel (12/27/2015)I don't want to restore a backup of A. to B.

    I want a script to copy all data from A. to B.

    WHY? To what end? ...

  • RE: Salary vs contract rate?

    Jeff Moden (12/27/2015)


    Eirikur Eiriksson (12/26/2015)


    Jeff Moden (12/26/2015)


    I'm obviously living in the wrong part of the country (although I do have benefits, paid vacations, flexible hours, ability to work from home,...

  • RE: VARBINARY(N) produces error 16911 with sp_cursor cid, 40, 1

    There are several things wrong in this code, none of which have anything to do with the varbinary N or MAX. The most obvious ones are the wrong parameters passed...

  • RE: Datetime2

    patricklambin (12/27/2015)


    Eirikur Eiriksson (12/26/2015)


    The explanation isn't correct, "This determines the storage for the type, but only in varying the storage from 6 to 8 digits of precision." should be "This...

  • RE: Salary vs contract rate?

    Jeff Moden (12/26/2015)


    I'm obviously living in the wrong part of the country (although I do have benefits, paid vacations, flexible hours, ability to work from home, and live close enough...

  • RE: Maintenance Plans are not working as scheduled

    Piling on Jeff's good comment, unless there is a compelling reason I wouldn't suggest this great interval between the full backups, because the fact that the less one has to...

  • RE: Possible to insert unaffected by rollback?

    Here is a quick demonstration of my preferred pattern, more or less the same as Jacob's

    😎

    USE tempdb;

    GO

    SET NOCOUNT ON;

    IF OBJECT_ID(N'dbo.TBL_TEST_TRAN') IS NOT NULL DROP TABLE dbo.TBL_TEST_TRAN;

    IF OBJECT_ID(N'dbo.TBL_TEST_LOG') IS NOT NULL...

  • RE: Datetime2

    The explanation isn't correct, "This determines the storage for the type, but only in varying the storage from 6 to 8 digits of precision." should be "This determines the storage...

Viewing 15 posts - 4,141 through 4,155 (of 8,753 total)