Try this:
SELECT *
FROM MY_TABLE
WHERE @parameter IS NULL OR NAME = @parameter;
More Related Contents:
- SQL JOIN – WHERE clause vs. ON clause
- SQL – HAVING vs. WHERE
- Conditional WHERE clause in SQL Server
- Left Join With Where Clause
- Passing multiple values for a single parameter in Reporting Services
- Parameterize an SQL IN clause
- What is the difference between HAVING and WHERE in SQL?
- including parameters in OPENQUERY
- Filter Table Before Applying Left Join
- Does the order of where clauses matter in SQL?
- How to set table name in dynamic SQL query?
- Pass table as parameter into sql server UDF
- How to use parameters “@” in an SQL command in VB
- SQL server ignore case in a where expression
- In SQL / MySQL, what is the difference between “ON” and “WHERE” in a join statement?
- Is a JOIN faster than a WHERE?
- What’s the difference between “where” clause and “on” clause when table left join?
- Can we pass parameters to a view in SQL?
- How to write a SQL DELETE statement with a SELECT statement in the WHERE clause?
- “Order By” using a parameter for the column name
- Query for getting value from another record in same table and filter by difference greater than a gap threshold
- Check if a parameter is null or empty in a stored procedure
- Oracle date “Between” Query
- Parameterise table name in .NET/SQL?
- Call stored procedure with table-valued parameter from java
- Convert from string to datatime in sql [duplicate]
- Simulating group_concat MySQL function in Microsoft SQL Server 2005?
- GROUP BY and aggregate sequential numeric values
- How to pass variable as a parameter in Execute SQL Task SSIS?
- Query a Table’s Foreign Key relationships