October 20, 2014 at 8:56 pm
Hi guys im having this error, which Im having a hard time. I can't convert varbinary to varchar using my stored procedure. Is there any alternative way or any one can help me to solve this problem? Thank you!
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER PROCEDURE [dbo].[CondoManagementAccount_InsertWithPassword] '8053250','OSP',0,NULL,'ANNIE ALLI-BAUTISTA/EDMUND BAUTISTA',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,DD3C7638,FALSE,NULL
@No char(7)
,@ProjectCode varchar(5)
,@Type tinyint
,@RegisteredEmail varchar(50)
,@Name varchar(150)
,@Representative varchar(150)
,@Address varchar(250)
,@TelHome varchar(11)
,@TelOfficevarchar(11)
,@TelOfficeLocal varchar(6)
,@Mobile varchar(11)
,@Fax varchar(11)
,@OtherContactsvarchar(50)
,@TIN varchar(30)
,@OnlinePassword varbinary(30)
,@Disabled bit
,@BuyId varchar(50)
AS
BEGIN
SET NOCOUNT OFF;
INSERT INTO [CondoManagementAccount]
([No]
,[ProjectCode]
,[Type]
,[RegisteredEmail]
,[Name]
,[Representative]
,[Address]
,[TelHome]
,[TelOffice]
,[TelOfficeLocal]
,[Mobile]
,[Fax]
,[OtherContacts]
,[TIN]
,[OnlinePassword]
,[Disabled]
,[BuyId])
VALUES
(@No
,@ProjectCode
,@Type
,@RegisteredEmail
,@Name
,@Representative
,@Address
,@TelHome
,@TelOffice
,@TelOfficeLocal
,@Mobile
,@Fax
,@OtherContacts
,@TIN
,@OnlinePassword
,@Disabled
,@BuyId)
END
October 20, 2014 at 10:15 pm
Hi and welcome to forum. Quick note, you should post this question in the appropriate forum depending on your SQL Server version.
The answer is actually in the question, look up the CONVERT function in Books Online and make special note of the third parameter of that function.
😎
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply