Forum Replies Created

Viewing 15 posts - 6,991 through 7,005 (of 8,731 total)

  • RE: Display only month and year as MM/YYYY

    Or you could use code 103 with a RIGHT or SUBSTRING.

    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: Comparing 2 Columns until the 1st "."

    I'm giving you an answer, but I need you to understand some things first.

    The solution given is not an optimal solution because it's non-SARGable. It means that it won't use...

    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: T-SQL Pivot Question

    Alan,

    I was getting worried about you, it's good to know that you haven't been around because you were busy.

    Back to the problem, you're cheating with your test. You didn'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: Comparing 2 Columns until the 1st "."

    Could you post some sample data in the form of insert statements?

    It would really help us to test possible solutions before posting.

    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: Ranges that have excluded ranges

    For alternatives, check this article from Dwain Camps

    https://www.simple-talk.com/sql/t-sql-programming/the-sql-of-gaps-and-islands-in-sequences/

    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: Ranges that have excluded ranges

    This will build one million rows on the fly and use them as needed. To be fair, smallint won't accept 99,999 😛

    declare @ranges table(Item int

    ...

    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: Ranges that have excluded ranges

    As I told you in the comments, you need to change the source for cteTally to make it work with larger ranges.

    Check the following article: http://www.sqlservercentral.com/articles/T-SQL/62867/

    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: Brand new error - Invalid object name in T-SQL insert statement

    Sometimes Intellisense won't work great and can become a PITA.

    I sure like it, but it can get some improvements and bug fixing.

    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: I need to write a query using a join

    I couldn't remember the name of the site, but I found it (by searching "test sql online").

    http://sqlfiddle.com/ will allow you to test SQL Server, Oracle, MySQL, PostgreSQL and SQLite.

    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: I need to write a query using a join

    How are you testing on VFP 6.0? SQL syntax is different over there.

    * is to return all columns

    -- is a line-comment (everything to te right becomes a comment).

    To test, 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
  • RE: Oddball Interview Questions

    jasona.work (2/7/2014)


    You use such a cute little coffee mug!

    :hehe:

    Is to keep me active (by making several trips to the coffee machine) 😀

    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: Display only month and year as MM/YYYY

    You want to use CONVERT with a format code. (Reference)

    Can you handle that? or you need more help?

    Remember that this information is available with F1 on SSMS.

    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: Hierarchical order by TSQL

    I wonder why people consider the data structure is wrong.

    If they are trying to store the structure of a process flow, where a task can have multiple successors and predecessors,...

    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: Oddball Interview Questions

    jasona.work (2/7/2014)


    Knut Boehnert (2/7/2014)


    "How would you fill a coffee cup in T-SQL?" There is no straight right answer, more of a way of showing how the interviewee thinks and tackles...

    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: Hierarchical order by TSQL

    hifaizal90 (2/7/2014)


    Dear Sir

    The above query produces the required result even though 101 not appear in the parent Id since it is top level parent.

    Which one?

    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 - 6,991 through 7,005 (of 8,731 total)