Viewing 15 posts - 991 through 1,005 (of 1,033 total)
craig (4/3/2008)
The people code id identifies the person, but the table has a composite primary key with these columnspeople_code_id
test_id
test_type
test_date
does this change anything?
Nope, as long as a single field identifies a...
April 3, 2008 at 4:16 pm
To use EXISTS you'd need to get craftier
select *
from testscores as ts1
where alpha_score_1 like 'f%'
and not exists (select * from testscores where alpha_score_1 like 'p%')
Becomes
select *
from testscores as...
April 3, 2008 at 4:14 pm
Because you used EXISTS/NOT EXISTS instead of IN.
Books Online
April 3, 2008 at 4:09 pm
Yes... I took a wildswing as to what the field may or may not be called.
It's also why I asked for the structure. 🙂
April 3, 2008 at 4:00 pm
The problem then is that your query is filtering record by record. Just because the table has multiple records for the same user and some have the p1,p2 doesn't...
April 3, 2008 at 3:43 pm
Sample Data, Actual Structure please.
Are the f1,f2,f3,p1,etc values all in the field on a single record, or does each f1,f2,p1,p2 have it's own record?
April 3, 2008 at 3:29 pm
Can you provide the table structure please?
Odds are your Primary Key is neither the State nor the County?
April 3, 2008 at 3:18 pm
Sergiy (4/3/2008)
I don't have the structure of the table... but it's easy enough to encapsulate the field comparisons with isnulls.
If you don't know something you must assume the worst.
And if...
April 3, 2008 at 3:07 pm
Do you have the structures for the table(s), syntax of the queries, sample data, etc?
Hard to help with nothing to see.
April 3, 2008 at 2:53 pm
Ok... after pushing up to 100K rows I see your point.
Is there a way to use DATEDIFF and get an Index Seek? I'm a little sad that my favorite...
April 3, 2008 at 12:21 pm
Perhaps I screwed up my index here, but I get a table scan from each of these
create table datevalues (
dates datetime,
somevals integer )
create index bobsyouruncle on datevalues(dates DESC)
create statistics suesyouraunt...
April 3, 2008 at 10:33 am
Why not just use
WHERE
DATEDIFF(day,processdate,getdate()) = 1
??
April 3, 2008 at 10:07 am
Not 100% sure what you're asking here, but...
CREATE PROCEDURE IS_MGR
@STATUSFLG Bit
AS
IF (@STATUSFLG = 1)
BEGIN
(... Put Code Here...)
...
April 3, 2008 at 9:56 am
Sergiy (4/2/2008)
mtassin, you forgot to take care about NULLs.Also, your script gonna miss the case when user decides to add a space to a string.
I don't have the structure of...
April 3, 2008 at 8:12 am
You can use whatever you like for the substitution character, but if you use something other than ? you need to specify it with a second parameter to the sp_msforeachdb...
April 2, 2008 at 2:38 pm
Viewing 15 posts - 991 through 1,005 (of 1,033 total)