Forum Replies Created

Viewing 15 posts - 4,771 through 4,785 (of 8,731 total)

  • RE: Pivoting question

    Steve,

    You can test your code using SQL Fiddle

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: need help on Scalar value Function

    If the performance improvement is almost immesurable, why do we have NOLOCK/READ UNCOMMITED?

    Basically, they're useful when we want an approximate result of a changing data set. These cases happen and...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Pivoting question

    Here's a possible solution. I included the full DDL and added some sample data. Take a look and ask any questions that you might have.

    DECLARE @test-2 TABLE

    (

    AccountID INT,

    Datekey INT,

    RunningTotal INT

    )

    DECLARE...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Pivoting question

    a4apple (6/30/2015)


    Luis Cazares (6/30/2015)


    I was exactly going to suggest the @Points table because I had to use a triangular join which might cause problems.

    Using your new Points table, here's a...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Pivoting question

    I was exactly going to suggest the @Points table because I had to use a triangular join which might cause problems.

    Using your new Points table, here's a possible solution. I...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Are the posted questions getting worse?

    Congratulations Alan! Enjoy her as much as you can.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Are the posted questions getting worse?

    Brandie Tarvin (6/29/2015)


    Steve Jones - SSC Editor (6/29/2015)


    Lynn Pettis (6/29/2015)


    Yea, then they grow up to be cats.

    They catch mice then.

    And bugs.

    So that's what the office needs. 😀

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: how to properly write this syntax? case when statement with dates

    That makes absolutely no sense.

    How does that reflect your data? Your problem is with the relation between 2 tables and you post only one without significant data types.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: how to properly write this syntax? case when statement with dates

    Please post what I asked you to in the previous post. I can't figure out what you want. I'm sure that you have it very clear, but you might be...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Moving away from ntext

    Mostly what Sean said. I just wanted to add that if you want to be sure that you're not losing data, you can do some checks before changing the datatype.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Sql Qurey Subtract Data on Hourly basis

    That's weird Sean, I would be more scared of rar files.

    About the solution, I'm not sure if you got confused with the dates because the values with zero hours don't...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: how to properly write this syntax? case when statement with dates

    If you're lost, imagine us that only have a piece of code.

    Why are you joining the table twice and then using it in subqueries within the CASE?

    Can you post DDL...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Moving away from ntext

    Is that ntext to nvarchar(MAX)?

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Who is the odd man out?

    I got it wrong because figured out that NEWID() was the only one that would show different results if called more than once in the same row. Also because I...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Previous Years Report

    gazy007 (6/26/2015)


    Hi ,

    Sorry and I am grateful for your help and something I have never understood about aggregate probelm

    SELECT

    ca.AccountNumber , CompanyName, Value,

    SUM(...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 15 posts - 4,771 through 4,785 (of 8,731 total)