matt<BR>Something like <BR>select somestuff from a table where id = nn<BR>then depending on the parameter passed if it requires the user to be part of the select<BR>and user = nn<BR>if the user is not to be part of the select statement i need to bypass it<BR><BR>
Why use a stored procedure at all if it's just a select statement? I think it's easier to create the select in ASP in a case like this. But if you do use an SP, you could use if/else or case statements like someone else suggested. Could get kind of messy depending on how you want it to look.
You can specify in if conditions and case <BR><BR>declate @SelectSql1 varchar(255)<BR><BR>@SelectSql1 = ""<BR><BR>if @Parameter1 = 1<BR>Begin<BR>@SelectSql1 = "Select * trom ABCD"<BR>End<BR><BR>if @Parameter1 = 2<BR>Begin<BR>@SelectSql1 = "Select * trom DEFG"<BR>End<BR><BR>exec SelectSql1<BR><BR>soemthing like this...i am not sure if this is the correct syntax just typing it here but i will be something like this