Avatar of thierry91
thierry91
 asked on

MS SQL request INSERT with out use convert

my INSERT is :

INSERT INTO [SurfControl_WebFilter].[dbo].[_WhereObjList_A] ([Object_ID],[Attrib_Name],[Type],[Attrib_Val_S],[Attrib_Val_N],[Attrib_Val_B]) VALUES
(
'1, int,'
,'Member, varchar(40),'
,'0, int,','ScoutMonitored\Monitored Sites\www.superu-laiz.com, varchar(250),'
,'NULL, int,'
,'NULL, varbinary(255),'
)



table WebFilter is :

CREATE TABLE [dbo].[_WhereObjList_A](
      [Object_ID] [int] NULL,
      [Attrib_Name] [varchar](40) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
      [Type] [int] NULL,
      [Attrib_Val_S] [varchar](250) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
      [Attrib_Val_N] [int] NULL,
      [Attrib_Val_B] [varbinary](255) NULL
) ON [PRIMARY]

When I whant insert I have ERROR :

Msg 257, Level 16, State 3, Line 1
Implicit conversion from data type varchar to varbinary is not allowed. Use the CONVERT function to run this query.

I not want use CONVERT.

where is my error in my request INSERT ?
Microsoft SQL Server 2005

Avatar of undefined
Last Comment
Lowfatspread

8/22/2022 - Mon
SOLUTION
Paul Jackson

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER CERTIFIED SOLUTION
JestersGrind

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Sara bhai

you are trying to store all varchar values in table.
so need to change the column data type to varchar or nvarchar.
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck