Viewing 15 posts - 151 through 165 (of 582 total)
if exists(
select fk from tbl group by fk having count(distinct id) != (select count(distinct id) from tbl)
)
select @retval = 0
Tim Wilkinson
"If it doesn't work in practice, you're using the wrong theory"
- Immanuel Kant
June 30, 2006 at 4:37 am
Maybe the production environment is using a suboptimal stored plan. You can get rid of all plans with DBCC FREEPROCCACHE, but that could cause temporary performance problems on the prod...
Tim Wilkinson
"If it doesn't work in practice, you're using the wrong theory"
- Immanuel Kant
June 29, 2006 at 2:22 pm
Nice one, Pam!
Tim Wilkinson
"If it doesn't work in practice, you're using the wrong theory"
- Immanuel Kant
June 29, 2006 at 10:33 am
I don't think this happens in SQL9, as individual statements have their own plans. I stand to be corrected of course.
Tim Wilkinson
"If it doesn't work in practice, you're using the wrong theory"
- Immanuel Kant
June 29, 2006 at 10:10 am
Yes, it is unclear. The column needs to be a column in the outer table (i.e. the one to the right of the left join) which cannot be null. You...
Tim Wilkinson
"If it doesn't work in practice, you're using the wrong theory"
- Immanuel Kant
June 29, 2006 at 10:05 am
Better post the execution plans then.
Tim Wilkinson
"If it doesn't work in practice, you're using the wrong theory"
- Immanuel Kant
June 29, 2006 at 9:58 am
Is your variable the right datatype?
Tim Wilkinson
"If it doesn't work in practice, you're using the wrong theory"
- Immanuel Kant
June 29, 2006 at 9:50 am
It may be that SQL server has a suboptimal plan based on an atypical value for this param. Try DBCC FREEPROCCACHE and then run the procedure twice with a typical...
Tim Wilkinson
"If it doesn't work in practice, you're using the wrong theory"
- Immanuel Kant
June 29, 2006 at 9:36 am
Here's previous post on the same topic:
http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=289159
you should use a left join and check for NULL in a join column of the outer table. The alternaitive is concatenation but...
Tim Wilkinson
"If it doesn't work in practice, you're using the wrong theory"
- Immanuel Kant
June 29, 2006 at 9:32 am
To expand on the above, you need to create parameter objects and add them to the parameters collection of the command object, which should be of 'stored procedure' type.
Tim Wilkinson
"If it doesn't work in practice, you're using the wrong theory"
- Immanuel Kant
June 29, 2006 at 9:00 am
Yes, wasn't sure and didn't look it up. Largely irrelevant to the issue though.
Tim Wilkinson
"If it doesn't work in practice, you're using the wrong theory"
- Immanuel Kant
June 29, 2006 at 8:38 am
I wouldn't combine data cleansing with ordinary DML. Check the values using a SELECT with ISDATE() first, then fix any corrupt values, then move the data.
If you have mixed date formats,...
Tim Wilkinson
"If it doesn't work in practice, you're using the wrong theory"
- Immanuel Kant
June 29, 2006 at 8:13 am
Yes, I was wondering about that. At the point in time at which you insert a new record, there oughtn't to be any records referencing it - what did they reference...
Tim Wilkinson
"If it doesn't work in practice, you're using the wrong theory"
- Immanuel Kant
June 29, 2006 at 7:52 am
Ask this joker what he means by product-oriented. It sounds as though he means 'trying to use rows as columns'.
You need to give us a little more background. Your current...
Tim Wilkinson
"If it doesn't work in practice, you're using the wrong theory"
- Immanuel Kant
June 29, 2006 at 7:43 am
Since your issue is maintenance/code reuse, a view would be the best solution, rather than a derived table (inline view).
It's not particularly useful here since the calculations are simple...
Tim Wilkinson
"If it doesn't work in practice, you're using the wrong theory"
- Immanuel Kant
June 29, 2006 at 7:28 am
Viewing 15 posts - 151 through 165 (of 582 total)