Hello,
You cant use variable inside a view.
But try creating the view using dynamic sql.
Thanks
Hari
MCDBA
[quoted text, click to view] "??" <anonymous@discussions.microsoft.com> wrote in message
news:28d301c4a9fc$f9210500$a301280a@phx.gbl...
> Is it possible to use variables in a view...
> Ex: Create view zz as
> Declare @user
> Set @user = 1
> Select * from sometable where @user = 1
>
> i think you get my idea...
> Is it possible?