G
Guest
This should be easy but... I'm trying to get a simple bool written into a bit
column type using a stored procedure (VS2003 with SQL Server 2000). My
understanding where that they were equivalents.
------------
CREATE PROCEDURE sp_UpdateFPRFByVP
@fGuid uniqueidentifier,
@vpResponse bit,
@vpComments nvarchar(3000)
AS
Update tblFPRF
SET VPResponse = @vpResponse, VPComments = @vpComments, VPResponseDate =
getdate()
Where KGuid = @fGuid
GO
------------
In query analyzer this works perfectly well
Exec sp_UpdateFPRFByVP @fGUID='203765A0-E3F3-4161-A117-8E6013004A50',
@vpResponse="1",@vpComments="Abe's test"
In query analyzer this fails (true wo quotes is interpreted as a column)
Exec sp_UpdateFPRFByVP @fGUID='203765A0-E3F3-4161-A117-8E6013004A50',
@vpResponse="true",@vpComments="Abe's test"
I'm using a C# routine to do the update:
public void updateVPResponse()
{
Guid _guid = new Guid(_fGuid); //_fGuid is a string
SqlConnection conn = new SqlConnection(connectString);
SqlCommand cmd = new SqlCommand("sp_UpdateFPRFByVP",conn);
cmd.Parameters.Add("@fGuid", SqlDbType.UniqueIdentifier);
cmd.Parameters.Add("@vpResponse", SqlDbType.Bit);
cmd.Parameters.Add("@vpComments", SqlDbType.NVarChar, 3000);
cmd.Parameters["@fGuid"].Value = _guid;
cmd.Parameters["@vpResponse"].Value = _authorization;
cmd.Parameters["@vpComments"].Value = _vpComments;
conn.Open();
cmd.ExecuteNonQuery();
conn.Close();
}
--------------------------------------------------------------
What value can _authorization be to be valid. I tried "1"(string), true
(bool), 1 (int) and have gotten type errors for each.
Thanks
column type using a stored procedure (VS2003 with SQL Server 2000). My
understanding where that they were equivalents.
------------
CREATE PROCEDURE sp_UpdateFPRFByVP
@fGuid uniqueidentifier,
@vpResponse bit,
@vpComments nvarchar(3000)
AS
Update tblFPRF
SET VPResponse = @vpResponse, VPComments = @vpComments, VPResponseDate =
getdate()
Where KGuid = @fGuid
GO
------------
In query analyzer this works perfectly well
Exec sp_UpdateFPRFByVP @fGUID='203765A0-E3F3-4161-A117-8E6013004A50',
@vpResponse="1",@vpComments="Abe's test"
In query analyzer this fails (true wo quotes is interpreted as a column)
Exec sp_UpdateFPRFByVP @fGUID='203765A0-E3F3-4161-A117-8E6013004A50',
@vpResponse="true",@vpComments="Abe's test"
I'm using a C# routine to do the update:
public void updateVPResponse()
{
Guid _guid = new Guid(_fGuid); //_fGuid is a string
SqlConnection conn = new SqlConnection(connectString);
SqlCommand cmd = new SqlCommand("sp_UpdateFPRFByVP",conn);
cmd.Parameters.Add("@fGuid", SqlDbType.UniqueIdentifier);
cmd.Parameters.Add("@vpResponse", SqlDbType.Bit);
cmd.Parameters.Add("@vpComments", SqlDbType.NVarChar, 3000);
cmd.Parameters["@fGuid"].Value = _guid;
cmd.Parameters["@vpResponse"].Value = _authorization;
cmd.Parameters["@vpComments"].Value = _vpComments;
conn.Open();
cmd.ExecuteNonQuery();
conn.Close();
}
--------------------------------------------------------------
What value can _authorization be to be valid. I tried "1"(string), true
(bool), 1 (int) and have gotten type errors for each.
Thanks