insert

Sharepoint upload image, upload to missing items

Hello! When I access my site with address like in central administration (ex: mysite:7777) list of "upload to" does not contain all elements. It only consists of images, documents and pages. (I upload from some page, edit and then insert image from computer) When I access my site with ip address (ex: 192.168.100.100:7777 or other addr...

change of vectors first pointer

hello, when i use vector to store some data, i usually access to this data by the pointer of the vector's first entry. because it it faster than the at() method. but i realize that when i insert a block of data, say an array to the end of vector, the first entry's pointer changes. this may be realated to stack stuff, but if i add the ar...

Identity insert - performance

I have one solution where I insert rows where I use GUIDs instead of an Identity. The Guid is generated in c#. I have another solution where the table, indexes etc are identical, but instead of GUIDs I use identities and let Sql-server generate them. In the later case I get a performance issue.... Ideas? //Daniel EDIT I really am so...

Inserting Selected Row onto SQL Server Database from GridView

protected void Authorise(object sender, EventArgs e) { CheckBox chk; foreach (GridViewRow rowItem in GridView1.Rows) { // gets the Debit Reference number for each row checked string type = GridView1.DataKeys[rowItem.RowIndex].Values[0].ToString(); // gets the Debit E...

php+mysql: insert a php array into mysql

Hi I have an array with 30000 plus entries that need to go into a MySQL table. What is the best practice? From here? Lets say [0], [1] and [2] in the database would be 'title', 'type' and 'customer' Is it add key names matching the column names in the table and call som "magic" function? Or build the query manually... Array ( [0]...

Insert auto-number from newly inserted row in Access with Coldfusion

I have a few tables: a medError table, an option table, and a selected_options table. When somebody submits the relevant form, I have an insert which inserts all the info from the form to the medError table. However, on this form, there is a section of dynamic checkboxes based on the items in the option table. The selected_options table...

insert row without set primary column

I have that query : INSERT INTO GOST (ASSORTMENTID, ROZMIAR, GOST) VALUES ( 54,'S','MjgwMzktODkgMTc0LTk2') I want insert new row in table GOST, but I don't want to specify column with primary key - GOSTID. I want that database set next id value. When I run this code I have that error: validation error for column GOSTID, value "...

Conversion failed when converting the varchar value to int

I'm getting an error with what should be a simple query to insert data. I've done searching, but for the life of me, I cant figure out whats happening. Here's my SQL: IF OBJECT_ID('settings') IS NOT NULL DROP TABLE [settings] CREATE TABLE [settings] ( [id] [bigint] IDENTITY(1,1) NOT NULL PRIMARY KEY, [tenant_id] [bigint] NOT ...

Using wpdb in Wordpress to Insert a row

Does anyone see anything wrong with what I am doing here? I haven't worked with the database expressions in WP yet. All of my code runs except when I start to try to add items to tables I have created in the WP database. Any info would be greatly appreciated. To me it seems that this syntax is correct and should run. $wpdb->insert($wpd...

Get count of records affected by INSERT or UPDATE in Postgres

My database driver for Postgres 8/9 does not return a count of records affected when executing INSERT or UPDATE. Postgres offers the non-standard syntax "RETURNING" which seems like a good workaround. But what might be the syntax? The example returns the ID of a record, but I need a count. INSERT INTO distributors (did, dname) VALU...

Inserting Selected Row onto SQL Server Database from GridView

protected void Authorise(object sender, EventArgs e) { CheckBox chk; foreach (GridViewRow rowItem in GridView1.Rows) { // gets the Debit Reference number for each row checked string type = GridView1.DataKeys[rowItem.RowIndex].Values[0].ToString(); // gets t...

How do i load data Infile in multiple tables?

hi i run python program where im inserting many many new entries to database, this new entries are spread accross multiple tables. what is the quickest way to load them into database? at now im using something like this LOAD DATA LOCAL INFILE file INTO TABLE table FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (col1, col2, c...

SQL Server Insert Query help

I have the following code that I use in a Query to update a table called ListClientCasePresentingIncidents which uses a function called fnSplit to split a comma seperated nvarchar named @CasePresentingIncidents. IF ( @CasePresentingIncidents <> '' ) INSERT INTO ListClientCasePresentingIncidents ( PresentingIncident ...

Inserting rows into a MySQL table based on a query

I have a query SELECT A.a, A.b, A.c FROM A LEFT JOIN X ON A.a = X.x WHERE X.x IS NULL which finds entries in table A which have no corresponding entry in table X. How can I insert the results of this query into table X? If I had only a few entries I would do INSERT INTO X(xa, xb, xc) VALUES ('a1', 'b1', 'c1'), ('a2', 'b2', 'c2') ...

What is the best way to write code that first checks if a row exists and updates or inserts it accordingly?

I am rather new to the more modern ways of coding database persistence, and my intuition is telling me I probably am missing something because my code seems "inelegant" but I do not see another way to do it. Note: I understand maybe Linq to SQL is considered "dead". I'm more in a "learning the concepts" mode assuming that I can probabl...

Is it possible to use two SCOPE_IDENTITY calls in the same procedure?

The way I want my stored procedure to work is this, the user passes all of the customer data, name, phone, and all of address info into the procedure, then I want to perform an insert into the address table, get the id generated from that insert, use that id in another insert for the customer table then return the customer id to the user...

Inserting embed code in database PHP issue

hey, I'm trying to insert an embed code in my database, and it's giving me this error Error adding new data: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'movie.php?id=6001', type = 'stream', embed = '<object width=\"500\" ...