Home > Database > Mysql Tutorial > body text

SQL Server 2008使用SQL INSERT多笔Record

WBOY
Release: 2016-06-07 17:54:32
Original
1208 people have browsed it

此功能在MySQL在3.22.5之后就有的功能,SQL Server在这个SQL Server 2008版本才加入此功能 -- 切换测试数据库 USE MyDB GO -- 建一个测试数据表 CREATE TABLE [mytable] ( myid nvarchar(10) ,givenName nvarchar(50) ,email nvarchar(50) ); GO -- 一次Inser

此功能在MySQL在3.22.5之后就有的功能,SQL Server在这个SQL Server 2008版本才加入此功能

-- 切换测试
USE MyDB
GO

-- 建一个测试数据表
CREATE TABLE [mytable]
(
myid
nvarchar(10)
,givenName
nvarchar(50)
,email
nvarchar(50)
);
GO

-- 一次Insert 多笔资料
INSERT INTO [mytable]
VALUES
('01','Brad','brad@test.com')
,('02','Siliva','siliva@test.com')
,('03','Allen','Allen@test.com');
GO

-- 检查资料是否正确写入
SELECT * FROM [mytable];

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!