Viewing 15 posts - 106 through 120 (of 138 total)
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)....
May 27, 2003 at 1:23 pm
In the situation I described last week, the cursor in question was global.
RD Francis
May 27, 2003 at 1:07 pm
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...
May 22, 2003 at 10:35 am
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...
May 22, 2003 at 9:01 am
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...
May 22, 2003 at 8:40 am
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. ...
May 22, 2003 at 8:03 am
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...
May 22, 2003 at 7:55 am
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
May 22, 2003 at 7:51 am
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...
May 21, 2003 at 9:54 am
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...
May 16, 2003 at 2:49 pm
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...
May 16, 2003 at 2:10 pm
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...
May 16, 2003 at 1:36 pm
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...
May 16, 2003 at 1:32 pm
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...
May 16, 2003 at 1:30 pm
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...
May 16, 2003 at 7:52 am
Viewing 15 posts - 106 through 120 (of 138 total)