Viewing 15 posts - 2,866 through 2,880 (of 6,036 total)
khushbu.kumar (9/10/2008)
But the here posted code was just a snippet
i really dont know how many rows can be present(i'm selecting them on the basis of id...
September 10, 2008 at 5:30 pm
Can you add dbo.tblCards.ID to SELECT to see if those records are actually duplicates?
If dbo.tblCards.ID will not repeat then they are not.
Joins don't add duplications.
Never.
It's either bad data or...
September 9, 2008 at 1:03 am
Why did you decide those 410 records are duplicates?
In your DISTINCT query you group by PrintDate, CardType.
So, if they have printed 10 cards of the same type on the same...
September 8, 2008 at 11:23 pm
If to follow the logic of your query this is what you are trying to get:
SELECT a.strUserName, Count(A.ID) AS CardsPrinted
FROM dbo.tblUsers a
WHERE EXISTS(select 1
from dbo.tblEvents...
September 8, 2008 at 10:39 pm
Try this:
USE MASTER
select * from syscolumns
where name like '%exec%'
See? Your filter would consider some system calls illegal.
Don't you have column "IsDeleted" anywhere in your database?
Many developers like those "flag" columns.
What...
September 7, 2008 at 9:48 pm
icocks (9/5/2008)
September 7, 2008 at 12:43 am
I always use IF EXISTS(select 1 from inserted) or deleted.
It allows not to run "insert" part of INSERT/UPDATE/DELETE trigger only when there are actually inserted rows.
September 5, 2008 at 5:41 pm
Both options are identical on cost.
Both perform same SELECT and both perform INSERT only if SELECT returns no records.
The only important difference s that 2nd option escalates shared locks applied...
September 5, 2008 at 2:13 am
Ric Sierra (9/4/2008)
Yes.
I'd like to see how.
I guess I'm not alone here.
Yes.
Same question - how?
I agree with your POV but both solutions are efective to insert a new record without...
September 4, 2008 at 6:12 pm
Ric Sierra (9/4/2008)
I'm not completly agree with the answer, because depends of the context:If you are looking for the best execution plan the answer is #1
Can you prove it?
Open QA,...
September 4, 2008 at 5:03 pm
Thanks guys for the feedback.
davidr (9/4/2008)
September 4, 2008 at 7:41 am
Tomm,
THe beauty of the solution posted by Michael is it does not depend on DATEFIRST settings.
Moreover, it allows to set required "datefirst" as a parameter.
So, what's the point to...
September 3, 2008 at 8:13 pm
You can add constraint at any time.
Just be aware - you live application will throw error when trying insert duplicates.
September 3, 2008 at 12:00 am
There is the query to identify rows to be deleted.
Once you see the candidates for deletion are correct - run commented DELETE.
SELECT T.*
--DELETE T
FROM tblprojectmembers T
INNER JOIN (
select count(*), MIN(ProjectMemberId)...
September 2, 2008 at 11:07 pm
Sagar (9/2/2008)
projectmemberuserid is equivalent to userid in another tbluser which has all the users. i know there is some...
September 2, 2008 at 9:39 pm
Viewing 15 posts - 2,866 through 2,880 (of 6,036 total)