I like to use SQL Server 2005 templates to run frequently used queries. You can include parameters in your templates using this syntax:
With template
select top 10 * from syscolumns
where
If you select (menu) Query > Specify Values for template parameters, the default value for replacement is "xtype <= 60", which is correct, and upon substitution, the resulting query text is
select top 10 * from syscolumns
where xtype <= 60
which is exactly what one would expect. In other words, it does not appear to be the case that the "<" symbol needs to be escaped. However, ">" is more problematic:
select top 10 * from syscolumns
where = 60>
This will fail when opening the "specify values" dialog. However, in this instance, it is fine to specify
select top 10 * from syscolumns
where
and enter
xtype >= 60
in the "value" field for replacement. This produces
select top 10 * from syscolumns
where xtype >= 60
which is again as one would expect. So it would seem that the default value for replacement may not contain a ">".