Viewing 8 posts - 106 through 113 (of 113 total)
It will be helpful if you attach also sample data, expected result and the version of SQL Server that you are using.
August 27, 2013 at 2:31 pm
Try pushing the CASE expression into the CONTAINS function.
... IN (
select docno from ... Where contains(case when @type ... End, @var)
);
Remember that the type of those columns should be compatible...
August 25, 2013 at 10:28 am
Thanks, Erland!
I decided to give it a try after seeing your post in the private group about your move.
--
AMB
August 24, 2013 at 12:52 pm
It is difficult to guess just by reading the query. It will be helpful if you describe in words what is it that you are trying to accomplish.
Something that call...
August 21, 2013 at 12:51 pm
Try adding OPTION (RECOMPILE) to the second query or use sp_executesql with parameters to do the comparison.
SQL Server uses different approach to estimate cardinality when you use parameters or constants...
August 21, 2013 at 12:13 pm
Keep in mind that when you use EXCEPT you get distinct rows, so if you want to mimic it using NOT EXISTS (counting you have duplicate rows) then you will...
August 21, 2013 at 12:05 pm
quote:
Read this outstanding article.Dynamic Search Conditions in T-SQL
An SQL text by Erland Sommarskog, SQL Server MVP.
http://www.algonet.se/~sommar/dyn-search.html
AMB
September 26, 2003 at 1:41 pm
Single DB
select db_name() as [PROCEDURE_QUALIFIER],
user_name(o.uid) as [PROCEDURE_OWNER],
o.name as [PROCEDURE_NAME]
from sysobjects as o
whereobjectproperty(o.id, 'IsProcedure') = 1 and
objectproperty(o.id, 'IsMSShipped') = 0
order by o.name
All DB
execute sp_msforeachdb N'
select ''?'' as [PROCEDURE_QUALIFIER],
user_name(o.uid) as [PROCEDURE_OWNER],
o.name as...
April 11, 2002 at 6:33 am
Viewing 8 posts - 106 through 113 (of 113 total)