Home > Database > Mysql Tutorial > sqlserver根据id集合,批量插入。(巧用sqlserver内置函数)

sqlserver根据id集合,批量插入。(巧用sqlserver内置函数)

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 17:39:35
Original
1435 people have browsed it

场景如下,传入的id,如1,3,4,88。可以在.net后台处理,但是我更习惯在数据库中操作。 插入数据时可以这样处理,直接贴代码。 CREATE PROCEDURE pro_CategorySave( @ids VARCHAR ( 400 ) , @type INT , @TemplateID INT , @CategoryID INT ) ( 8000 ) ; DELE

 

场景如下,传入的id,虚拟主机,如1,3,4,88。可以在.net后台处理,香港服务器,但是我更习惯在数据库中操作。

插入数据时可以这样处理,香港服务器租用,直接贴代码。

CREATE PROCEDURE pro_CategorySave ( @ids VARCHAR(400) , @type INT , @TemplateID INT , @CategoryID INT ) (8000) ; DELETE FROM GaituApp.dbo.TemplateRelationship Type CategoryID ( ) INSERT INTO GaituApp.dbo.TemplateRelationship ( TemplateID , Type , CategoryID , CreateTime, Pid ) SELECT (((((((, ((((((20)) ) (@str) END END

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
Latest Issues
Problem with tp6 connecting to sqlserver database
From 1970-01-01 08:00:00
0
0
0
Unable to connect to SQL Server in Laravel
From 1970-01-01 08:00:00
0
0
0
Methods of parsing MYD, MYI, and FRM files
From 1970-01-01 08:00:00
0
0
0
SQLSTATE: User login failed
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template