January 14, 2017 at 9:01 am
I have a stored procedure like this :
USE [MyDatabase]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[sp_logvrnitev]
@p1 int,
@p2 varchar
AS
BEGIN
update KOLESARSKI_ZURNAL set DATUM_VRNITVE=CURRENT_TIMESTAMP,KOLO_SPREJEL=@p2 where KOLO=@p1
END
On execution the @p2 parameter returns only the first letter of a string.
Example : Instead of 'Senchi' it returns just 'S'
January 14, 2017 at 9:42 am
Senchi - Saturday, January 14, 2017 9:01 AMI have a stored procedure like this :
USE [MyDatabase]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[sp_logvrnitev]
@p1 int,
@p2 varchar
AS
BEGIN
update KOLESARSKI_ZURNAL set DATUM_VRNITVE=CURRENT_TIMESTAMP,KOLO_SPREJEL=@p2 where KOLO=@p1
ENDOn execution the @p2 parameter returns only the first letter of a string.
Example : Instead of 'Senchi' it returns just 'S'
your procedure declaration says @p2 varchar, and not @p2 varchar(128) for example.
the default size is(1) unless you say otherwise.
in a cast or convert command, the default size is(30), and that may be where you are making an assumption that woull be incorrect.
ALTER PROCEDURE [dbo].[sp_logvrnitev]
@p1 int,
@p2 varchar(256)
AS
BEGIN
update KOLESARSKI_ZURNAL set DATUM_VRNITVE=CURRENT_TIMESTAMP,KOLO_SPREJEL=@p2 where KOLO=@p1
END
Lowell
January 14, 2017 at 11:20 am
Lowell - Saturday, January 14, 2017 9:42 AMSenchi - Saturday, January 14, 2017 9:01 AMI have a stored procedure like this :
USE [MyDatabase]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[sp_logvrnitev]
@p1 int,
@p2 varchar
AS
BEGIN
update KOLESARSKI_ZURNAL set DATUM_VRNITVE=CURRENT_TIMESTAMP,KOLO_SPREJEL=@p2 where KOLO=@p1
ENDOn execution the @p2 parameter returns only the first letter of a string.
Example : Instead of 'Senchi' it returns just 'S'your procedure declaration says @p2 varchar, and not @p2 varchar(128) for example.
the default size is(1) unless you say otherwise.
in a cast or convert command, the default size is(30), and that may be where you are making an assumption that woull be incorrect.
ALTER PROCEDURE [dbo].[sp_logvrnitev]
@p1 int,
@p2 varchar(256)
AS
BEGIN
update KOLESARSKI_ZURNAL set DATUM_VRNITVE=CURRENT_TIMESTAMP,KOLO_SPREJEL=@p2 where KOLO=@p1
END
Thank you.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply