I am performing some test on sql server and I want to get the best insert speed possible. The statement I use is something like this: INSERT INTO db_Test_databse..tbl_test with(rowlock) ( …
Tag: insert
How to do a batch insert in MySQL
I have 1-many number of records that need to be entered into a table. What is the best way to do this in a query? Should I just make a loop and insert one record per iteration? Or is there a better way? Answer From the MySQL manual INSERT statements that use VALUES syntax can insert multiple rows. To do
Getting new IDs after insert
I’m inserting a bunch of new rows into a table which is defined as follows: using the following insert: when I’ve finished, I’d like to know the IDs of all the newly inserted rows. SCOPE_IDENTITY() only returns the ID last row inserted. How can I get all the new IDs? One method that springs to mind would be to grab
Solutions for INSERT OR UPDATE on SQL Server
Assume a table structure of MyTable(KEY, datafield1, datafield2…). Often I want to either update an existing record, or insert a new record if it doesn’t exist. Essentially: IF (key exists) run …
Generate insert SQL statements from a CSV file
I need to import a csv file into Firebird and I’ve spent a couple of hours trying out some tools and none fit my needs. The main problem is that all the tools I’ve been trying like EMS Data Import and Firebird Data Wizard expect that my CSV file contains all the information needed by my Table. I need to