Forum Replies Created

Viewing 15 posts - 7,546 through 7,560 (of 8,731 total)

  • RE: how to calculate Average Time Duration

    Your formula seems correct but you don't have number or calls made or received, instead you have duration of them. Check your data and post again.:-)

    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: Working with a Very Poorly Designed Database

    It's not that difficult, you can do it this way or with 5 UPDATEs, one for each condition.

    UPDATE m SET

    Category1 = CASE WHEN ( Score > 0.0 AND Score...

    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: Concatenate by Grouping

    It's really easy, just follow the instructions on this article:

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

    For a coded answer, please provide DDL and sample data in the form of insert statements.

    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: Performance and Temporary Tables

    GilaMonster (10/25/2013)


    Luis Cazares (10/25/2013)


    SELECT...INTO... statements aren't bad for performance. Actually, with good coding habits they can be a lot better. This is just on how the processes are logged.

    Insert into...

    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: Carry preceding column values down

    Maybe you could look on this great article from Jeff Moden. It might help you on your solution. It might not give you the exact query but if 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: Carry preceding column values down

    LAG value can go any rows back. That's the second parameter of the function. Check example C on the LAG documentation.

    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: Performance and Temporary Tables

    In the risk of hijacking this thread, I have to partially disagree with Mr. Zimmerman.

    SELECT...INTO... statements aren't bad for performance. Actually, with good coding habits they can be a lot...

    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: Carry preceding column values down

    If you're really using SQL Server 2012, you should take a look at the LAG function.

    For better answers, please take Sean's advice.

    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: Trouble with setting the value of a variable

    NineIron (10/24/2013)


    This knocked off a several seconds. Thanx.

    What exactly? Are you sure it wasn't helped by the buffer cache?

    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: rownumber() over with insert statement

    This might help you.

    WITH BillingGroups AS(

    SELECT BillingGroupNumber,

    row_number() over (order by BillingGroupNumber) as RowNum

    FROM Sap.DetailsImport

    )

    INSERT INTO [ReceiptRepository].[Lkup].[BillingGroups]

    SELECT BillingGroupNumber,

    'Company' + CAST(RowNum AS varchar(10)),

    'Y',

    'TeraByteMe',

    GETDATE(),

    TeraByteMe,

    GETDATE(),

    '2006-01-01...

    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 get the time taken by an ETL job and status- success or failure ?

    If you're running the package on BIDS, there's an execution results tab with that information.

    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 load data from Excel file to sql server table using only script task in SSIS.

    If you don't know coding, why would you want to do it with a script task if a data flow is the appropriate task for your situation?

    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: user functions

    ccavaco (10/24/2013)


    Where is the Stored Procedure? Lol

    There's none, it was just an example on how to do things correctly 😀

    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: Trouble with setting the value of a variable

    Just a couple of ideas to test for performance, but might not be an improvement.

    declare@Denominator2 int,

    @StartDate datetime,

    @EndDate datetime

    set @StartDate='2013-02-01'

    set @EndDate='2013-09-30'

    select @Denominator2= count(*)

    FROM

    (

    select a.MRN

    ...

    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: user functions

    If this is homework and want to impress your instructor, you should take a look at this article.

    http://www.sqlservercentral.com/articles/T-SQL/91724/

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