Viewing 15 posts - 13,411 through 13,425 (of 13,849 total)
Hey, you guys are ganging up on me ... it was late, I was tired & just trying to help ![]()
Anyway, my solution requires...
August 4, 2005 at 10:23 am
Would it be simpler to do this in two stages - using two resultsets (one for each 'type' of records)?
August 3, 2005 at 5:27 pm
select 'in table1 not table2' Type, t1.id from table1 t1 where t1.id not in (select t2.id from table2 t2)
union
select 'in table2 not table1' Type, t3.id from table2 t3 where t3.id...
August 3, 2005 at 5:19 pm
select a1. caseid, a1.datetransferred, a1.newowner
from AuditTrail a1 join
(select a2.caseid, max(a2.datetransferred) DateXfrd
from AuditTrail a2
group by a2.caseid) a2
on a1.caseid = a2.caseid and a1.datetransferred = a2. DateXfrd
Should do it (untested). Don't see why...
August 3, 2005 at 5:12 pm
Thank you everyone - sensible advice as usual - will pass on and discuss with my colleague.
Phil
August 3, 2005 at 5:02 pm
Rather than using this
Set @NewKey=(SELECT MAX(SRid) FROM FG_ID)
Use this
Set @NewKey= scope_identity()
Check out this excellent article for more info on this:
http://www.sqlservercentral.com/columnists/awarren/checkyoursqlserveridentity.asp
Regards
August 2, 2005 at 9:14 am
No problem helping - post away!
Maybe I missed what you are trying to do. The code I provided changes a character string from DDMMYYYY format into a format that can...
August 2, 2005 at 7:02 am
Sounds like your diagnosis is correct - you need to be comparing dates with dates. Can you change the design on the SQL Server side? Either change the datatype of...
August 2, 2005 at 5:35 am
I suspected that you would say something like that ... but then why does the CREATE TABLE solution work (just tested it)?
August 1, 2005 at 11:14 am
Why does it matter whether it exists, if the DELETE block is not going to be executed?
August 1, 2005 at 10:39 am
Not tried it, but I think that the error would not appear if the script were run when TableA existed and had the extra field.
August 1, 2005 at 8:53 am
SQL authentication requires more user admin than Windows authentication - but in a mid-sized company that might not matter so much, as it's not that much more when there are...
August 1, 2005 at 8:50 am
If you replace your SELECT * INTO and ALTER TABLE statements with a single CREATE TABLE statement containing the new column and constraint, your problem will go away. But why? ...
August 1, 2005 at 8:45 am
Just following this one up. So this query:
SELECT a.Municipality_No, a.Id_No
FROM TableA a
WHERE not exists (select x.Municipality_No from TableX x join TableA a on x.Municipality_No = a.Municipality_No)
Is faster than this one
SELECT Municipality_No,...
July 27, 2005 at 7:25 am
Is it about time that your users started using something like Access instead?
With that much data (as you've found), Excel just starts getting ungainly.
July 26, 2005 at 9:12 am
Viewing 15 posts - 13,411 through 13,425 (of 13,849 total)