Forum Replies Created

Viewing 15 posts - 106 through 120 (of 172 total)

  • RE: CASE statement and NULL values

    Try this: -

    SELECT CASE WHEN F1 is NULL THEN F2 ELSE F1 END F11,CASE WHEN F2 is NULL THEN F1 ELSE F2 END F22

    FROM #Test1

    Regards,

    Andy Jones

  • RE: RTrim... ?

    I just ran

    SELECT command,len(command) FROM msdb.dbo.sysjobsteps

    and didn't see and spaces at the end of command, are you talking about the grid output in query analyser?

    Regards,

    Andy Jones

  • RE: update tables

    You do not say where the country_ID is stored, is it in a customer table? If so join ProductOwn_Details to customer and filter on country_ID = 8.

    e.g.

    insert into Newsletter_Details

    (

    customer_ID, NewsletterSubscribe_ID

    )

    select...

  • RE: Help with "table data type"

    Hi, from BOL: -

    Within its scope, a table variable may be used like a regular table. It may be applied anywhere a table or table expression is used in SELECT,...

  • RE: sysadmin

    Is your server configured to allow updates to system catalogs (see allow updates option in BOL)? If so maybe somebody updated master.sysxlogins.name (the table on which the view syslogins is...

  • RE: COLUMNS_UPDATED

    This is the test I ran, give this a go: -

    --Create table

    create table tab

    (

    c1 int

    , c2 int

    , c3 int

    , c4 int

    , c5 int

    , c6 int

    , c7 int

    , c8 int

    )

    GO

    --Create trigger

    create trigger tg_tab_up on tab for update as

    begin

    if columns_updated() | 128 = 128

    begin

    select 1

    end

    end

    GO

    --Insert record

    insert into...

  • RE: COLUMNS_UPDATED

    I tested using a bitwise OR operator and it seemed to work so try: -

    if columns_updated() | 128 = 128

    Regards,

    Andy Jones

  • RE: Grouping Expression

    Is ID numeric? If so try: -

    select

    'expr1'

    , sum(Value)

    From

    Tab

    where

    Id between 1100 and 1199

    union all select

    'expr2'

    , sum(Value)

    From

    Tab

    where

    Id between 2015 and 2025

    Regards,

    Andy Jones

  • RE: DDL Stored Procedure

    You would need to use dynamic sql for this task:-

    CREATE PROCEDURE NAME_PROC

    (

    @TABLENAME sysname

    )

    AS

    declare @sql varchar(1000)

    select @sql = 'CREATE TABLE ' + @TABLENAME + ' (OID int IDENTITY(1, 1) PRIMARY KEY...

  • RE: Naming Conventions

    There are a number of articles submitted about this. Click the search menu above and search on 'naming and standards' to retrieve some relevant articles.

    Regards,

    Andy Jones

  • RE: Remove Null Parameters from Select

    Could use: -

    SELECT @prmSKUResult = FSP.SKU

    FROM FSProducts FSP

    where

    (sizevalue = @prmsizevalue)

    and

    (colorvalue = @prmcolorvalue)

    and

    case

    when @prmwidthvalue is null then @prmwidthvalue

    ...

  • RE: How to use vertical bar as text qualifier?

    -t is the field terminator not the text qualifier.

    Regards,

    Andy Jones

  • RE: update mutiple tables...

    Need some more information here: -

    Should this update be performed as a one off job or each time the customer's products are updated?

    Also, you don't give any information on the...

  • RE: Long Date with Respect Locale Settings

    I believe the convert function is independent of regional settings: -

    select convert(char(16),getdate(),106)

    will give '16 Jul 2002' (i.e. not full month but char(3)).

    Regards,

    Andy Jones

Viewing 15 posts - 106 through 120 (of 172 total)