Forum Replies Created

Viewing 15 posts - 7,981 through 7,995 (of 8,731 total)

  • RE: Return records with lower Average Sale Price compared to last year

    You can't do a where clause as you're trying to do it. Unless someone suggest something better, you must use a subquery to find out the information from the previous...

    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: ORDER BY when inserting into table variable

    Ok, won't argue on this, but will definitively search on why I was told that.

    EDIT: I believe they told me to change a non-clustered index (only index on a heap)...

    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: ORDER BY when inserting into table variable

    Eugene Elutin (6/28/2013)


    We don't order INSERTS, we order SELECTS.

    Until we have identity and we want to populate it in a specific order...

    Or want to do a clustered insert instead of...

    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 read all content of sp or fn?

    I agree with Lowell, you should try using sys.sql_modules instead of syscomments. Although, it seems easier to use the built-in function with a slight correction.

    SELECT OBJECT_DEFINITION(OBJECT_ID('spname'))

    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 read all content of sp or fn?

    You can use

    EXEC sp_helptext 'spname'

    Or right-click on object explorer and choose "Modify" option

    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 does SQL pronounce SQL?

    ronmoses (6/28/2013)


    It doesn't strike me as a particularly useful function, especially given these examples:

    ...

    So that seems pretty useless.

    ron

    +1

    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: Converting Integer date & time into datetime variable .. help!

    I understood that he wanted the code to fill a datetime column instead of using the int columns. I might be wrong :hehe:

    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: Stored Procedure Tuning

    The easy answer: You can't tune this SP.

    This procedure is calling other procedures and we would need to know the definition of those stored procedures as well.

    To get better help...

    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 write query to show in desired table fomat

    How do you define that you want to Join Srinivas AAAA with Srinivas ABC but not with Srinivas KKKK?

    Could you provide DDL and sample data in a consumable format?...

    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 avoid this error when scripting multiple sp? Thanks.

    Use a batch separator (aka GO);-)

    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: Converting Integer date & time into datetime variable .. help!

    And here's a different approach.

    SELECT CONVERT( datetime, RIGHT( @Date, 6) + ' ' + STUFF( STUFF( RIGHT( '0' + CAST( @Time as varchar(6)), 6), 5,0,':'), 3,0,':'), 12)

    If you have any...

    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: Converting Integer date & time into datetime variable .. help!

    This is not beautiful but might do the trick while I try something different.

    DECLARE @Date int = 1130627 ,--= (exclude the first digit)(13-06-27)

    @Time int = 51458 --(24hr) = 5:14:58

    SELECT DATEADD(...

    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: Help with comma separated string in UDF to return comma separated string

    I have 2 links for you that will improve the performance and give you the solution for this.

    Avoid using UDF unless they're iTVF (inLine Table-Valued Functions).

    Tally OH! An Improved SQL...

    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: Using ISNULL causes poor performance in SP?

    What's the difference in the workload? How many lines are you using on each?

    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: Using ISNULL causes poor performance in SP?

    I wouldn't suspect of the ISNULLs as the main problem. I would check on all the full joins to check if they're really necessary and maybe to change the subqueries...

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