Forum Replies Created

Viewing 15 posts - 16 through 30 (of 53 total)

  • RE: SQL Query

    Have to notice that these children will not get a chance to improve 😉

    The query above will include all kids that were absent 3 or more days, regardless the fact...

  • RE: Divide by Zero

    Seems that I managed to find a way to use CASE with OVER:

    select Case SUM(curamount over (partition by employeeid,docdate)

    ...

  • RE: Divide by Zero

    It seems to me that Ninja’s_RGR’us solution will not work.

    Tried to create something similar, but it reports the error:

    “Msg 4113, Level 15, State 1, Line 1

    "ISNULL" is not a valid...

  • RE: Divide by Zero

    Hi

    The run time error you are getting is mathematical issue.

    Any number different to 0 or infinite, when divided by 0 is infinite.

    As it is often said (although not 100%...

  • RE: JOINing on many tables...

    I think that I got what you mean.

    Please run the from the attachment and you will see that it is all the same.

    there will be no difference in the result...

  • RE: JOINing on many tables...

    My understanding is that you are asking which one is correct:

    SELECT .... FROM TABLE_A A

    LEFT JOIN TABLE_B B

    ON A.Id=B.ID

    LEFT JOIN TABLE_C C

    ON A.Id2=C.Id2

    Or

    SELECT .... FROM TABLE_A A

    LEFT JOIN TABLE_B...

  • RE: Disaster Recovery Planning

    Thank you.

    This was great question and I don't think that there was anything wrong with the wording...

    Always good to learn new things and clarify those one believes that they know...

  • RE: Disaster Recovery Planning

    Grrr...answered incorrectly (4th option) and am quite annoyed about it atm.

    I was under impression that both options 3 and 4 could be correct.

    Is this straightforward thing that RTO applies to...

  • RE: How to delete data from 2 tables that r linked

    You could also write a trigger yourself,

    something like:

    CREATE TRIGGER trgDel_DeleteChildren

    ON ParentTable

    FOR DELETE

    AS

    delete from ChildTable

    where id in (select id from deleted)

    Id would be refference value between those two tables

    'deleted'...

  • RE: How to delete data from 2 tables that r linked

    Need to run ALTER TABLE

    Please check BOL for syntax, you can still add ON DELETE CASCADE even if the table is already created.

  • RE: How to delete data from 2 tables that r linked

    Hi

    You should check ON DELETE CASCADE option.

    Please check BOL:

    ms-help://MS.SQLCC.v10/MS.SQLSVR.v10.en/s10de_1devconc/html/54ca1d10-5106-4340-bde4-480b83e7e813.htm

  • RE: Binary split

    I think that this is what you needed:

    create table #t( Num int)

    insert into #t (num)

    values (20)

    insert into #t (num)

    values (4)

    ;with cte (StartPoint,TheRest,ToContinue,Col )

    as

    (

    select Num, Num % 2, Num/2 ,1...

  • RE: SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED same as (nolock)

    Yes, it does.

    But be careful with reading uncommitted

  • RE: Restructure 100 Million Row (or more) Tables in Seconds. SRSLY!

    In my opinion, adding a trigger to the production database; creating a table in production database, dropping a table from production database, creating a job in production database - IS...

  • RE: Conversion issue when assigning smallmoney data type to varchar

    believe that it is because of the following:

    Set @V1=@V2 is doing CAST. And for CAST and smallmoeny data type default is to show 2 decimal digits.

    If you do

    CONVERT (varchar(10),@V@,2)

    You should...

Viewing 15 posts - 16 through 30 (of 53 total)