One of the
limitations of database views is that you cannot pass any parameters to the
view. So you cannot dynamically control the rows in the view. You could do some
filtering in the SELECT statement that queries the view. However you could also
employ an inline table valued function. This is a function that returns a row
set. It can accept parameters that affect the results returned. While it can
accept parameters, the function itself does not have local variables.
Jumping to
another topic, database synonyms are objects that reference other objects. You
generate a synonym with SQL like this:
CREATE SYNONYM dbo.my_syn FOR
my_table;
The object that you reference does not need to
exist yet when you create the synonym. It will get resolved when the synonym is
accessed. The object that you reference can be a table, view, function or
procedure. However a synonym cannot be created to refer to another synonym.