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 |
|
khalik
Constraint Violating Yak Guru
443 Posts |
Posted - 2002-04-26 : 03:37:05
|
| i have sql2k personalwhen i execute sp_help sp_reconnecti get this errorServer: Msg 536, Level 16, State 3, Procedure sp_helptextk, Line 143[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid length parameter passed to the substring function.The statement has been terminated.i copyed the script and created procdure of mine and debug it i found error in this line INSERT #CommentText VALUES ( @LineId, isnull(@Line, N'') + isnull(SUBSTRING(@SyscomText, @BasePos, @AddOnLen), N''))@AddOnLen value is -1how can i handle it======================================Ask to your self before u ask someone |
|
|
rihardh
Constraint Violating Yak Guru
307 Posts |
Posted - 2002-04-26 : 07:24:18
|
| Sp_help works fine for me. Where did you get sp_reconnect? |
 |
|
|
khalik
Constraint Violating Yak Guru
443 Posts |
Posted - 2002-04-30 : 01:32:16
|
| thanksit works fine for all the procedure but only for a procedure it gives this error.....======================================Ask to your self before u ask someone |
 |
|
|
Nazim
A custom title
1408 Posts |
Posted - 2002-04-30 : 04:44:45
|
| khalik, nothing is wrong with sp_helptext . its ur procedure which is erroneous.you cant have a negative value as the length in a substringselect substring('SqlTeam',-1,1)will return Nullselect substring('SqlTeam',1,-1)will returnServer: Msg 536, Level 16, State 3, Line 1Invalid length parameter passed to the substring function.-------------------------------------------------------------- |
 |
|
|
khalik
Constraint Violating Yak Guru
443 Posts |
Posted - 2002-04-30 : 05:41:07
|
quote: you cant have a negative value as the length in a substring
thanks nazim when i execute sp_helptext reconn_eventi get this Server: Msg 536, Level 16, State 3, Procedure sp_helptext, Line 144Invalid length parameter passed to the substring function.The statement has been terminated. for other procedures it works fine only in this procedure..when i tried to debug... by creating another procedure..i found thatINSERT #CommentText VALUES ( @LineId, isnull(@Line, N'') + isnull(SUBSTRING(@SyscomText, @BasePos, @AddOnLen), N'')) @AddOnLen value is -1 ======================================Ask to your self before u ask someone |
 |
|
|
Nazim
A custom title
1408 Posts |
Posted - 2002-04-30 : 08:32:14
|
| khalik, you havent understood the point. the sp which gives you that error has a invalid paramerter in substrin function. (i.e -ve value in lenth parameter). if you put a +ve value there. the error will goaway. and i dont understand what does a -ve signify there. wht do u want to do??-------------------------------------------------------------- |
 |
|
|
khalik
Constraint Violating Yak Guru
443 Posts |
Posted - 2002-05-03 : 04:46:32
|
| i tried out in diff server and i was able to get the sp_helptext for same procedure. its problem with only on my server and and only with one procedure... and i check it my code there is no substrin function. the procedure work well but only when execute sp_helptext it gives problem.======================================Ask to your self before u ask someone |
 |
|
|
|
|
|
|
|