Forum Replies Created

Viewing 15 posts - 466 through 480 (of 1,409 total)

  • RE: Round off sum values

    Use the ROUND (http://technet.microsoft.com/en-us/library/ms175003.aspx) function and place the calculation inside as the numeric expression.

    [New_Value] = ROUND( isnull(sum([Yearly_Value]-[Previous_Year_Value]),0) , 1)

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: Add Job Interval and Time to Script

    Adjust the WHERE clause to your own needs. I have chaged it (filter on name) to work in my own environment. It also filters to only display the jobs that...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: Add Job Interval and Time to Script

    I think this solution is close to what you want.

    SELECT DISTINCT

    Jobs.NAME AS Job_Name

    , Jobs.description AS Alias

    , 'Enabled' = CASE (Jobs.enabled)

    WHEN 0

    THEN 'No'

    WHEN 1

    THEN 'Yes'

    ELSE '??'

    END

    ,

    -----------------------------------------------------------------

    'Frequency' = CASE (SysSched.freq_type)

    WHEN 1

    THEN...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: Add Job Interval and Time to Script

    SELECT DISTINCT '[linked_server]' AS Server,Jobs.Name AS Job_Name, Jobs.description AS Alias,

    'Enabled' = CASE (Jobs.enabled)

    ...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: installing new cluster on existing cluster nodes

    You can find several sites on the internet to get a step-by-step on how to create a slipstream installation set. For example:

    http://sqlcurve.wordpress.com/2013/06/04/how-to-slipstream-sp2-or-sp1-for-sql-2008-r2/

    http://blogs.msdn.com/b/petersad/archive/2011/07/13/how-to-slipstream-sql-server-2008-r2-and-a-sql-server-2008-r2-service-pack-1-sp1.aspx?Redirected=true

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: installing new cluster on existing cluster nodes

    Install a "new failover SQL cluster installation" on a node. Although it should not matter I prefer to install on a non-used node (node 3 or node 4), just in...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: sum of two queries

    ChrisM@Work (3/18/2014)


    DATMVT also.

    You could an aggregate function to retain one of the values of LIBTYPMVT, DATMVT

    e.g. MIN(LIBTYPMVT)

    Good call, I missed that one 😉

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: sum of two queries

    The value in column "tm.LIBTYPMVT" differs, so this will result in a single row for each value. If you remove column "tm.LIBTYPMVT" from the SELECT list, the results will be...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: sum of two queries

    136romy (3/18/2014)


    HanShi when I apply your proposal query gives me the results with lots of numbers, but not my stock

    Take the advise of ChrisM to write your query in a...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: sum of two queries

    Create the same query and alter the WHERE clause part on TYPE_MOUVEMENT.LIBTYPMVT to:

    ... and (TYPE_MOUVEMENT.LIBTYPMVT like 'sorti%' OR TYPE_MOUVEMENT.LIBTYPMVT like 'entr%') ...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: Windows errors in SQL jobs

    I would get the output of a xp_cmdshell command into a temp-table. Then you can query this temp-table for possible errors. Use RAISE ERROR when there is an error found.

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: Need help in table design

    dsh_roy (3/14/2014)


    Hi All,

    Can someone give me the sample table design of Overpayments associate with transactions?

    Thanks

    Disha

    We need a lot more information before we can give you an example.

    - What information is...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: Query against registered server

    The only way I know of is to open a multiple-server query from within SSMS (with registerd servers). But it's not a programmable way to do it.

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: Trying to add up my case statements

    Will the results be as expected when you move the MAX and GROUP BY from the inner query to the outer query? This will always result in one single row.

    SELECT...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • RE: Trying to add up my case statements

    When you get two records as a result this implies the inner query (starting with SELECT DISTINCT) is returning two records.

    Select and execute the inner query to see if the...

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **

Viewing 15 posts - 466 through 480 (of 1,409 total)