Forum Replies Created

Viewing 7 posts - 166 through 172 (of 172 total)

  • RE: tricky SP?

    declare @pk int

    insert into table1:

    table1.cell1

    ,table1.cell2

    ,table1.cell3

    select @pk = @@identity

    insert into table2:

    @pk

    ,table2.cell1

    ,table2.cell2

    ,table2.cell3

    Regards,

    Andy Jones

    andyj93@hotmail.com

  • RE: SQL Puzzles. Joins or something Else. Please Help

    Insert into Car Values( 1 , 'Infiniti')

    Insert into Car Values( 2 , 'Acura')

    Insert into Car Values( 3 , 'BMW')

    Insert into Car Values( 4 , 'Lexus')

    Insert into Style Values ( 1...

  • RE: Ignoring NULLS, empty string in ORDER BY

    Try :-

    SELECT field1, field2 FROM table

    order by

    case

    when field3 is null then 1

    when field3 = '' then 1

    else 0

    end

    ,field3

    Andy Jones

    andyj93@hotmail.com

  • RE: Using current month as input to scheduled DTS

    Yes, in an 'Execute SQL' task specify your sql statement to be something like :-

    exec sp_Name ?

    Then click the parameters button to assign the global varaible to the ? parameter.

    Andy...

  • RE: Using current month as input to scheduled DTS

    Create a global variable within the DTS package called month. The following ActiveX script will assign the current month to the variable which can then be referenced throughout the package.

    '**********************************************************************

    '...

  • RE: Making Dynamic Queries Static

    Hi, how about :-

    SELECT

    *

    from

    account A

    inner Join Contact C on a.primarykey=c.accountkey

    inner join Address D on A.primarykey=D.foreignkey

    WHERE

    case

    when @Aname is null then A.Name

    else...

  • RE: Dynamic ORDER BY (ASC-DESC)

    Hi Deejay, an option is,

    SELECT

    M_education.name,

    M_Education.xdate AS enddate

    ORDER BY

    case @edu_asc_desc

    when 1 then Enddate

    else null

    end asc

    ,case @edu_asc_desc

    ...

Viewing 7 posts - 166 through 172 (of 172 total)