» Home » Insert » Page 1
mysql conditional insert - if not exists insert - multi value insert
by SMOGZINN in Databases

From my previous question this was the solution I am accepting:

SET name = 'phill',
value = 'person',
id = 12345;

But I also wanted to know if I could be multiple values like this

SET (name = 'phill', value = 'person', id = 12345),
(name = 'bob', va

bulk insert to SQL Server, insert statements vs one insert XML statement?
by TheStu in Programming Languages

The application layer (ColdFusion) needs to insert multiple rows into SQL Server 2005.

I was thinking of using loop in app layer to construct multiple input statements and send to SQL Server over JDBC in a single connection.

My colleague however suggests to construct an XML and bulk insert the XML instead.

Which one is the better method?

Insert multiple records using one single insert statement in EXEC of Stored procedure
by smbrant in Databases

In sql server 2008, i have a store procedure which has insert statement , now i want to insert multiple records at a time into table via EXEC.

MY Store Procedure:

insert into tblUser(fullname, email, loginID, password, DOB, question, answers,doc,roleid)
values (@fullname,@email,@loginID,HASHBYTES('sha512',@password),@dob,@question, @answers, GETDATE(),@roleid )<

Generate generic insert statement from existing row for disconnected insert to another database for sync
by akr in Databases

We currently have a c# console app that creates a sync table from triggers that allows the app to send an insert update or delete statement to another copy of the database at another site. This keeps the tables in sync, however the system regularly crashes and we do not have the source code.

I am currently trying to recreate this in sql server.

The sync table is generate

I dont want to insert the PK val.But - Cannot insert explicit value for identity column in table 'Employees' when IDENTITY_INSERT is set to OF
by shortylickens in Coding

I am using the Entity Framework to update my database.
The Employee table has an employeeId primary key field.
When I instantiate an employee object, the employeeId defaults to zero.
I want to insert the employee object into the database, ignoring the primary key value of zero.
Yet I get this exception;
Cannot insert explicit value for identity column in table 'Employee

How to properly insert values into the SQLite database using ContentProvider's insert() method through a CursorLoader?
by dormsbee in Programming Languages

I was reading the doc, but I am still not too sure. Its says to use getContentResolver(), but then that really isn't using CursorLoader. So is there a way to do it through CursorLoader? I know how to do it with query(). Are the steps very similar? Even just a link that explains exactly this would be helpful.

Please note, do not link me to the G

PHP MySQL INSERT data from another table using the where clause and insert unique values to the same rows
by peitschie in Programming Languages

I want to insert data from one table into another where one field equals another in both tables. So far this works. The problem is, I also need to insert additional data into those same rows that is not included on the first table.

//enter rows into database
foreach($_POST['sku'] as $row=>$sku)
//this is the data that needs to be added to the table

Insert Date into database table using Zend framework insert method
by hyperNURb in Programming Languages

I have the foll code as:

$table_project_win = new Application_Model_DbTable_AfterWinProject();
$data_win = array(
'project_id' => $project_id,
'project_name' => $project,
'project_type_id' => $pro_type,
'start_date' => $dateStart,
'end_date' =>

insert record into database failed on iPad, but insert successful in simulator
by Javier Pitalua in Databases

I want insert some records into database, but return failed on my iPad. but insert into successful in simulator, why?

my Code:
create table command:

CREATE TABLE hotReviewWords(ID INTEGER PRIMARY KEY AUTOINCREMENT, word varchar(32),linkWordID int,level int);
- (BOOL) writeRecordToDB:(NSInteger)level indexOfDB:(NSInteger)index

How do I use the value from the latest insert using mysql_insert_id in subsequent MULTIPLE insert statements (in PHP and MYSQL)?
by Davidpaul007 in PHP

I want to add the value of the latest insert from TABLE1 to a subsequent MULTIPLE insert statement into TABLE2 which includes multiple entries - however in MySQL I am just getting a 0 (zero) for each entry added into TABLE2.

I know I need to store the mysql_insert_id in a variable after the first MySQL query has been executed. So I have included a variable called

Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2014 © bighow.org All Rights Reserved .