SQL server database basic statements

Table of Contents Basic operations Create database Open database Create a new data table Insert record Modify records Delete Record Inquire Delete database Delete table System stored procedure procedure Modify table field name Modify table name Modify database name Modify table structure add a column Delete a column Modify a column Add constraints Change database […]

Spring boot + sql server large data volume added in batches

1.SQLServerBulkCopy method (recommended for no weird bugs) Code /** * Get all attribute annotations @TableId and @TableField in the class * * @param instance * @return * @throws NoSuchFieldException */ public static Map<String, String[]> getDeclaredFieldsInfo(Object instance) throws NoSuchFieldException { Map<String, String[]> map = new HashMap(); Class<?> clazz = instance.getClass(); Field[] fields = clazz.getDeclaredFields(); StringBuilder stringBuilder […]

[Query Oracle database data in sql server]

Write a custom directory title here question Introduction to CLR accomplish Question Because sqlserver has performance issues with big data, part of the data is in the Oracle database. In order to facilitate querying or inserting Oracle data in the stored procedure, the method of adding an external assembly to SqlServer and calling the external […]

[SQL Server] Foreign key constraints

Foreign key constraints prologue foreign key constraints Preamble In many scenarios, foreign keys are used to associate the master-slave relationship between two or more tables, so as to quickly query the relationship between data through foreign key fields. In fact, foreign keys are still relatively vague in my concept, and I have never really used […]

[Database] Sql Server 2022 obtains target data through logical processing through temporary tables and cursor traversal

2023, Week 39. Give yourself a goal, and then stick to it and you will always get something. If you don’t believe me, try it! Today, a friend asked me about a problem with Sql Server data processing. I just wanted to review the knowledge about Sql Server temporary tables and cursors. Directory 1. Description […]

How to use SQL Server cursors [Transfer]

Original text excerpted from: http://www.cnblogs.com/moss_tan_jun/archive/2011/11/26/2263988.html Cursors are evil! In relational databases, our thinking about queries is set-oriented. The cursor breaks this rule. The cursor makes our way of thinking change to line by line. For C-like developers, this way of thinking will be more comfortable. The normal way of thinking about collections is: And for […]