Forum Replies Created

Viewing 15 posts - 2,881 through 2,895 (of 3,543 total)

  • RE: 20 % records

    Does the table have a unique id? If so then

    select a.* 
    
    from tablea a
    where a.[uniqueid] in
    (select top 20 percent [uniqueid]
    from tablea
    where...
  • RE: Uing BCP with multiple result sets

    bcp each select into different file and then concatenate files.

    or

    If all the selects have same columns then use union.

    or

    Concatenate each column (converting to char/narchar if necessary) into single column with...

  • RE: Adding a value to a 'datetime' column caused overf

    Check your data (dbo.Progress_Notes.Date_) the lowest date allowed (SQL7) is '1753-01-01'. Subtracting from a date that produces a value less than this will cause the error.

  • RE: Missing integers from Excel

    quote:


    It said that the first 8 lines are used for determining whether the column will be imported as char or float....

  • RE: Missing integers from Excel

    Something like this was mentioned in another thread. It seems that if you use Excel import in DTS, Excel will not convert char and numeric in same column, if it...

  • RE: SQL Mail

    quote:


    but if you put a single quote before the numeric value, Excel will automatically treat it as text


    December 11, 2003 at 5:59 am

    #485687

  • RE: SQL-MAIL

    Either

    a) Install email client (Outlook 2000 or greater), create profile (under account running sql server) that uses a mailbox on exchange, set up sqlmail to use profile, use xp_sendmail to...

  • RE: Emailing via SMTP relay

    Sqlmail will only work with mapi profile and you need email client installed (Outlook 2000 or greater) although I believe SQL2000 SP3 allows the use of Outlook Express. Otherwise you...

  • RE: Stored procedure help needed.

    Agree with Frank.

    (Wow did I really say that )

    But if you do want to put the results in another table then

    INSERT...
  • RE: Alternative to NOT IN

    quote:


    The outer join should be faster than the Not Exists


    Hmmm, interesting. I thought...

  • RE: Happy anniversary

    quote:


    Am I wrong or are you much older than me


    Age is relative my...

  • RE: dubstraction in a sql query

    SELECT s.id, s.item, 
    
    SUM(ISNULL(e.in,0)) as 'total_in',
    SUM(ISNULL(e.out,0)) as 'total_out',
    SUM(ISNULL(e.in,0)-ISNULL(e.out,0)) as 'total_stock'
    FROM stock s
    LEFT OUTER JOIN event e
    ON s.id = e.item_id
    GROUP BY...
  • RE: Happy anniversary

    Congrats and well done Frank, you sentimental sycophantic old fool.

    quote:


    Now, can a moderator please...

  • RE: Alternative to cursor

    quote:


    From OP's code, it doesn't appear that Cust is in the primary key, so perhaps that shouldn't be in the join.
  • RE: How would you do this?

    I would use and IF statement on CASESETTLED to decide which table to join to TBLCASE.

Viewing 15 posts - 2,881 through 2,895 (of 3,543 total)