Answered by:
ISO: Syntax for using the filtering grid

Question
-
Hello
I am not a developer, and have been using SSMS for about a week (under tutelage from a local developer).
I am Editing the data in a table, and I have the nice grid at the top, to filter etc.
But I can't find a little cheat-sheet for the syntax of entering search criteria.
For example: what do I enter to specify 'begins with' or 'ends with' or 'contains'
(I looked in help, and googled, but I am getting too many hits that aren't the right thing)
Thank you!
Saturday, April 10, 2010 12:26 AM
Answers
-
to start with nam type in the field's filter
LIKE N'nam%'
and for contains 'fly' almost the same, but
LIKE N'%fly%'
Premature optimization is the root of all evil in programming. (c) by Donald Knuth
Naomi Nosonovsky, Sr. Programmer-Analyst
My blog- Marked as answer by mtpaper Tuesday, April 13, 2010 11:35 AM
Monday, April 12, 2010 8:18 PM
All replies
-
Depending on what version of SSMS you are using, 2005/2008, there are slight differences, but you can right click within the datagrid and choose Pane>Criteria. This brings up a window much like Access' query builder and you can add sort, filter and order information.
I would highly reccommend learning t-sql as this can be easier, more efficient, and quicker than using the graphical user interface. The below links are some resources that you can use to familiarize yourself with t-sql:
http://msdn.microsoft.com/en-us/library/ms365303.aspx
http://msdn.microsoft.com/en-us/library/ms177563.aspx
http://msdn.microsoft.com/en-us/library/ms189499.aspx
http://msdn.microsoft.com/en-us/library/ms187731.aspx
Hope this helps
David Dye- Proposed as answer by Naomi N Sunday, April 11, 2010 4:57 AM
Saturday, April 10, 2010 1:10 PM -
My apologies for not being explicit. I am using SQL Server 2008.
I have every intention of learning t-sql, but, for the moment, I need to use the UI. There is a lot to learn, and I cannot learn it all at once.
I already have the Pane displayed. The problem is that I do not know the syntax for entering search criteria into the pane.
For example, I need to learn the syntax for:
begins with 'nam'
contains 'fly'
Monday, April 12, 2010 8:01 PM -
to start with nam type in the field's filter
LIKE N'nam%'
and for contains 'fly' almost the same, but
LIKE N'%fly%'
Premature optimization is the root of all evil in programming. (c) by Donald Knuth
Naomi Nosonovsky, Sr. Programmer-Analyst
My blog- Marked as answer by mtpaper Tuesday, April 13, 2010 11:35 AM
Monday, April 12, 2010 8:18 PM