Groups | Blog | Home
all groups > sql server (microsoft) > january 2007 >

sql server (microsoft) : Text always truncated in Update Query - SQL Express 2005


cptrinse NO[at]SPAM gmail.com
1/24/2007 8:02:07 AM
I have a very simple query:

-- =============================================
-- Author: #########
-- Create date: ########
-- Description:
-- =============================================
ALTER PROCEDURE [dbo].[###########]
-- Add the parameters for the stored procedure here
@quoteid int = 0,
@useraccepting nchar = " "
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

-- Insert statements for procedure here
UPDATE [Quote Main]
SET [Quote Accepted] = -1 , [OnlineAcceptanceID] =
@useraccepting ,[OnlineAcceptanceDate] = GetDate()
WHERE ([ID No] = @quoteid)
END

If I run this query with the following parameters:

USE [########]
GO

DECLARE @return_value int

EXEC @return_value = [dbo].[########]
@quoteid = 6,
@useraccepting = N'fsddrf5456ygh'

SELECT 'Return Value' = @return_value

GO

It updates the [Quote Accepted] and [OnlineAcceptanceDate] fields
correctly, but the [OnlineAcceptanceID] (which will in fact be a GUID
once in production) is always truncated to a single character, I.E in
the execution above the field would be "f" as opposed to
"fsddrf5456ygh".

I have tried changing the field type to all possible text types, same
result.

Any help with this would be greatly appreciated, i'm pulling my hair
out here.

Cheers

Pat.
cptrinse NO[at]SPAM gmail.com
1/24/2007 11:59:09 AM
Sorted,

@useraccepting nchar = " " should be

@useraccepting nchar(23) = " "



:/
AddThis Social Bookmark Button