Hi all,
I have a bit of a problem that I'm hoping you guys can assist with it. I have a server running SQL 2012 at a client and am running a restored set of their data (last restored around June). Neither has any SQL Cumulative updates installed.
I have a number of Stored Procedures that expects quite a few parameters, but only some of these are mandatory. I have been running this fine until recently (although exactly how recently I don't know, but it did work before). But now every single parameter is required. What could have changed? Where can I start looking.
So just to sum up: Before I was able to pass blank parameters to the SP, but now I can't. i can assign default values, but I want to know what actually happened.
Edit: Here is the SProc and the code calling it:
USE [MyDB]
GO
/****** Object: StoredProcedure [dbo].[sp_CCNEW] Script Date: 10/11/2014 7:56:56 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
ALTER PROCEDURE [dbo].[sp_CCNEW]
@ipkCID int,
@sLastName VARCHAR (40),
@sFirstName VARCHAR (40),
@sInitials VARCHAR (10),
@sSalutation VARCHAR (20),
@sHobbies VARCHAR (100),
@sNotes text
AS
DECLARE @ifkCID INT
SET @ifkCID = (SELECT ifkCsID FROM tblCC WHERE ipkCCID = @ipkCID)
Update tblCC SET
sLastName = @sLastName,
sFirstName = @sFirstName,
sInitials = @sInitials ,
sSalutation = @sSalutation ,
sHobbies = @sHobbies ,
sNotes = @sNotes
WHERE ipkCCID = @ipkCID
The code calling it:
conDB.Execute ("EXEC sp_CCNew " & _
"@ipkCID=" & txtContactID & ", " & _
"@sLastName='" & SQLReplace(txtLastName.Text) & "', " & _
"@sFirstName='" & SQLReplace(txtFirstName.Text) & "', " & _
"@sInitials='" & SQLReplace(txtInitials.Text) & "', " & _
"@sSalutation='" & SQLReplace(txtSalutation.Text) & "', " & _
"@sHobbies='" & SQLReplace(txtHobbies.Text) & "', " & _
"@sNotes='" & SQLReplace(txtContactNotes.Text)
SQLReplace is a function that replaces blanks with ''.
I originally thought it might be the set quote identifiers, but I did the same at the client (changed it to OFF) with no change on their side...
PS:I have just rechecked the client's side and mine and it works. Could the Quote Identifier be responsible?