Save byte array in sql server(在sql server中保存字节数组)
问题描述
我希望使用一种方法来保存需要使用字节数组的密码,如本 发布
Am looking to use an approach in saving passwords that requires using byte array as in this post
那么我应该在 sql server 中使用哪种数据类型来保存字节数组?以及如何使用 SqlCommand 传递和检索字节数组?
So which data type should i use in sql server to save byte array? and how can i pass and retrieve the byte array using SqlCommand?
推荐答案
如果它总是相同的长度,那么 binary(length)
将是合适的.如果它的长度会有所不同,请使用 varbinary(maxlength)
.
If it's always going to be the same length, then binary(length)
would be suitable. If it's going to vary in length, use varbinary(maxlength)
.
二进制和 varbinary.
而且,正如@p.s.w.g 所说,您可以通过将其放入合适的参数中来从代码中传递它.
And, as @p.s.w.g says, you pass it from code by placing it into a suitable parameter.
这篇关于在sql server中保存字节数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在sql server中保存字节数组


基础教程推荐
- SQL Server 2016更改对象所有者 2022-01-01
- 无法在 ubuntu 中启动 mysql 服务器 2021-01-01
- ERROR 2006 (HY000): MySQL 服务器已经消失 2021-01-01
- 将数据从 MS SQL 迁移到 PostgreSQL? 2022-01-01
- 在 VB.NET 中更新 SQL Server DateTime 列 2021-01-01
- 如何在 SQL Server 的嵌套过程中处理事务? 2021-01-01
- SQL Server 中单行 MERGE/upsert 的语法 2021-01-01
- 使用pyodbc“不安全"的Python多处理和数据库访问? 2022-01-01
- SQL Server:只有 GROUP BY 中的最后一个条目 2021-01-01
- Sql Server 字符串到日期的转换 2021-01-01