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.
| Author |
Topic |
|
vmurali
Yak Posting Veteran
88 Posts |
Posted - 2007-02-21 : 08:55:42
|
| Hi,In my stored procedure I have a parameter @empcode varchar(20)can anyone tell me how to make use of this parametermy update statement is likeupdate leave_table set leave_days_=20 where Emp_code='@empcode'Is the above statement correct. If not please correct it |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-02-21 : 08:57:35
|
| CREATE PROCEDURE dbo.uspUpdateLeaveDays(@Emp_Code VARCHAR(20))ASSET NOCOUNT ONUPDATE Leave_TableSET Leave_Days = 20WHERE Emp_Code = @EmpCodePeter LarssonHelsingborg, Sweden |
 |
|
|
vmurali
Yak Posting Veteran
88 Posts |
Posted - 2007-02-21 : 09:03:31
|
Is there no need to give @EmpCode in quotes as it is varchar.will this work if empcode is like INC345quote: Originally posted by Peso CREATE PROCEDURE dbo.uspUpdateLeaveDays(@Emp_Code VARCHAR(20))ASSET NOCOUNT ONUPDATE Leave_TableSET Leave_Days = 20WHERE Emp_Code = @EmpCodePeter LarssonHelsingborg, Sweden
|
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-02-21 : 09:12:18
|
| Try first, ask again later...Peter LarssonHelsingborg, Sweden |
 |
|
|
|
|
|