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 |
|
parry02
Starting Member
18 Posts |
Posted - 2006-04-20 : 08:55:54
|
| I am trying to trigger an e-mail from a another application and i have this code which is executed - but on execution of the code I am getting the following error ....[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid length parameter passed to the substring function.This is the code :SET NOCOUNT ONDECLARE @pos INTSELECT @pos = CHARINDEX(',','{payment_emailaddress}')SET NOCOUNT OFFIF @pos > 1BEGIN SELECT SUBSTRING('{payment_emailaddress}', 1, CHARINDEX(',','{payment_emailaddress}')-1) AS emailENDELSEBEGIN SELECT '{payment_emailaddress}' AS emailENDMany thanks if anyone can help me out ..... |
|
|
druer
Constraint Violating Yak Guru
314 Posts |
Posted - 2006-04-20 : 09:22:33
|
| Where is the {payment_emailaddress} coming from? As it looks it is just a hard coded value in quotes. |
 |
|
|
parry02
Starting Member
18 Posts |
Posted - 2006-04-20 : 09:29:45
|
| its coming from an ACCESS system |
 |
|
|
druer
Constraint Violating Yak Guru
314 Posts |
Posted - 2006-04-20 : 09:32:40
|
| This looks like a pass-thur query since you are setting NOCOUNT, so how will SQL Server know what the value is? |
 |
|
|
|
|
|