Forum Replies Created

Viewing 15 posts - 1 through 15 (of 17 total)

  • RE: Problem Solving : Update All Subsequent Records Over A Unique ID AFTER A Trigger

    Hi,

    The function in the table definition is a calculated column (you can google it 🙂

    the function returns 1 if the P_DATE for the Propnum is minimum .. the first inserted...

    D.Mincic
    😀
    MCTS Sql Server 2008, Database Development

  • RE: Problem Solving : Update All Subsequent Records Over A Unique ID AFTER A Trigger

    Hi,

    Maybe you can try with a computed column

    REF: https://msdn.microsoft.com/en-AU/library/ms188300.aspx

    CREATE FUNCTION dbo.getFirstP_DatePropnum(@date date, @Propnum INT)

    RETURNS BIT

    AS

    BEGIN

    RETURN

    CASE

    ...

    D.Mincic
    😀
    MCTS Sql Server 2008, Database Development

  • RE: Transaction isolation level and implicit transactions

    Hi Stephanie,

    The scope of the transaction isolation levels is Session.

    This means that all transactions within the session (explicit, implicit or auto-commit) will follow, in this example the optimistic locking methodology...

    D.Mincic
    😀
    MCTS Sql Server 2008, Database Development

  • RE: with rollup and null values

    Hi naidzionik,

    It might have something to do with the linked server provider (not sure) and how SUM handles NULLs (should just ignore it)

    eg. this worked for me:

    SELECT

    [Dim1]

    ,[Dim2]

    ,[Dim3]

    ,SUM(ISNULL([Metric],0)) Sum_Metric

    ,GROUPING(Dim1) Grouping_Dim1

    ,GROUPING(Dim2) Grouping_Dim2

    ,GROUPING(Dim3)...

    D.Mincic
    😀
    MCTS Sql Server 2008, Database Development

  • RE: xml file and conversion datetimeoffset ?

    christophe.bernard 47659 (10/14/2015)


    Hello Eirikur Eiriksson and Dean Mincic,

    thanks for your time that's exactly what i want ..and now that's work ..

    I don't know why the property of this object is...

    D.Mincic
    😀
    MCTS Sql Server 2008, Database Development

  • RE: xml file and conversion datetimeoffset ?

    Hi Christophe,

    The problem with the query you provided is related with the datetime datatype.

    The datetime can store dates from January 1, 1753 ...

    In the example the query tries to cast...

    D.Mincic
    😀
    MCTS Sql Server 2008, Database Development

  • RE: multi-part identifier could not be bound

    Hi Sean,

    I didn't have enough time to go through the query and to understand the query logic to be able to "assume" what's that all about. The two things caught...

    D.Mincic
    😀
    MCTS Sql Server 2008, Database Development

  • RE: multi-part identifier could not be bound

    Hi cthorn112,

    I think that's ok to set the isolation level to READ UNCOMMITTED if you know what to expect.. dirty reads and all other side effects (personally I've never been...

    D.Mincic
    😀
    MCTS Sql Server 2008, Database Development

  • RE: Help with query

    Hi

    One of the possible solutions could be

    --create some test data

    USE tempdb

    GO

    CREATE TABLE test1 (sessionId int, MRN int, ChartStartTime date ,DeliveryTime date)

    GO

    INSERT INTO dbo.test1(sessionId,MRN,ChartStartTime,DeliveryTime)

    SELECT...

    D.Mincic
    😀
    MCTS Sql Server 2008, Database Development

  • RE: Syntax question

    Hi,

    you can use grouping to find sum of Prices over the required set of columns (all except OI.Price)

    ..maybe something like...

    SELECT --without DISTINCT ...

    ...

    DATENAME(ww,o.OrderDate) as 'Week',

    o.Pieces,

    SUM(OI.Price) AS '$',

    ct.CustType,

    'Everything Else' as 'Code...

    D.Mincic
    😀
    MCTS Sql Server 2008, Database Development

  • RE: SQLCMD format issue

    You can format the output like

    ....sqlcmd ...

    1> SELECT FORMAT(Column_Name,'0') FROM table

    2> GO

    ...

    1

    1

    1

    D.Mincic
    😀
    MCTS Sql Server 2008, Database Development

  • RE: Table locking while insert statement

    Hi shamshad.ali

    I think there's noting wrong with the isolation level. (READ_COMMITTED I believe).

    If I understand, you described two situations:

    Situation 1

    1. You started an explicit transaction in SESSION1 with the multiple...

    D.Mincic
    😀
    MCTS Sql Server 2008, Database Development

  • RE: Need Help in Recursive Query in SQL using CTE

    -

    D.Mincic
    😀
    MCTS Sql Server 2008, Database Development

  • RE: Need Help in Recursive Query in SQL using CTE

    Hi,

    If I got it right, the requirement is to pick a node from hierarchy and go in both directions, reverse to the root and down to the leaf level.

    I set...

    D.Mincic
    😀
    MCTS Sql Server 2008, Database Development

  • RE: omit rows that have NULL value

    Hi,

    I thought that the query was generated by a report tool or something.

    ..DISTINCT and Grouping,,... predicate 1 =1 and so on.

    The logic of the query is not clear. Do you...

    D.Mincic
    😀
    MCTS Sql Server 2008, Database Development

Viewing 15 posts - 1 through 15 (of 17 total)