Forum Replies Created

Viewing 15 posts - 7,111 through 7,125 (of 8,731 total)

  • RE: IP function running slow - any suggestions ?

    isuckatsql (1/24/2014)


    WOW, what an improvement !

    From 3.2 seconds to 0.3 seconds 🙂

    Many Thanks!

    Which path did you take?

    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: IP function running slow - any suggestions ?

    Taking the function call out of your query would help.

    ALTER Procedure [dbo].[GetIPdetails]

    @IP VarChar(15)

    AS

    BEGIN

    -- SET NOCOUNT ON added to prevent extra result sets from

    ...

    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 and update

    DaveDB (1/24/2014)


    I completely disagree with the use of cursors. They are heavy and slow and anything that you can do in a cursor you can be accomplished in a loop...

    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 and update

    ChrisM@Work (1/24/2014)


    phineas629 (1/24/2014)


    ... I am required to use the cursor...

    Perfectly reasonable so long as this is homework.

    It shouldn't be homework as I recognize this from a previous thread http://www.sqlservercentral.com/Forums/Topic1532233-338-1.aspx

    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: adding more than one aggregation function in dynamic pivot

    Here's an example using CROSS TABS. It's shorter than the Pivot option, but you need to understand what the code is doing.

    DECLARE @sql NVARCHAR(MAX)

    SELECT @sql =STUFF((SELECT ',SUM( CASE WHEN p.ProductID...

    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: PROBLEM WITH DYNAMIC TABLE PIVOT WITH MULTIPLE COLUMNS

    I would suggest that you take a look at dynamic cross tabs. Seems easier to work, especially when several columns and aggregates are involved.

    http://www.sqlservercentral.com/articles/Crosstab/65048/

    Here are 2 examples based 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: adding more than one aggregation function in dynamic pivot

    I would suggest that you take a look at dynamic cross tabs. Seems easier to work, especially when several columns and aggregates are involved.

    http://www.sqlservercentral.com/articles/Crosstab/65048/

    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 of Tables in JOIN ??

    That's because when SQL Server is "reading" the code, it won't find a reference to Table_B alias until it gets to Table_B.

    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: Concatenating all the values in a column group by another column

    Check the following article: http://www.sqlservercentral.com/articles/comma+separated+list/71700/

    It explains how to solve your problem.

    If you have any specific questions, feel free to ask.

    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 model user calculations from Excel?

    I'm not sure how would you automatize your process as you haven't given a source for your calculations.

    I can get to your expected results but I'm not sure 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: Group report by month-end dates for last 6 months

    Here's an option. I added comments trying to explain what it's doing. If you have any questions, feel free to ask.

    SELECT --This formula adds the difference of months between base_date...

    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 report by month-end dates for last 6 months

    hi,

    As you may notice, this forum is basically for SQL Server users and most of us would come with a solution using T-SQL instead of PL/SQL. would that be fine...

    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: Duplicate replace?

    Will the year always come at the end of the string? Or would something like "Microsoft Office 2003 Professional Edition" is possible?

    The reason is because the solution can be simplified...

    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: Skipping Columns (& other tricks) Using BCP Format Files (SQL Spackle)

    Thanks for the article Jeff. It's always good to have a nice explained reference.

    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 model user calculations from Excel?

    It's hard to think of a solution without some sample data and expected results. everything is possible, you just need to provide more information. Check the article on my signature...

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