Forum Replies Created

Viewing 15 posts - 12,016 through 12,030 (of 13,461 total)

  • RE: SQL Date range SUM

    I think something using BETWEEN would be my suggestion:

    AND d2.trade_date BETWEEN getdate() -730 AND getdate()

    or

    AND d2.trade_date BETWEEN '01/01/2007' and '01/01/2008'

  • RE: Print statement results altered in procedures

    i had a similar issue with an Oracle provider; the provider would strip out/replace CrLf and tabs with a space in a statement being executed...

    so a statment like this:

    SELECT STUFF,

    MORESTUFF...

  • RE: data error in cursor

    you'll get better responses if you can post what you are actually doing...theoretical questions get loosy goosy answers...the more detailed your question, the more detailed an answer you can receive.

    you...

  • RE: return only end of column after certain character

    the trick is to use the REVERSE function and charindex.

    I've broken it down step by step so you can see what's happening, along with a final long formula:

    [font="Courier New"]

    DECLARE @str...

  • RE: Sp_ExecuteSql

    what you want to do is look at the books online examples for sp_executesql; look specifically at the OUTPUT parameters.

    here's an example directly modified from BOL: I'm selecting an arbitrary...

  • RE: Cannot find FIX for BUG

    well the KB article mentions it might take a long time for a trigger to compile, depending on the trigger.... since it just takes a while, but still works, i...

  • RE: how to generate next #

    ok, I'm making a lot of assumptions, like ther emust be 3 more items added for EVERY item that's in your sample table. if an item overlaps where id_3, you...

  • RE: TSQL : Retrieve results from messages window

    I'm watching this thread because others more knowledgable than me might throw something out there.

    As far as I know, you can capture the print messages from an application, but not...

  • RE: Freak query ...

    i can emulate the same error if the payments table has a row with nulls in the REFERENCE column.

    other than that, maybe it's a difference in coallation between the two...

  • RE: Freak query ...

    two things i see...can reference be null in the payments? also i prefer to use a left join syntax instead..

    1a - select * from import_cc_requests where reference not in (select...

  • RE: Trigger is not firing?

    yeah i think we need to see the trigger code itself...it might not be designed to handle multiple rows on insert or something basic like that.

    show us the code so...

  • RE: Importing CSV files without knowing destination schema

    that's actually a good question.

    It kind of depends on your data...

    I'm still playing with Jeff Moden's awesome example, but with the openrowset function, I think you need to know the...

  • RE: Creating a Trigger on a table by a stored procedure in another database

    here's just a couple of things that I see wrong with your on-the-fly code:

    1. SET "@TblName = (your code) would return null if a full part tablename wasn't passed...

  • RE: SQL SERVER 2005

    make sure your data fields are NVARCHAR, not plain old varchar.

    after that, make sure when you are inserting the data that you specifically cast them as nvarchar...selecting a varchar into...

  • RE: more than one query in CASE-WHEN-THEN statement

    it looks like you are just trying to make a single procedure return a variety of different values...sort of a do-all proc.

    I would suggest getting rid of the case...

Viewing 15 posts - 12,016 through 12,030 (of 13,461 total)