首页 新闻 会员 周边 捐助

varBinary(max)Null max附近有语法错误

0
悬赏园豆:5 [已解决问题] 解决于 2014-04-18 15:29

Max附近语法错误? 难道不能这么写了? 求老师指点。

罗罗づ的主页 罗罗づ | 初学一级 | 园豆:5
提问于:2014-04-18 12:45
< >
分享
最佳答案
0

删掉Null

收获园豆:5
xgdw | 初学一级 |园豆:4 | 2014-04-18 13:13

不行。

罗罗づ | 园豆:5 (初学一级) | 2014-04-18 13:27

@罗罗づ: declare @r varBinary(max) 这样都不行?

xgdw | 园豆:4 (初学一级) | 2014-04-18 13:33

@Smok: 我是建表这样写肯定不行撒。

罗罗づ | 园豆:5 (初学一级) | 2014-04-18 13:35

@罗罗づ: 把建表 语句发出来

xgdw | 园豆:4 (初学一级) | 2014-04-18 13:39

@Smok: 

Create Table [Operator]
(
-- 主键列,自动增长 标识种子为 1
[Id] int identity(1,1) Constraint [PK_OperatorId] Primary Key,

[OperatorName] nVarChar(50) Constraint [UQ_OperatorName] Unique(OperatorName) Not Null,

[Password] nVarChar(50) Constraint [CK_Password] Check(len([Password])>=6) Not Null,

[RightsList] varBinary(max)null,

[State] bit Constraint [DF_State] Default('true') Constraint [CK_State] Check([State] in ('true','false')) Not Null
)
Go

罗罗づ | 园豆:5 (初学一级) | 2014-04-18 14:55

@罗罗づ: 试过运行没问题.

xgdw | 园豆:4 (初学一级) | 2014-04-18 14:58

@Smok: 不会吧?

罗罗づ | 园豆:5 (初学一级) | 2014-04-18 15:03

@Smok: 你用的SqlServer2008还是2005?

罗罗づ | 园豆:5 (初学一级) | 2014-04-18 15:04

@Smok: 

Insert Into [Operator] Values('admin', '666666',
0x0001000000FFFFFFFF01000000000000000401000000F50153797374656D2E436F6C6C656374696F6E732E47656E657269632E44696374696F6E61727960325B5B53797374656D2E537472696E672C206D73636F726C69622C2056657273696F6E3D322E302E302E302C2043756C747572653D6E65757472616C2C205075626C69634B6579546F6B656E3D623737613563353631393334653038395D2C5B436F64696E674D6F7573652E434D43536861727053444B2E4D6F64656C2E5269676874732C20434D43536861727053444B4D6F64656C2C2056657273696F6E3D312E302E302E302C2043756C747572653D6E65757472616C2C205075626C69634B6579546F6B656E3D6E756C6C5D5D040000000756657273696F6E08436F6D7061726572084861736853697A650D4B657956616C756550616972730003000308920153797374656D2E436F6C6C656374696F6E732E47656E657269632E47656E65726963457175616C697479436F6D706172657260315B5B53797374656D2E537472696E672C206D73636F726C69622C2056657273696F6E3D322E302E302E302C2043756C747572653D6E65757472616C2C205075626C69634B6579546F6B656E3D623737613563353631393334653038395D5D08F90153797374656D2E436F6C6C656374696F6E732E47656E657269632E4B657956616C75655061697260325B5B53797374656D2E537472696E672C206D73636F726C69622C2056657273696F6E3D322E302E302E302C2043756C747572653D6E65757472616C2C205075626C69634B6579546F6B656E3D623737613563353631393334653038395D2C5B436F64696E674D6F7573652E434D43536861727053444B2E4D6F64656C2E5269676874732C20434D43536861727053444B4D6F64656C2C2056657273696F6E3D312E302E302E302C2043756C747572653D6E65757472616C2C205075626C69634B6579546F6B656E3D6E756C6C5D5D5B5D0D00000009020000001100000009030000000402000000920153797374656D2E436F6C6C656374696F6E732E47656E657269632E47656E65726963457175616C697479436F6D706172657260315B5B53797374656D2E537472696E672C206D73636F726C69622C2056657273696F6E3D322E302E302E302C2043756C747572653D6E65757472616C2C205075626C69634B6579546F6B656E3D623737613563353631393334653038395D5D00000000070300000000010000000D00000003F70153797374656D2E436F6C6C656374696F6E732E47656E657269632E4B657956616C75655061697260325B5B53797374656D2E537472696E672C206D73636F726C69622C2056657273696F6E3D322E302E302E302C2043756C747572653D6E65757472616C2C205075626C69634B6579546F6B656E3D623737613563353631393334653038395D2C5B436F64696E674D6F7573652E434D43536861727053444B2E4D6F64656C2E5269676874732C20434D43536861727053444B4D6F64656C2C2056657273696F6E3D312E302E302E302C2043756C747572653D6E65757472616C2C205075626C69634B6579546F6B656E3D6E756C6C5D5D0C0500000047434D43536861727053444B4D6F64656C2C2056657273696F6E3D312E302E302E302C2043756C747572653D6E65757472616C2C205075626C69634B6579546F6B656E3D6E756C6C04FCFFFFFFF70153797374656D2E436F6C6C656374696F6E732E47656E657269632E4B657956616C75655061697260325B5B53797374656D2E537472696E672C206D73636F726C69622C2056657273696F6E3D322E302E302E302C2043756C747572653D6E65757472616C2C205075626C69634B6579546F6B656E3D623737613563353631393334653038395D2C5B436F64696E674D6F7573652E434D43536861727053444B2E4D6F64656C2E5269676874732C20434D43536861727053444B4D6F64656C2C2056657273696F6E3D312E302E302E302C2043756C747572653D6E65757472616C2C205075626C69634B6579546F6B656E3D6E756C6C5D5D02000000036B65790576616C7565010424436F64696E674D6F7573652E434D43536861727053444B2E4D6F64656C2E5269676874730500000006060000000874736D6946696C65090700000001F8FFFFFFFCFFFFFF06090000000E74736D694C6F636B53637265656E090A00000001F5FFFFFFFCFFFFFF060C0000000874736D6953707231090D00000001F2FFFFFFFCFFFFFF060F0000000A74736D694C6F674F6666091000000001EFFFFFFFFCFFFFFF06120000000874736D6945786974091300000001ECFFFFFFFCFFFFFF06150000001174736D6953797374656D53657474696E67091600000001E9FFFFFFFCFFFFFF06180000001274736D694368616E676550617373776F7264091900000001E6FFFFFFFCFFFFFF061B0000001174736D695269676874734D616E61676572091C00000001E3FFFFFFFCFFFFFF061E0000000874736D6953707232091F00000001E0FFFFFFFCFFFFFF06210000000E74736D694175746F557064617465092200000001DDFFFFFFFCFFFFFF062400000006747353707233092500000001DAFFFFFFFCFFFFFF06270000000874736D6948656C70092800000001D7FFFFFFFCFFFFFF062A0000000974736D6941626F7574092B000000050700000024436F64696E674D6F7573652E434D43536861727053444B2E4D6F64656C2E526967687473050000000E5F72696768747343617074696F6E0C5F7269676874735374617465165F706172656E744C6576656C5269676874734E616D650D4D6F64656C426173652B5F6964144D6F64656C426173652B5F6D6F64656C4E616D650100010001010805000000062C0000000AE69687E4BBB62826462901062D000000066D734D61696E010000000906000000010A00000007000000062F00000010E99481E5AE9AE5B18FE5B99528264C29010906000000020000000909000000010D0000000700000006320000000CE29481E29481E29481E2948101090600000003000000090C00000001100000000700000006350000000AE6B3A8E9948028264F2901090600000004000000090F00000001130000000700000006380000000AE98080E587BA28265829010906000000050000000912000000011600000007000000063B00000010E7B3BBE7BB9FE8AEBEE7BDAE2826532901092D000000060000000915000000011900000007000000063E0000001FE4BFAEE694B9E5BD93E5898DE6938DE4BD9CE59198E5AF86E7A08128264329010915000000070000000918000000011C00000007000000064100000010E69D83E99990E7AEA1E790862826522901091500000008000000091B000000011F00000007000000093200000001091500000009000000091E000000012200000007000000064700000010E8BDAFE4BBB6E69BB4E696B0282655290109150000000A000000092100000001250000000700000009320000000109150000000B0000000924000000012800000007000000064D00000010E8BDAFE4BBB6E5B8AEE58AA9282648290109150000000C0000000927000000012B00000007000000065000000013E585B3E4BA8EE69CACE8BDAFE4BBB6282641290109150000000D000000092A0000000B,
1)  那你将这个insert语句插入进去看行不行?

罗罗づ | 园豆:5 (初学一级) | 2014-04-18 15:06

@罗罗づ: 2008

xgdw | 园豆:4 (初学一级) | 2014-04-18 15:06

@Smok: 我的数据库是2005

罗罗づ | 园豆:5 (初学一级) | 2014-04-18 15:06

@罗罗づ: 同样没有问题,插入成功

xgdw | 园豆:4 (初学一级) | 2014-04-18 15:07

@Smok: 那我知道了肯定是跟数据库版本有关系。 我这边有两个错误第一个就是Max这里 还有个就是插入的时候 会提示将 varchar 值 'false' 转换为数据类型为 bit 的列时发生语法错误。 谢谢你哈

罗罗づ | 园豆:5 (初学一级) | 2014-04-18 15:10
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册