Forum Replies Created

Viewing 15 posts - 2,146 through 2,160 (of 8,731 total)

  • RE: Staging area best practice

    I would, at least, put the DW schema on its own database. That way you can backup just that data. I'm not sure how long do you keep the data...

    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: Find next date after a given date

    Here's an option:

    SELECT *

    FROM #NoShow ns

    OUTER APPLY( SELECT TOP 1 fa.ApptDt

    FROM #FutureAppts fa

    ...

    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 procedure has no errors but need to be enhanced

    If you don't intend to return it, why are you including the SELECT in 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: Is there a better faster way then REPLACE in this example?

    Jason A. Long (9/22/2016)


    I like Luis' approach better... The one thing I would add is code to drop the existing function if it exists...

    ...

    SET @FunctionSQL = 'IF OBJECT_ID(''[dbo].[itvf_Model_Name_Compare]'', ''IF'') IS...

    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: Is there a better faster way then REPLACE in this example?

    J Livingston SQL (9/22/2016)


    I am just being curious.....

    OP said

    ....

    I have 2 tables and I am attempting to match models. (they are described differently in both tables).

    IPHONE 6S ROSE 64GB SGL...

    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: Is there a better faster way then REPLACE in this example?

    I was curious on my previous idea, which seems to be working fine. Although, with more time, I would improve the code.

    CREATE TABLE ReplacementCodes(

    type_priority 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: Is there a better faster way then REPLACE in this example?

    Jason A. Long (9/22/2016)


    One issue that I would take with Sergiy's suggestion is that it can't be used in an iTVF. The resulting function will either be a scalar function...

    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 Pass Multiple Strings as one parameter in Store Procedure

    You've got two great options here. If by any way you get an option of using dynamic sql, please avoid it unless you plan to go unemployed.

    The splitter that Jason...

    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 convert navarchar to datetime

    Sergiy (9/21/2016)


    Be aware that conversion of varchars to datetimes by style "120" is locale dependent.

    On different server settings you may get different results:

    SET DATEFORMAT DMY

    SELECT CONVERT(VARCHAR(20), CONVERT(datetime,CAST('2016-08-10 05:29:27' as datetime),112),...

    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 do I initialise a sql variable to 0 in stored-procedure ?

    Interview question?

    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: SP inserts into table

    Ken McKelvey (9/21/2016)


    As mentioned, this is an horrible design.

    If you have to live with an app which uses it, I would alter it so the parameters are logged and 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: Concatenation of 2 strings sql server

    My code has no errors. I tested it before posting.

    I still have no idea on what you want to return. You're asking to return the same values that you're entering...

    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?

    jasona.work (9/21/2016)


    I have had a topic resurrected from the dead!!!

    I am now a member of that elite group of "dead topics revived!"

    Noticed the email alert that a reply had been...

    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: Concatenation of 2 strings sql server

    Your code makes no sense.

    Why are you concatenating row counts? You'll end up with a number that means nothing. You're also not telling what are you returning. You mention 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: how to convert navarchar to datetime

    It's not appending zeros, that's just the way it displays the value stored. Datetime is stored as 2 integers combined in an 8-byte value. One integer is used for 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

Viewing 15 posts - 2,146 through 2,160 (of 8,731 total)