Forum Replies Created

Viewing 15 posts - 976 through 990 (of 1,229 total)

  • RE: Delete with in case statement

    You don't need a cursor.

    Run this and check that the output represents the rows you want to delete:

    SELECT pmt.*, '#', pt.*, '#', p.*

    FROM posriskmatrix_testing pmt

    INNER JOIN pos_testing pt

    ON pt.idinst...

  • RE: Logged Operations

    WayneS (4/7/2011)


    mohammed moinudheen (4/7/2011)


    It is very tough to get this question right:)

    Actually, I meant it to be tough. The other choices are all myths that a lot of people...

  • RE: Question about "coalesce"

    ichiyo85 (4/11/2011)


    Thank you very much experts.

    Yes I will not have both ID1 and ID2 to be null. Also, ISNULL might not be a good idea for me because ID1...

  • RE: Question about "coalesce"

    ichiyo85 (4/11/2011)


    Hi experts,

    I have 2 tables where I want to join by ID1, IF NOT THEN join by ID2.

    Would this code work?

    select * from table1

    left join table2

    on coalesce(table1.ID1,table1.ID2) = coalesce(table2.ID1,table2.ID2)

    I...

  • RE: Question on JOIN

    nailers (4/11/2011)


    I am going to try and make the example easier to follow, in hopes I can explain myself properly.

    I have two tables named: LiveRun and Run

    The LiveRun table has...

  • RE: How to find Row number

    Pink123 (4/11/2011)


    No the temp table doesnt have any rownumbers.

    It sjust

    insert into #temptable

    select ....

    from ...

    then I do a select rownumber as mentioned in my query and it gives rowcount as...

  • RE: How to find Row number

    Pink123 (4/11/2011)


    I found the mistake it was the wrong table name ,but this is giving me the rownumber as 1 and showing 1 record .

    How do I get the actual...

  • RE: SQL Server Conditional Join

    There may be some mileage in preprocessing table b (as a derived table) before joining to table a:

    SELECT a.DealNumber, b.DealStatus, a.StepNum

    FROM a

    LEFT JOIN (

    SELECT DealNumber, DealStatus, StepNum,

    IDInGroup = ROW_NUMBER()...

  • RE: Code to summary row

    adonetok (12/15/2010)


    Can someone help me to code for row summary based on user's selection?

    For example, one table is as below. There are 100 columns. (I only list 10 columns)

    Each cell...

  • RE: Are the posted questions getting worse?

    Tom.Thomson (12/12/2010)


    Steve Jones - SSC Editor (12/11/2010)


    Tom.Thomson (12/11/2010)


    Celko's been at it again, and Gus's response http://www.sqlservercentral.com/Forums/FindPost1032150.aspx is unfair to monkeys.

    Excellent response from Lowell and Gus.

    Tom, new avatar?

    Yes, it changes now...

  • RE: Calling function twice in same select

    Can you post the whole view definition, Chrissy?

  • RE: default parameter in a function

    Specifying an expression rather than a value for the parameter default. Try this instead:

    ALTER FUNCTION myTbl

    (@theDate smalldatetime = NULL)

    RETURNS TABLE

    AS

    RETURN

    (

    SELECT scd.SalesCd

    FROM dbo.dimSalesCodes scd

    WHERE scd.endDate > ISNULL(@TheDate, DATEADD(dd, DATEDIFF(dd, 0,...

  • RE: unique clustered index on 2 columns

    ahmed7.bi (12/12/2010)


    as mentioned above i have inserted below records

    insert into test4 values (1,1,'asd')

    go

    insert into test4 values (2,1,'asd')

    the command executed successfully

    my query is that as i have included first...

  • RE: unique clustered index on 2 columns

    ahmed7.bi (12/12/2010)


    Hi

    i have read that only one unique clustered index can be created on a table and many non clustered index

    then how come the below commands works fine as...

  • RE: Need a little help with a date driven report

    The DATE datatype in SQL Server 2008 is exactly that - date without time. Try running SELECT CAST(GETDATE() AS DATE).

    The script in your attachment will require a few changes to...

Viewing 15 posts - 976 through 990 (of 1,229 total)