Forum Replies Created

Viewing 15 posts - 7,456 through 7,470 (of 8,731 total)

  • RE: Convert a field from numeric type to date format

    Try with:

    CAST(CAST( NULLIF(NumericDatefield, 0) AS char(8)) AS 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: Interview Question

    Usually this questions are to check for a mixture between knowledge and experience. There's not one correct answer, but multiple options depending on many circumstances. Basic answers that might lead...

    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: Pivot query needed

    I agree with you, I never suggested the non-dynamic approach. However, it's important to understand it before jumping into the dynamic cross tabs. Pre-aggregation can be used as well on...

    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: Pivot query needed

    Aaron,

    I just wanted to point out that PIVOT is not needed (is just one option). A pre-aggregated CROSS TAB might perform better. Check the articles recommended by Lutz.

    By the way,...

    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: xp_cmdshell for bulk import

    Maybe I sound pedantic, but a good advice is to use the help included with SQL Server. Is as easy as pressing F1.

    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: xp_cmdshell for bulk import

    Are you seriously asking something that is clearly documented?

    http://technet.microsoft.com/en-us/library/ms175046.aspx

    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 Query Help

    There's something wrong with your query. You're comparing a boolean value (EXISTS()) against an integer value.

    To get better help, please post DDL for tables involved and sample data in the...

    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: CASE Statment Help

    What approach did you take?

    My option would be something like this:

    CASE WHEN ModifiedDate > ISNULL( DateClosed, 0) THEN 1 ELSE 0 END as FieldName

    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: Transposing rows to columns - need help

    Now, there's a method to obtain the correct result. It's called CROSS TABS and you can find information on the following articles:

    Cross Tabs and Pivots, Part 1 – Converting Rows...

    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: Transposing rows to columns - need help

    I misread the expected results, I will post a correct solution in a few minutes.

    A simpler approach can be found on this article:

    http://www.sqlservercentral.com/articles/comma+separated+list/71700/

    Here's an example on your data:

    SELECT order_number,

    sequnce_num,

    STUFF( (SELECT...

    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: Tablas con índice y opción IGNORE_DUP_KEY=ON problemas en los bloqueos al insertar en la tabla

    LutzM (11/12/2013)


    Ich habe keine Ahnung, wovon du sprichst, Luis!

    (I have no idea what you're talking about, Luis!) 😀

    I'm just trying to help 😀

    I just hope people won't rely just on...

    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: Tablas con índice y opción IGNORE_DUP_KEY=ON problemas en los bloqueos al insertar en la tabla

    Antes que nada, bienvenido a este sitio.

    Te recomiendo que escribas en inglés ya que así recibirás más ayuda y no te quedarás con la ayuda de sólo unos cuantos que...

    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: CTE Recursive

    Paul Keys (11/12/2013)


    Hi,

    Try changing your clause for the inner join to

    ON loc.Parent_Location = loh.LocationID

    With this change, he can loose the WHERE clause 🙂

    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: Jr. Business Intelligence Analyst (Mid-Michigan)

    Jeff Moden (11/10/2013)


    Luis Cazares (11/7/2013)


    Do you provide sponsorship for mexicans?

    If they don't, they should make an exception for you. You're one of the best out there.

    :blush: Thank 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: Extract Column Names and Field Value from a table using UNPIVOT

    Maybe the CROSS APPLY approach to unpivot can help you. Even to create the dynamic code for N number of columns would be easier than the built-in UNPIVOT function.

    Reference: http://www.sqlservercentral.com/articles/CROSS+APPLY+VALUES+UNPIVOT/91234/

    WITH...

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