|
I think what I am needing to do is pretty easy I just cant figure out the right syntax and where to place it. I need to pass a string to my stored procedure. However it doesn't like characters like . / or : . But if I put them into square brackets it will work. I am going from a form on an ASP page to SQL 2000 through a Stored procedure. My Data Types are all VarChar. I am planning on using the TRIM function to add the [] and then to remove them in SQL unless there is an easier way. Any help would be appreciated. Please let me know if you need more info.
Exapmple:
strTime = Request.Form("uTime")
strTime = "[8:28:00]" if I hard code it with [ ] I don't get errors.
strSQL = "exec sp_insertStatus " + strType + ", " + StrBuildno + "," + strVer + ", " + strProc + "," + strStatus + "," + strEta + "," + strTime + "," + strDate + ""
My stored procedure is
CREATE procedure sp_insertStatus @vType varchar(20), @VBuild varChar(20), @vVer varChar(20), @vProc varChar(5), @vStatus varchar (20), @vEta varchar(20), @vUtime varchar(20), @vUDate varchar(20)
as declare @vBuildID varchar(9) if EXISTS
( Select * from tblBuild where type = @vtype and BuildNo = @vBuild and ver = @vVer and processor = @vProc )
Begin set @vBuildID = (Select pk_buildID from tblBuild where type = @vtype and BuildNo = @vBuild and ver = @vVer and processor = @vProc)
insert tblLabinfo values (@vBuildID, @vStatus, @vEta, @vUdate, @vUTime) end
else begin insert into tblBuild values (@vType,@vBuild,@vVer,@vProc)
set @vBuildID = (Select pk_buildID from tblBuild where type = @vtype and BuildNo = @vBuild and ver = @vVer and processor = @vProc)
insert tblLabinfo values (@vBuildID, @vStatus, @vEta, @vUdate, @vUTime)
end GO
------------- 'Computers don't make errors...what they do, they do on purpose.' - Dale Gribble
|