Forum Replies Created

Viewing 15 posts - 91 through 105 (of 8,731 total)

  • Reply To: get around invalid date

    Just change this line in your code.

    set @testchar = convert(datetime,'2019-10-12')

    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
  • Reply To: How to get below query in SQL server 2008

    So much code for a simple pivot.

    --Create sample data
    CREATE TABLE #Table
    (
    City VARCHAR(50)
    )

    INSERT INTO #Table (City)
    VALUES ('A'), ('B'), ('C'), ('D'), ('E'), ('F'), ('G'), ('H');


    --Solution starts here....

    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
  • Reply To: Saving Hebrew text as nvarchar

    Here's an article addressing your problem when using AddWithValue.

    https://blogs.msmvps.com/jcoehoorn/blog/2014/05/12/can-we-stop-using-addwithvalue-already/

    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
  • Reply To: Saving Hebrew text as nvarchar

    Now I see the problem and the reason behind the image that I can see now.

    Here's the image of the example.

    hebrew query

    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
  • Reply To: Saving Hebrew text as nvarchar

    mjohnson 71479 wrote:

    Is there something special I need to do to be able to save some Hebrew text in my table?    I have the column set as nvarchar(max) yet when 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
  • Reply To: get around invalid date

    As mentioned by Drew, NULLIF can work, but I'd suggest to go further and use TRY_CONVERT this will return NULL on all invalid dates instead of generating errors. If servicedatekey...

    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
  • Reply To: Optimizing a stored procedure that uses cursor

    Kenean wrote:

    @luis Cazares thanks! There was a third table 'Billing' though. I have tried to follow the same logic to include that in your code, but it is displaying more...

    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
  • Reply To: Table Function becomes slow

    You're throwing 500 rows of code into a forum without understanding where's the problem and expect people to solve it without giving sample data, execution plans or data definitions? You...

    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
  • Reply To: Optimizing a stored procedure that uses cursor

    Mr. Brian Gale wrote:

    Hello keneangbu,

    My first piece of advice would be remove the cursor.  Cursors are inherently slow.  In your sample piece of code, I do not see a nice way to...

    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
  • Reply To: Optimizing a stored procedure that uses cursor

    For starters, you can optimize your query by reducing the number of calls to your Visits table. It could be done like this:

    SELECT DISTINCT userr_id 
    FROM Approvals...

    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
  • Reply To: SSC Fantasy Football 2019

    Slow and steady-ish, I'm getting to the top of my division, and hoping to stay there at least one more week considering John's record.

    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
  • Reply To: Are the posted questions getting worse?

    Grant Fritchey wrote:

    Thom A wrote:

    Sergiy wrote:

    Isn’t it a kinda shame to have such queries exposed on a specialised site of SQL Server professionals?

    Could we form a group of volunteers who could fix...

    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
  • Reply To: Are the posted questions getting worse?

    Thom A wrote:

    Realise that the site is disliked by many (I agree that the community isn't as robust as it is here, or as well knit with many of you having ...

    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
  • Reply To: SSC Fantasy Football 2019

    Last week was dominated by the Mexicans in the league. I hope that it continues like that.

    Don't worry, at least the steelers have a chance to win this week.

    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
  • Reply To: SSC Fantasy Football 2019

    Ray K wrote:

    Oh for crying out loud!!!  None of my RBs or WRs even bothered showing up yesterday!!!  (And the one who did was on my bench!)  @#$%^&*!!!!!!!!!!!!

    So it's going to...

    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 - 91 through 105 (of 8,731 total)