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 2005 Forums
 Transact-SQL (2005)
 Procedure not working

Author  Topic 

tomex1
Starting Member

47 Posts

Posted - 2008-07-28 : 06:29:08
Hello all,
Is there anything I am getting wrong here. Basically, I am executing the stored procedure below but it's not inserting any contact id from the contact table depsite the fact that I am sure there is a uniqueid for Segun Palmer in the contact table.


Create procedure test2
@createtime datetime,
@createuser varchar(16),
@duration numeric(10,0),
@subject varchar(50),
@uniqueid varchar(16)

AS
declare @contactid varchar(16)
set @contactid = (select UNIQUEID from wce_contact where contact = '@createuser')

insert into wce_activity (UNIQUEID, CREATEUSER, DURATION, SUBJECT)

VALUES (@uniqueid, @contactid, @duration, @subject)


This is the syntax I used to execute the procedure

exec test2 '28 JUL 08','Segun Palmer','80','Test..........','))fjjjkkkkdkkkkk'

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-07-28 : 06:31:34
You dont need single quote around @createuser

Refer my reply

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=107404

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -