从品牌网站建设到网络营销策划,从策略到执行的一站式服务
The issue:
insert into tb_Admin values (1,111, 'ricky',1234)
Implicit conversion from data type varchar to varbinary is not allowed. Use the CONVERT function to run this query.
创新互联公司公司2013年成立,是专业互联网技术服务公司,拥有项目成都做网站、成都网站设计网站策划,项目实施与项目整合能力。我们以让每一个梦想脱颖而出为使命,1280元安乡做网站,已为上家服务,为安乡各地企业和个人服务,联系电话:18982081108
Root Cause:the column 'AdminName' define as varbinary.
--The table structure: CREATE TABLE [dbo].[tb_Admin]( [ID] [int] NOT NULL, [AdminNum] [varchar](50) NULL, [AdminName] [varbinary](50) NULL, [AdminPwd] [varbinary](50) NULL, CONSTRAINT [PK_tb_Admin] 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] GO
Resolution:
Insert into tb_Admin(ID,AdminNum,AdminName,AdminPwd) values (1,111,cast('name' as varbinary(50)),cast('1234' as varbinary(50)))
Result1:
ID AdminNum AdminName AdminPwd
1 111 0x6E616D65 0x31323334
Search the original information:
SELECT TOP 10 [ID] ,[AdminNum] , cast([AdminName] as varchar(50)) , cast([AdminPwd] as varchar(50)) FROM [db_ExamOnline].[dbo].[tb_Admin]
Result2:
ID AdminNum (No column name) (No column name)
1 111 name 1234
成都网站建设公司地址:成都市青羊区太升南路288号锦天国际A座10层 建设咨询028-86922220
成都快上网科技有限公司-四川网站建设设计公司 | 蜀ICP备19037934号 Copyright 2020,ALL Rights Reserved cdkjz.cn | 成都网站建设 | © Copyright 2020版权所有.
专家团队为您提供成都网站建设,成都网站设计,成都品牌网站设计,成都营销型网站制作等服务,成都建网站就找快上网! | 成都网站建设哪家好? | 网站建设地图