Forum Replies Created

Viewing 15 posts - 1,726 through 1,740 (of 8,731 total)

  • RE: Results to new table

    Use INSERT INTO...SELECT...

    And use a cross join to get the expected result.

    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: The inline TVF

    ChrisM@Work (12/15/2016)


    Luis Cazares (12/15/2016)


    I've never written an iTVF using parenthesis around the query. However, the other answers were completely wrong and the correct answer states that it can not that...

    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: The inline TVF

    I've never written an iTVF using parenthesis around the query. However, the other answers were completely wrong and the correct answer states that it can not that it must.

    After answering,...

    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: Split a number in close equal number in sql

    CELKO (12/14/2016)


    I want to divide 11 into 4 groups then output should be 3,3,3,2. same way 10 for for group would be 3,3,2,2. ..

    Look up the NTILE() function.

    That would...

    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: NULL Datetime causing NULL string when converting

    Lynn Pettis (12/14/2016)


    Luis Cazares (12/14/2016)


    Just a word of caution.

    Handle the quotes correctly on Scott's and Lynn's examples. You might end with strings with the value 'NULL' instead of NULLs for...

    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: NULL Datetime causing NULL string when converting

    Just a word of caution.

    Handle the quotes correctly on Scott's and Lynn's examples. You might end with strings with the value 'NULL' instead of NULLs for the columns. Or 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: Convert columns to rows

    Search for CROSS TABS and Pivots.

    Here's an article that might help: http://www.sqlservercentral.com/articles/T-SQL/63681/

    Also search read about EAV and why this design is a bad idea. Then change it if possible.

    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: NULL Datetime causing NULL string when converting

    I would just handle everything with ISNULLs and forget about CASE.

    CREATE TABLE POS_CODEVALUE(

    code char(3),

    ...

    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: Long running insert

    This is one of the cases when the performance problem comes from the DDL. You could create computed columns and lookup tables to improve this query. However, that's a suggestion...

    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: Today's Random Word!

    crookj (12/14/2016)


    Revenant (12/14/2016)


    Ed Wagner (12/14/2016)


    Manic Star (12/14/2016)


    crookj (12/14/2016)


    Ed Wagner (12/14/2016)


    DamianC (12/13/2016)


    ZZartin (12/13/2016)


    Ray K (12/13/2016)


    Manic Star (12/13/2016)


    Ed Wagner (12/13/2016)


    Revenant (12/13/2016)


    Grumpy DBA (12/13/2016)


    Luis Cazares (12/13/2016)


    Cereal

    Cheerios

    Sugar

    Buzz

    Espresso

    Cappuchino

    Yuppy

    Eighties

    Rock

    Paper

    Spock

    Vulcan

    Thunderball

    Goldfinger

    Goldmember

    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: Splitt values from one column in two rows

    You could use a cross tabs approach. It's simple and should give you what you need.

    CREATE TABLE dbo.Zusatzfeld(

    Bold_ID int,

    WertDatum datetime,

    ...

    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: Q: How to Encrypt and Decrypt

    Those are not the expected results. Actually, there are no results. Be sure to run the code.

    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: Q: How to Encrypt and Decrypt

    Are you sure that you're using SQL Server 2005?

    What happens if you run the following?

    SELECT @@VERSION

    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?

    Apparently, Eirikur has the crystal ball.

    It took me a couple of harsh posts to make the OP confess and demonstrate Eirikur's statement.

    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: GROUP BY in SQL Server 2014

    It means that data sets are not ordered.

    If you want to be able to compare them, you'll have to sort them.

    If you need them to have a certain order for...

    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 - 1,726 through 1,740 (of 8,731 total)