lifesupport
Programmer
I'm writing a web app (and learning at the same time) that will have daily usage by approx 100 or less users. This app will have a large variety of select statements all based on the users' selections. I want to make sure that the user's selections will not get mixed up with each other as I've read in some posts elsewhere. My solution was to write dynamic queries using the user's session ID as part of the table name. This worked but the table will not view in a grid (code below). I'm wondering if I need to be concerned about this at all. Will Session State keep everyone's selections organized when the processes go back to the server even if I use hard coded tables? What I'm concerned is that a user may get a mixture of another user's results.
What's the best route for this concern?
Code will execute but will not display. this is not good because I can't call it with Select * from @tablename
@tablename varchar(50)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
Declare @SQL VarChar(1000)
select @SQL = 'select statecode, statename, statenum, nstatenum, selection '
select @SQL = @SQL + 'into ' + @tablename
select @SQL = @SQL + ' from state'
Exec ( @SQL)
What's the best route for this concern?
Code will execute but will not display. this is not good because I can't call it with Select * from @tablename
@tablename varchar(50)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
Declare @SQL VarChar(1000)
select @SQL = 'select statecode, statename, statenum, nstatenum, selection '
select @SQL = @SQL + 'into ' + @tablename
select @SQL = @SQL + ' from state'
Exec ( @SQL)