Forum Replies Created

Viewing 15 posts - 256 through 270 (of 362 total)

  • RE: Converting minutes to days and hours

    [font="Verdana"]

    Yes, just concatenate the columns.

    Declare @theMinutes int

    Set @theMinutes = 2945

    Select @theMinutes / 1440 as NoDays + ' ' + (@theMinutes % 1440) / 60 as NoHours...

  • RE: Increment field value by 1

    [font="Verdana"]

    Assuming you got a stroed procedure.

    ...

    Declare @Id Int

    Select @Id = Max(DocID) From TableB

    Insert Into {TableB}

    Select @Id, A.Col1, A.col2... From TableA As A

    ...

    Mahesh

    [/font]

  • RE: rounding problem

    [font="Verdana"]

    set @RoundedVar = 0.996;

    SELECT round(@RoundedVar,2)

    Even if you would have been tried this code, you will get the o/p which you did get earlier. That is 1.00

    DECLARE @RoundedVar decimal(10,2)

    set @RoundedVar =...

  • RE: Records Accessing Problem

    [font="Verdana"]

    For row = 0 To .UpperBound(1)

    .value(row, 13) = IntnewBno

    ...

  • RE: cursor to step through user databases

    [font="Verdana"]

    print (@dbname)

    set @sqlstr = 'use ' + @dbname + @ctrl

    After the above statement, add the below line to your code.

    Exec (@sqlstr)

    Here you have just builded the dynamic sql string, but...

  • RE: Working on Triggers

    [font="Verdana"]

    Also,,, Can anybody explain me how to get only the acting on update, insert on rows from column 21, 22 and 30 for example? I tried to read the msdn's...

  • RE: SQL Cursors

    [font="Verdana"]

    These are few good sites where you can search and update your SQL skills.

    http://www.mssqltips.com/

    http://www.sqlteam.com

    http://www.sqlservercentral.com/

    Mahesh

    [/font]

  • RE: Excluding in a query with multiple conditions?

    [font="Verdana"]

    Select {col1, Col2, ...Coln} From {Table}

    Where (Department <> 2 And Category2 <> 'B')

    And (Department <> 2 And Category3 <> 'C')

    And (Department <> 3 And Category1 <> 'A')

    And (Department <>...

  • RE: Different Criteria within the same View/Report

    [font="Verdana"]Post some real life data with desired o/p.

    Mahesh[/font]

  • RE: temp table not dropped

    [font="Verdana"]

    No cure needed... they automatically drop at the end of the proc (poet and don't know it, too!)

    Thanks Jeff for updating me. I was under impression that, they...

  • RE: Changing Rows to Columns

    [font="Verdana"]

    ...is PIVOT not supported in SSExpress2005?

    It might be the problem of Compatibility Level. Even I have faced the same problem with SQL Server 2K5. Check the Compatibility Level ...

  • RE: temp table not dropped

    [font="Verdana"]

    Jeremy (4/22/2008)


    If I'm not mistaken, #temp table are implicitly dropped at the end of the stored procedure regardless of whether or not you explicitly drop it. ##temp tables (global ones)...

  • RE: Records Accessing Problem

    [font="Verdana"]I think you must go the way Robert has suggested you earlier. Ask DB guy to alter the table and add the identity column, so that you’re every call which...

  • RE: Changing Rows to Columns

    [font="Verdana"]Yup, I think Bindu has suggested nice solution. Even she has exact o/p desired by the original poster.

    Mahesh[/font]

  • RE: Efficient Query

    [font="Verdana"]Look at the Execution Time, right bottom hand ... :D[/font]

Viewing 15 posts - 256 through 270 (of 362 total)