SQL HexString 与 Binary 互换
HexString to Binary:
DECLARE @y CHAR(34)
SET @y = '0x499104dc92dd27499da9ad8f56dcb437'
DECLARE @x BINARY(16)
DECLARE @sql NVARCHAR(200)
SET @sql = 'SELECT @x = ' + @y
EXEC sp_executesql
@sql,
N'@x BINARY(16) OUTPUT',
@x OUTPUT
SELECT @x
Binary to HexString:
DECLARE @a VARBINARY(20)
SET @a=0x7fd81de7360fb53649412521d06249cc69357d78
SELECT @a
SELECT master.dbo.fn_varbintohexstr(@a)
相关文档:
向高手请教一个问题:
当我执行:
use master
exec xp_cmdshell 'osql /S musqlserver /U sa /P mypwd /d haodb /Q "select top 10 * from trandetail" /o C:\my1.xls'
以上执行成功,会产生新文件:C:\my1.xls'
然后我想将此文件直接copy到另一台电脑中[已建连接]
执行
......
--
> 测试数据:[tb]
if
object_id
(
'
[tb]
'
)
is
not
null
drop
table
[
tb
]
go
create
table
[
tb
]
(
[
id
]
int
,
[
lx
]
int
)
insert
[
tb
]
select
29
,
2
union
all
select
30
,
3
union
all
sel ......
后台数据库:
[Microsoft Access]
与
[Microsoft Sql Server]
更换之后,ASP代码应注意要修改的一些地方:
[一]连接问题(举例)
[Microsoft Access]
constr = "DBQ=c:\data\clwz.mdb; DRIVER={Microsoft Access Driver (*.mdb)}"
[Microsoft Sql Server]
constr = "DRIVER={SQL Server};SERVER=host;DATA ......
select
描述:查询顾客的公司名、地址信息
查询句法:
var 构建匿名类型1 = from c in ctx.Customers
select new
  ......