>>>When I call this stored procedure
>>>
>>>
>>>ALTER PROCEDURE [dbo].[GetNextMaster]
>>> @MasterID int
>>>
>>>AS
>>>BEGIN
>>> SET NOCOUNT ON;
>>>
>>> Select XPID, Category, DiffLet,alc,Keyword, Keyword2, CorrectResp, Script, stem,
>>> Cast(RespA as nVarchar(200)) as RespA, Cast(RespB as nVarchar(200)) as RespB, Cast(RespC as nVarchar(200)) as RespC,
>>> CAST(RespD as nVarchar(200)) as RespD, ScriptTime, EnterNotes, IncSave, EnteredBy, EnteredDate,
>>> Completd, DelFlag, DelReason from ExpMaster where XPID = @MasterID
>>>
>>>END
>>>
>>>
>>>from the form, I'm getting "Incorrect syntax near '.'" If I execute it from SMS it runs just fine.
>>>
>>>The command is
>>>
>>>ms1 = SqlExec(Thisform.r_conn, msql1 + m.params1, "EditRec")
>>>
>>>where msql1 = "Execute TestingExpECL..GetNextMaster ")
>>>and m.params1 = "0"
>>>
>>>I'm not seeing a '.' anywhere in there - what am I not seeing?
>>>
>>>thanks
>>>
>>>D
>>
>>Is TestingExpECL the name of the database? Are you running this SP from another DB? If not, how about
>>
>>execute dbo.GetNextMaster 0 (BTW, why did you name this SP GetNextMaster)?\
>>
>>Also, you seem to be missing a space after procedure call and parameter.
>
>Yes, TestingExpECL is the name of the database and that's just how our SQL seems to like to have it's stored procs called. And it's named GetNextMaster because that's what it does, it gets the next Master Record needed, based on the XpID passed in. I'm passing in 0 because I just need the structure in the particular case.
>
>And yes, there's a space between the proc call and the parameter.
I am not sure about 'Next' in your procedure name? What do you mean by "next"? You're passing parameter and return the row, so why "Next"?
Moving on, you didn't answer my question - are you calling this SP from another database - not TextEXPECL ? If yes, then try calling it
execute TestingExpECL.dbo.GetNextMaster
If you're calling from the same database (from TestingExpECL), then omit DB name and just use
execute dbo.GetNextMaster 0
If it's not broken, fix it until it is.
My Blog