本文介绍了如何批量插入SQL表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一张下表:

我想从.csv文件批量插入促销代码值到下表,我该怎么做?



CREATE TABLE [dbo]。[PromoCodes](

[SeqId] [bigint] IDENTITY(1000,1)NOT NULL,

[Promocode] [varchar](256)NOT NULL,

[IsUsed] [bit] NULL,

[IsRecived] [bit] NULL,

[CREATED_BY] [varchar](256)NOT NULL,

[CREATION_DATE] [datetime] NOT NULL,

[LAST_UPDATED_BY] [varchar](256)NOT NULL,

[LAST_UPDATED_DATE] [datetime] NOT NULL,

CONSTRAINT [PK_HotStarPromoCodes] PRIMARY KEY CLUSTERED



[SeqId] ASC



GO



什么我试过了:



我指的是指定其他列值的错误。

Hi
I have a table below:
I want to do bulk insert only promo code values from a .csv file to below table, how do I do it?

CREATE TABLE [dbo].[PromoCodes](
[SeqId] [bigint] IDENTITY(1000,1) NOT NULL,
[Promocode] [varchar](256) NOT NULL,
[IsUsed] [bit] NULL,
[IsRecived] [bit] NULL,
[CREATED_BY] [varchar](256) NOT NULL,
[CREATION_DATE] [datetime] NOT NULL,
[LAST_UPDATED_BY] [varchar](256) NOT NULL,
[LAST_UPDATED_DATE] [datetime] NOT NULL,
CONSTRAINT [PK_HotStarPromoCodes] PRIMARY KEY CLUSTERED
(
[SeqId] ASC
)
GO

What I have tried:

It is throwing me an error as to specify other column values.

推荐答案



这篇关于如何批量插入SQL表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 21:16