在GUID列中使用SQL批量插入 [英] Using SQL Bulk Insert in GUID column

查看:264
本文介绍了在GUID列中使用SQL批量插入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有Guid列的表,其默认约束设置为顺序,这也是主键。我期待即使我在插入之前没有在数据表上指定值,它仍会插入但它会提示错误,即
Guid列不允许空值。你如何处理这个错误。我应该在插入之前自己创建一个Guid吗?我认为C#没有连续的Guid。

Hi, i have a table with a Guid column which has a default constraint set to sequential, this is also the primary key. I am expecting that even if i didn't specify the value on the data table before insert it will still insert but it prompts an error that the Guid column doesn't allow nulls. How do you deal with this error. Should i create a Guid myself before inserting? C# doesn't have a sequential Guid i guess.

问候

推荐答案

我应该在插入之前自己创建一个Guid吗?我认为C#没有连续的Guid。

每次生成一个GUID都是唯一值。

A GUID is a unique value every time one is generated.


这篇关于在GUID列中使用SQL批量插入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆