Forum Replies Created

Viewing 15 posts - 1,231 through 1,245 (of 8,731 total)

  • RE: Function to Round or Truncate DateTime

    What about creating a function that would run 5 times faster?

    CREATE FUNCTION ifn_TruncateOrRoundDatetime(
      @Datetime datetime,
      @DatePart char(2),
      @Truncate bit
    )RETURNS TABLE WITH SCHEMABINDING

    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: Multiple Values for Single Parameter in User Defined Function

    wweraw25 - Wednesday, May 24, 2017 1:57 PM

    Something like below:

    Exec dbo. Sp_Number '1,2,3,4,5'

    Result Set
    1       USA   Chicago
    2    ...

    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 and UNION performance issue

    cmartel 20772 - Wednesday, May 24, 2017 1:39 PM

    Luis,

    I tried you statement (I put a TOP 5 to limit the results!) and...

    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 and UNION performance issue

    cmartel 20772 - Wednesday, May 24, 2017 1:09 PM

    I am optimizing an inline table-valued function that performs calculations by heavily using OVER,...

    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: LEFT JOIN Question.....

    PiMané - Wednesday, May 24, 2017 9:52 AM

    My problem is that this has to work on older SQL versions that don't have...

    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: Multiple Values for Single Parameter in User Defined Function

    wweraw25 - Wednesday, May 24, 2017 12:23 PM

    Did anyone come across this scenario where a developer/analyst comes in and pass multiple values...

    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: Looking for best approach

    patrickmcginnis59 10839 - Tuesday, May 23, 2017 9:21 AM

    Lowell - Monday, May 22, 2017 2:00 PM

    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: Calculate percentages based on if condition

    Luis Cazares - Tuesday, May 23, 2017 6:50 AM

    I'm not helping if you're not even willing to format your 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: Are the posted questions getting worse?

    jasona.work - Tuesday, May 23, 2017 6:30 AM

    So, for those in the US, any big plans for the upcoming long weekend?

    Me, I'm...

    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: Calculate percentages based on if condition

    I'm not helping if you're not even willing to format your 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: Looking for best approach

    Anjan@Sql - Tuesday, May 23, 2017 1:39 AM

    Thank you all for the suggestions.
    Thank you John ,Luis, Patrick, Scott and Lowell.

    Do you understand...

    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 delete all store procedure from my database ?

    Ed Wagner - Sunday, May 21, 2017 7:53 AM

    spectra - Saturday, May 20, 2017 8:57 PM

    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: Removing cursor

    Duplicate post.
    Further replies in here: https://www.sqlservercentral.com/Forums/1877500/Cursor-removal

    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: Cursor removal

    It took me some time to understand your requirements, but I finally got them. In my experience, the best option for this is to use something called "set-based loop". This...

    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: Calculate percentages based on if condition

    Let's start by formatting your code.

    SELECT s.Store_Number,
       l.Location,
       s.WkEnd_Date,
       s.ItemNumber,
      ...

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