Forum Replies Created

Viewing 15 posts - 13,681 through 13,695 (of 13,877 total)

  • RE: "if all items on the order are xyz, then extract" -- Please Help

    Something like this?

    select distinct a.ordernumber

    from tblorder a

    where a.ordernumber not in

    (select distinct b.ordernumber

    from tblorder b

    where right(b.itemnumber,3) 'rtd')

  • RE: condition in where to avoid subquery

    Hi Brett, try putting single quotes around DNPISIMPORT and running this again.

    Regards

    Phil

  • RE: Assigning variable to multiple rows?

    Exactly right. Of course, if there might be more than 4 messages, you might have to go dynamic ...

    Phil

  • RE: DTS using multiple Datasources

    Hi Karen

    I think you'll have to add the Oracle server as a "linked server" - this can be done from Enterprise Manager in SQL Server - and then you'll be...

  • RE: Assigning variable to multiple rows?

    Something like this should do it:

    declare @msg1 as varchar(50), @msg2 as varchar(50), @msg3 as varchar(50), @msg4 as varchar(50)

    declare @client as char(6)

    set @client = 'a10051'

    set @msg1 = (select msg from tblMsg...

  • RE: query logic on frequent update

    If you really have got full design freedom, then here is how I would create the tables:

    1) Product (ID (PK), Description, {+ other product info fields})

    2) Distributor (ID (PK), Description,...

  • RE: Last() in SQL Server 2000?

    MAX works fine on string columns.

  • RE: Need help with a calculation trigger

    Joe

    I cannot see anywhere in the original post any mention of files.

    As for columns and rows not being referred to as fields and records, please explain what practical problems this...

  • RE: INSERTED and DELETED tables in Triggers

    To quote from BOL: "An update transaction is similar to a delete operation followed by an insert operation; the old rows are copied to the deleted table first, and then...

  • RE: query logic on frequent update

    Rolf, it would help me to know a bit more about the current db schema. I'm guessing that you have something like:

    Product(ID (PK), Description)

    DistributorA(ProductID (PK), CurrentPrice)

    DistributorB(as above)

    DistributorC(as above)

    with ProductID...

  • RE: Insert daily records from one table to individual merchant tables

    Is there any reason why you don't have a single table for all the merchants, containing a 'MerchantID' field to identify which merchant it is from? Then you could...

  • RE: Need help with a calculation trigger

    I think something like this should work. You need to read BOL for more info on how triggers work, but this one uses a notional recordset called 'inserted', which...

  • RE: Msg 2754 from Transact-SQL

    Use this:

    raiserror('',20,1) with log

    which will terminate the client connection (severity > 19) and write to the error log.

    Regards

    Phil

  • RE: "Ignore alpha command" -- Please Help

    I reckon you need to use the isnumeric() function and treat the numeric and non-numeric codes separately. Try something like this:

    SELECT ITEMNO AS Item

    FROM [ITEMMAST-10-25-04]

    WHERE isnumeric(itemno) = 1 and...

  • RE: SQL

    Maybe something like this will help - calculate week number and then group on that - no looping required.

    SELECT

    (datediff(d,'2001-01-01',entrydate) / 7 + 1) as week

    COUNT(orderno) AS NumberofTotalOrders,

    ...

Viewing 15 posts - 13,681 through 13,695 (of 13,877 total)