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 |
|
phonghtn
Starting Member
3 Posts |
Posted - 2004-05-19 : 22:19:58
|
| Hi all, I have a stored like thisCREATE PROCEDURE fts_insert_service_tasks( @status_no int output, @status_text nvarchar(255) output, @fts_employee char(100) , @fts_SCCode bigint, @fts_TaskDescription ntext) ASdeclare @str_err nvarchar(255) declare @err_no intset @err_no=0if ( isnumeric(@fts_SCCode) = 0 ) begin set @str_err ='The fts Sccode is not a number'set @status_text = @str_errset @err_no=@err_no+1returnend if ( @fts_SCCode = '' ) begin set @str_err ='The fts Sccode can not be null 'set @status_text = @str_errset @err_no=@err_no+1returnend if ( len(@fts_employee) > 100) begin set @str_err ='Maximum Employee length allowed is 100 characters'set @status_text = @str_errset @err_no=@err_no+1returnend if ( @fts_employee = '' ) begin set @str_err ='The employee fiedl can not be null'set @status_text = @str_errset @err_no=@err_no+1returnend if (@err_no=0)beginINSERT INTO fts_ServiceTasks (fts_employee , fts_Sccode, fts_taskdescription)VALUES(@fts_employee, @fts_SCCode, @fts_taskdescription)set @status_no=0set @status_text = 'Add Service Task Ok'endelsebeginset @status_no=@err_noset @status_text = @str_errendGOand I called it from the ASP<%function Add_Service_Task(fts_employee,fts_sccode, fts_TaskDescription)cm.ActiveConnection = m_conncm.CommandType = 4cm.CommandText = "fts_insert_service_tasks"cm.Parameters.refreshcm.Parameters(3).Value = fts_employeecm.Parameters(4).Value = fts_sccodecm.Parameters(5).Value = fts_TaskDescriptionon error resume nextcm.Execute if cm.Parameters(1)=0 thenexec_command=cm.Parameters(2).Value elsecall obj_utils.ErrMsg(cm.Parameters(2).Value,3000)Response.End end ifif err.number <> 0 thencall obj_utils.ErrMsg("System error at " & err.number & err.Description & ", please contact the administrator", 5000)Response.End end ifAdd_Service_Task=exec_commandend function%>I test with SQL 2k, Win2k3 OKBut with Win2k i got:Error Type:Microsoft OLE DB Provider for SQL Server (0x80040E30)Type name is invalid./fmits/classes/cls_servicecall.asp, line 256Please help me! |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2004-05-20 : 05:47:07
|
| Make sure you have the latest version of mdac. I'm guessing it's the nvarchar or bigint or ntext that causes the problem (probably bigint) - try changing the datattypes to check.You might want to test the sp too.isnumeric(@fts_SCCode) = 0 will let through things like '1e2' as it's a valid numeric.patindex('%[^0-9]%',fld) = 0 might be what you want.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
mohdowais
Sheikh of Yak Knowledge
1456 Posts |
Posted - 2004-05-20 : 08:13:12
|
| What's the code on Line 256 of cls_servicecall.asp? Has the objutils object been initialized?OS |
 |
|
|
phonghtn
Starting Member
3 Posts |
Posted - 2004-05-24 : 00:07:24
|
| I am confused with the sh!t stored procedure...hicI am guessing the problem is the datatype. So, I spent to much to test it with the my customer's server.I can't testing directly because they don't allow me to do with their server.Now, I am planing to design a web interface for sqlserver management ( the same way I did with ms access) :) |
 |
|
|
|
|
|
|
|