Forum Replies Created

Viewing 15 posts - 2,326 through 2,340 (of 8,731 total)

  • RE: convert sum of seconds to time h:mm:ss

    drew.allen (8/9/2016)


    As long as you're under 24 hours you can use the following.

    DECLARE @duration_sec INT = 1300

    SELECT DATEADD(SECOND, @duration_sec, CAST('00:00' AS TIME))

    This method should work for any unit of time...

    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: convert sum of seconds to time h:mm:ss

    To use the formula, just change the variable with your "seconds" value. My guess is that you need to replace @Duration_Sec with sum([TalkTime]+[HoldTime]+[PostCallProcessingTime])/sum([CallsAnswered]).

    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 Question

    For a simple count of the tables, you can use something like this:

    SELECT t.name AS Table_Name, SUM(row_count) AS Row_Count

    FROM sys.dm_db_partition_stats s

    JOIN sys.tables t ON s.object_id = t.object_id

    WHERE index_id IN (0,1)--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: Summarising MONTH value

    Use the DATENAME() 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: Am i the only one getting 150 SPAM emails every day?

    curious_sqldba (8/9/2016)


    Lynn Pettis (8/9/2016)


    curious_sqldba (8/9/2016)


    I am subscribed to these groups:

    Current SubscriptionsNotification

    Home » SQL Server 2008 » SQL Server 2008 Performance Tuning

    Instant

    Home » SQL Server 2014 » Administration - SQL Server...

    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: Capture severity 10 error

    AFAIK, errors with severity 10 or lower can't be captured as they're basically warnings.

    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: Select within Case Statement

    The Dixie Flatline (8/9/2016)


    Use of a variable in a query keeps it from running in parallel?

    No, the use of a scalar function in the query.

    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: SQL Joins

    It's not about one join being better than the other. It's about using the correct join for each query.

    Here's an explanation on how each join works.

    http://www.codeproject.com/Articles/33052/Visual-Representation-of-SQL-Joins

    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: Select within Case Statement

    The Dixie Flatline (8/9/2016)


    I would look at rewriting the scalar function dbo.calcperiod to a itvf (in-line table valued function) and modify the second option to use it instead of 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
  • RE: Select within Case Statement

    Is this query:

    select dbo.calcperiod(value) from sys_registry where system_code = 'gbl' and name = 'reportdate'

    related any way to the outer query?

    Will it return a single row? If so, why don't...

    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: ssrs 2008 default parameter value

    wendy elizabeth (8/9/2016)


    I tried this and this does not help.

    What's 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: Am i the only one getting 150 SPAM emails every day?

    Are you subscribed to the forum? Is the spam coming from spam threads created in the forum and then deleted?

    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: Table of Dates in TSQL

    ChrisM@Work (8/9/2016)


    Luis Cazares (8/9/2016)


    Even if with this amount of rows it might make no difference, avoid using recursive CTEs to count generate rows...

    ...because they're way too expensive for such 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: Table of Dates in TSQL

    Even if with this amount of rows it might make no difference, avoid using recursive CTEs to count. Here's another version which might seem too wordy, but it will be...

    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: simple date function concept

    Anandkumar-SQL_Developer (8/8/2016)


    Thank u Luis Cazares ,

    ...

    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,326 through 2,340 (of 8,731 total)