blogspot visit counter

Monday, 29 April 2013

Implicit conversion from data type varchar to varbinary is not allowed

Implicit conversion from data type varchar to varbinary is not allowed [Error Solution]
Error :-Implicit conversion from data type varchar to varbinary is not allowed

Solution :- This Problem Occur when we define the wrong data type declaration for create the table 
Example as Shown Below




CREATE TABLE [dbo].[issue_tab](
[id] [int] IDENTITY(1,1) NOT NULL,
[name] [varchar](255) NULL,
[party] [varchar](255) NULL,
[address] [text] NULL,
[related_person] [varchar](255) NULL,
[type_selection] [varchar](255) NULL,
[contactno] [VARBINARY(MAX)](10) NULL,
CONSTRAINT [PK_issue_tab] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF
, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON,
 ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

In this Above table Lock at the highlight contactno coloumn .The datatype is[VARBINARY(MAX)](10) NULL show we get the error .

Result : - So Change the Data Type Like Varchar and According to You Want to Enter From the Form



CREATE TABLE [dbo].[issue_tab](
[id] [int] IDENTITY(1,1) NOT NULL,
[name] [varchar](255) NULL,
[party] [varchar](255) NULL,
[address] [text] NULL,
[related_person] [varchar](255) NULL,
[type_selection] [varchar](255) NULL,
[contactno] [varchar]](255) NULL,
CONSTRAINT [PK_issue_tab] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF
, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON,
 ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
---------------------------------------------------------------------------------------------------------

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...