Sqlserver inserts data in batches Based on the id set. (Use sqlserver built-in functions)

Source: Internet
Author: User
The following example shows the input IDs, such as 1, 3, 4, and 88. It can be processed in the. net background, but I prefer to operate in the database. When inserting data, you can directly paste the code. CREATEPROCEDUREpro_CategorySave (@ idsVARCHAR (400), @ typeINT, @ TemplateIDINT, @ CategoryIDINT) (8000); DELE

The following example shows the input IDs, such as 1, 3, 4, and 88. It can be processed in the. net background, but I prefer to operate in the database. When inserting data, you can directly paste the code. Create procedure pro_CategorySave (@ ids VARCHAR (400), @ type INT, @ TemplateID INT, @ CategoryID INT) (8000); DELE

The scenario is as follows: Input id, Vm, such. It can be processed in the. net backend and Hong Kong server, but I prefer to operate in the database.

This can be done when data is inserted. The Hong Kong server is rented and directly pasted with code.

Create procedure pro_CategorySave (@ ids VARCHAR (400), @ type INT, @ TemplateID INT, @ CategoryID INT) (8000); delete from GaituApp. dbo. templateRelationshipType CategoryID () insert into GaituApp. dbo. templateRelationship (TemplateID, Type, CategoryID, CreateTime, Pid) SELECT (, (20) (@ str) ENDEND

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.