Forum Replies Created

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

  • RE: Check Columns Exist Before Select

    As a side note, columns of type BIT cannot be null; you can only add one without a default value if the table is empty (at least in my experience)....

  • RE: Cursors - Are they always the wrong way

    In the situation I described last week, the cursor in question was global.

    RD Francis

  • RE: Cursors - Are they always the wrong way

    A number of people have said cursors are a problem because of how much memory they use. I have seen a problem with speed and cursors, and haven't clearly...

  • RE: Query analyzer messages tabs output

    Are you actually trying to do this in Query Analyzer, or to get Query Analyzer "message" output in another app?

    Although someone said you can get the Query Analyzer to output...

  • RE: Date format help!!!!

    Not sure exactly what you're going for here.

    The following query should select only values where t1 is midnight, April 9, 2003, and would return t1 and t2 in the format...

  • RE: Date format help!!!!

    OK, forgot to try that before I posted:

    You actually have to add -2 or -3 to get the date to flip back to yesterday, at least on my machine. ...

  • RE: Date format help!!!!

    I'm assuming that you wanted 9-Apr-03, not 8-Apr-03. If you really wanted yesterday's date, then use DATEADD to add -1 days to the date before you start to work...

  • RE: Date format help!!!!

    This does what you ask....

    DECLARE @myDate datetime

    SET @myDate = CONVERT(datetime,'2003-04-09 00:00:00.000')

    print convert(varchar,DAY(@myDate)) + '-' + substring(datename(mm,@myDate),1,3) + '-' + substring(convert(varchar,YEAR(@mydate)),3,2)

    Is that what you wanted?

    RD Francis

  • RE: Query analyzer messages tabs output

    To state the obvious, you can copy the output stored in the Messages pane, and paste it into some other app. As far as redirrection goes, I'd suggest checking...

  • RE: dynamic Case

    Well, this would give you the sums on column 5 for all values of col 4:

    SELECT col1,col2,col3,col4,sum(col5) as [Sum for column 4]

    FROM sample

    group by col1,col2,col3,col4

    This sounds close...

  • RE: User Define Function error

    I see where I went wrong - I was looking at the code supplied by guarddata, which fixes the leap year issue. That may still be the best solution....

    RD...

  • RE: Search for a specific character length

    If the table is very large, and speed becomes a problem, you might want to add a BARCODE_LEN field to the table, and index that field. You could keep...

  • RE: VERY slow running cursor

    Note that, if any of the matching records from the report table could be used to update the demographics table, then the solution I present should still work; however, if...

  • RE: VERY slow running cursor

    As the last poster noted, it appears you don't want to update using every possible match in reports, only the first one the cursor finds. If that's what you...

  • RE: Am I crazy?

    jpipes is correct - this would be better:

    SELECT * from hardware

    where serial_number in

    (select serial_number from hardware

    group by serial_number

    having count(serial_number) > 1)

    That should show every record with a given...

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