Forum Replies Created

Viewing 15 posts - 2,701 through 2,715 (of 7,613 total)

  • Reply To: Tsql/SP Code Optimization

    I'm not aware of any such tool.  If there were one, it would be rather expensive, I'm sure.

    Tuning code for performance requires human skills (hallelujah!, since that's one of the...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • Reply To: Logical reads and its size

    Jonathan AC Roberts wrote:

    ScottPletcher wrote:

    As this occurred on the Production Server,I am unable to provide the sql plan.

    Then there's not much we can do for you.

     

    If the OP runs the query I...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • Reply To: Logical reads and its size

    Is this the right way to calculate the size of logical reads?

    Yes.

    Should the size of logical reads be used to measure the performance or the number of logical reads provided...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • Reply To: Tempdb file removal is incomplete

    You can't remove tempdb files while SQL is running.  Those are in effect system files.  When you recycle the SQL Server instance, your changes will be put into effect then.

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • Reply To: wierd type conversion error

    Something else is going on, would need to see a more complete original statement and the table definition(s).

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • Reply To: Safe/correct way to reduce balance from account

    Many companies have clients that have a credit limit: they can't order over a certain amount without prior approval. [I've worked in 2 such companies at least already.]  That "remaining...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • Reply To: Update query with historic accumulative SUM in fields by date range

    You seem fixated on tying the physical format of data to its use/display.  A value can be stored physically as an int without the value ever being directly used in...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • Reply To: Safe/correct way to reduce balance from account

    I've had the same bank account for more than 20 years.  I'd hate to have to wait for them to compute a balance every time.

    A balance is one of those...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • Reply To: Safe/correct way to reduce balance from account

    UPDATE dbo.table_name

    SET balance = balance - @amount

    WHERE balance - @amount >= 0.0

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • Reply To: Finding records that a negative number with a corresponding positive number

    a negative dollar amount followed by a non-negative dollar amount

    Do you have something that can be sorted on to give the proper order of transactions?  If so, it's easy to...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • Reply To: Using Timestamp Column To Determine Date/Time Of Change

    You could consider using SQL's Change Tracking to keep track of the changes for you; you could then translate the tracking version into an actual datetime of change.  And it's...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • Reply To: Deadlock on Index

    Could you post the query plan, estimated is good enough for now, for this SQL:

    delete lad from PA_LDG_HOLD_JRNAL_LINES_LAD lad inner join PA_LDG_JRNAL jrl on (lad.JRNAL_ID = jrl.HOLD_JRNAL_ID and lad.LINE_ID =...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • Reply To: SQL Query

    SELECT DateCol1, Col2,
    STUFF(CASE WHEN [1] = 0 THEN ',1' ELSE '' END +
    CASE WHEN [2]...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • Reply To: MERGE - Comparing NULL values for Update

    NULL and 0.0 are not the same thing.

    If you need the values to be 0.0, you should make sure they are INSERTed as 0.  Use a default value and a...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • Reply To: Could there be some sort of permissions issues with EF and INFORMATION_SCHEMA?

    It's best to stop using INFORMATION_SCHEMA views.  They can contain inaccuracies (on ownership) and are incomplete now.

    Stick to sys.columns and the other MS standard views.

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

Viewing 15 posts - 2,701 through 2,715 (of 7,613 total)