Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 asp, stored procedures, dynamic database, exec

Author  Topic 

starpuff
Starting Member

1 Post

Posted - 2001-06-01 : 08:39:12
Hi, i'm trying to create an application that will get a database name from a user. The name will be passed to a stored procedure and i will need to do an update on one of the tables. here is what i have so far but it isn't working. i'm using visual interdeve for asp, windows 2k professional, iis 5, ms sql server 7.

calling the stored procedure from an asp:

SQLStmt3 = " exec campuscontrol..procProcessEmpDescriptionUpdate " & _
"'" & rqTitleID & "', " & _
"'" & process & "', " & _
"'" & session("userlogonid") & "'"

stored procedure:

CREATE PROCEDURE procProcessEmpDescriptionUpdate
@ID char(30),
@user char(50),
@processedby char(255)
AS
begin
DECLARE @text char(100)

SELECT @text = " UPDATE " + @id + "..EmpDescription " +
" SET " +
" processby = " + @processedby +
" WHERE userlogonid = " + @user

exec (@text)
end


i'm getting constant problems with this and i can't figure out were to add the necessary quotes.
   

- Advertisement -