How to fast sql query
hi friend
can anybody tell me how to fast my sql query.I m insert some field from another table that has around 5 lak data,I just insert 100 row according to date.I have use clustred index on date but speed is quite slow due to where clause in which I have use a description field and their are lots of and i.e
" (detail like '%car%' and '%truck%' ) OR (detail like '%shirt%' and '%pant%' ) "
Is their any solution?

Jan MontanoRank #1,295 · 1.3K reputationPosted Jul 19, 2007, 4:38 PM EDT
Please post the structure of your whole query. Is the detail column indexed? If not, making it indexed will make it faster. Could you also post the CREATE TABLE and CREATE INDEX statements for the table? Thanks.
Regards,
Jan
Rolando Puno2 reputationPosted Jul 19, 2007, 6:18 PM EDT
kavita113 reputationPosted Jul 19, 2007, 10:31 PM EDT
Jan MontanoRank #1,295 · 1.3K reputationPosted Jul 24, 2007, 1:01 AM EDT
Why did you make a clustered-index for your date? Is it somehow a primary key in your table? Declaring a non-clustered index for details will definitely help because you're where cause includes the detail. You could also consider using Dynamic SQL to use a stored procedure though there are pros and cons that comes with it -> Dynamic SQL
Cheers,
Jan