Search Results

Search found 30236 results on 1210 pages for 'insert update'.

Page 7/1210 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • An INSERT conditioned on COUNT

    - by Anders Feder
    How can I construct a MySQL INSERT query that only executes if the number of rows satisfying some condition already in the table is less than 20, and fails otherwise? That is, if the table has 18 rows satisfying the condition, then the INSERT should proceed. If the table has 23 rows satisfying the condition, then the INSERT should fail. For atomicity, I need to express this in a single query, so two requests can not INSERT at the same time, each in the 'belief' that only 19 rows satisfy the condition. Thank you.

    Read the article

  • How important is patch management?

    - by James Hill
    Problem I'm trying to sell the idea of organizational patch/update management and antivirus management to my superiors. Thus far, my proposition has been met with two responses: We haven't had any issues yet (I would add that we know of) We just don't think it's that big of a risk. Question Are there any resources available that can help me sell this idea? I've been told that 55-85% of all security related issues can be resolved by proper anti-virus and patch/update management but the individual that told me couldn't substantiate the claim. Can it be substantiated? Additional Information 1/5 of our computers (the ones on the building) have Windows update turned on by default and anti-virus installed. 4/5 of our computers are outside corporate and the users currently have full control over anti-virus and Windows updates (I know this is an issue, one step at a time).

    Read the article

  • Remove iTunes on Mac OS X permanently: no Software Update

    - by ShreevatsaR
    Somewhat predictably, removing iTunes on Mac OS X is a long arduous process, described at http://support.apple.com/kb/ht1224 — which I have followed. As far as I can tell, I have purged every trace of the accursed iTunes from my system. Yet Software Update repeatedly prompts me with updates for iTunes, which I don't want anything to do with, despite my saying "Not now" each time. How can I convince Software Update to leave me alone, and never bother me with mention of iTunes again? I'm on Mac OS X 10.6.4 Build 10F569, and the update being offerred is iTunes 9.2.1. (Note: Not a duplicate of OS X: why Software Update suggests to update removed application?, whose accepted answer is simply to follow the instructions I mentioned above.)

    Read the article

  • PostgreSQL, Foreign Keys, Insert speed & Django

    - by Miles
    A few days ago, I ran into an unexpected performance problem with a pretty standard Django setup. For an upcoming feature, we have to regenerate a table hourly, containing about 100k rows of data, 9M on the disk, 10M indexes according to pgAdmin. The problem is that inserting them by whatever method literally takes ages, up to 3 minutes of 100% disk busy time. That's not something you want on a production site. It doesn't matter if the inserts were in a transaction, issued via plain insert, multi-row insert, COPY FROM or even INSERT INTO t1 SELECT * FROM t2. After noticing this isn't Django's fault, I followed a trial and error route, and hey, the problem disappeared after dropping all foreign keys! Instead of 3 minutes, the INSERT INTO SELECT FROM took less than a second to execute, which isn't too surprising for a table <= 20M on the disk. What is weird is that PostgreSQL manages to slow down inserts by 180x just by using 3 foreign keys. Oh, disk activity was pure writing, as everything is cached in RAM; only writes go to the disks. It looks like PostgreSQL is working very hard to touch every row in the referred tables, as 3MB/sec * 180s is way more data than the 20MB this new table takes on disk. No WAL for the 180s case, I was testing in psql directly, in Django, add ~50% overhead for WAL logging. Tried @commit_on_success, same slowness, I had even implemented multi row insert and COPY FROM with psycopg2. That's another weird thing, how can 10M worth of inserts generate 10x 16M log segments? Table layout: id serial primary, a bunch of int32, 3 foreign keys to small table, 198 rows, 16k on disk large table, 1.2M rows, 59 data + 89 index MB on disk large table, 2.2M rows, 198 + 210MB So, am I doomed to either drop the foreign keys manually or use the table in a very un-Django way by defining saving bla_id x3 and skip using models.ForeignKey? I'd love to hear about some magical antidote / pg setting to fix this.

    Read the article

  • How to insert arabic characters into sql database?

    - by Pavan Reddy
    How can I insert arabic characters into sql database? I tried to insert arabic data into a table and the arabic characters in the insert script were inserted as '??????' in the table. I tried to directly paste the data into the table through sql management studio and the arabic characters was successfully and accurately inserted. I looked around for resolutions for this problems and some threads suggested changing the datatype to nvarchar instead of varchar. I tried this as well but without any luck. How can we insert arabic characters into sql database?

    Read the article

  • join two table for insert data in database in android

    - by shadi
    I have two table(t1,t2) in android, t1 has a primary key that it is foreign key for t2,i want to insert data to this tables,is it necessary to join these two table?if yes, what is code for join these table? i insert data in one of them like this: public long insertQuote(String Quote,int Count1 ) { ContentValues initialValues = new ContentValues(); initialValues.put(GoodName, Quote); initialValues.put(CartID, Count1); return db.insert(DATABASE_TABLE, null, initialValues); }

    Read the article

  • SQL Access INSERT INTO Autonumber Field

    - by KrazyKash
    I'm trying to make a visual basic application which is connected to a Microsoft Access Database using OLEDB. Inside my database I have a user table with the following layout ID - Autonumber Username - Text Password - Text Email - Text To insert data into the table I use the following query INSERT INTO Users (Username, Password, Email) VALUES ('004606', 'Password', '[email protected]') However I seem to get an error with this statement and according to VB it's a syntax error. But then I tried to use the following query INSERT INTO Users (Username) Values ('004606') This query seemed to work absolutely fine... So the problem is I can insert into just one field but not all 3 (excluding the ID field because it's an autonumber). Any help would be appreciated, Thanks

    Read the article

  • Sql Server 2005 multiple insert with c#

    - by bottlenecked
    Hello. I have a class named Entry declared like this: class Entry{ string Id {get;set;} string Name {get;set;} } and then a method that will accept multiple such Entry objects for insertion into the database using ADO.NET: static void InsertEntries(IEnumerable<Entry> entries){ //build a SqlCommand object using(SqlCommand cmd = new SqlCommand()){ ... const string refcmdText = "INSERT INTO Entries (id, name) VALUES (@id{0},@name{0});"; int count = 0; string query = string.Empty; //build a large query foreach(var entry in entries){ query += string.Format(refcmdText, count); cmd.Parameters.AddWithValue(string.Format("@id{0}",count), entry.Id); cmd.Parameters.AddWithValue(string.Format("@name{0}",count), entry.Name); count++; } cmd.CommandText=query; //and then execute the command ... } } And my question is this: should I keep using the above way of sending multiple insert statements (build a giant string of insert statements and their parameters and send it over the network), or should I keep an open connection and send a single insert statement for each Entry like this: using(SqlCommand cmd = new SqlCommand(){ using(SqlConnection conn = new SqlConnection(){ //assign connection string and open connection ... cmd.Connection = conn; foreach(var entry in entries){ cmd.CommandText= "INSERT INTO Entries (id, name) VALUES (@id,@name);"; cmd.Parameters.AddWithValue("@id", entry.Id); cmd.Parameters.AddWithValue("@name", entry.Name); cmd.ExecuteNonQuery(); } } } What do you think? Will there be a performance difference in the Sql Server between the two? Are there any other consequences I should be aware of? Thank you for your time!

    Read the article

  • Difference between INSERT INTO and INSERT ALL INTO

    - by emily soto
    While I was inserting some records in table i found that.. INSERT INTO T_CANDYBAR_DATA SELECT CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,1 AS STAT_TYPE,OVERALL_RATING FROM CANDYBAR_CONSUMPTION_DATA UNION SELECT CONSUMER_ID,CANDYBAR_NAME,SURVEY_YEAR,GENDER,2 AS STAT_TYPE,NUMBER_BARS_CONSUMED FROM CANDYBAR_CONSUMPTION_DATA; 79 rows inserted. INSERT ALL INTO t_candybar_data VALUES (consumer_id,candybar_name,survey_year,gender,1,overall_rating) INTO t_candybar_data VALUES (consumer_id,candybar_name,survey_year,gender,2,number_bars_consumed) SELECT * FROM candybar_consumption_data 86 rows inserted. I have read somewhere that INSERT ALL INTO automatically unions then why those difference is showing.

    Read the article

  • windows 7 update freeze - what to do?

    - by Tom Tom
    Hi, yesterday I shuted down my notebook and windows 7 Ultimate started to install the automatic update. After one hour I noticed that the update is still running. I thought ok, I go to sleep and let it run. In the morning it was still running. Thus I thought it is crashed. Forced a shut-down of the notebook, and restarted it. With the same effect that the notebook is "freezing" at "Install Update 1 of 5". It does not look like whether it is chrased. The progress wheel is still moving. But it does not make any progres.. Thus somehow like crashed. Would appreciate any help! Edit: Ok was able to log-in in "save" (german: abgesicherter) mode. This way I passed to install update screen. I do not want to generally disable updates. What can I do to not install the last update, which is creating troube. Or how can I find out whats the problem with the last update? Edit2: Ok starting in save mode and finally installing the updates manually solved the problem.

    Read the article

  • SQL SERVER – Merge Operations – Insert, Update, Delete in Single Execution

    - by pinaldave
    This blog post is written in response to T-SQL Tuesday hosted by Jorge Segarra (aka SQLChicken). I have been very active using these Merge operations in my development. However, I have found out from my consultancy work and friends that these amazing operations are not utilized by them most of the time. Here is my attempt to bring the necessity of using the Merge Operation to surface one more time. MERGE is a new feature that provides an efficient way to do multiple DML operations. In earlier versions of SQL Server, we had to write separate statements to INSERT, UPDATE, or DELETE data based on certain conditions; however, at present, by using the MERGE statement, we can include the logic of such data changes in one statement that even checks when the data is matched and then just update it, and similarly, when the data is unmatched, it is inserted. One of the most important advantages of MERGE statement is that the entire data are read and processed only once. In earlier versions, three different statements had to be written to process three different activities (INSERT, UPDATE or DELETE); however, by using MERGE statement, all the update activities can be done in one pass of database table. I have written about these Merge Operations earlier in my blog post over here SQL SERVER – 2008 – Introduction to Merge Statement – One Statement for INSERT, UPDATE, DELETE. I was asked by one of the readers that how do we know that this operator was doing everything in single pass and was not calling this Merge Operator multiple times. Let us run the same example which I have used earlier; I am listing the same here again for convenience. --Let’s create Student Details and StudentTotalMarks and inserted some records. USE tempdb GO CREATE TABLE StudentDetails ( StudentID INTEGER PRIMARY KEY, StudentName VARCHAR(15) ) GO INSERT INTO StudentDetails VALUES(1,'SMITH') INSERT INTO StudentDetails VALUES(2,'ALLEN') INSERT INTO StudentDetails VALUES(3,'JONES') INSERT INTO StudentDetails VALUES(4,'MARTIN') INSERT INTO StudentDetails VALUES(5,'JAMES') GO CREATE TABLE StudentTotalMarks ( StudentID INTEGER REFERENCES StudentDetails, StudentMarks INTEGER ) GO INSERT INTO StudentTotalMarks VALUES(1,230) INSERT INTO StudentTotalMarks VALUES(2,255) INSERT INTO StudentTotalMarks VALUES(3,200) GO -- Select from Table SELECT * FROM StudentDetails GO SELECT * FROM StudentTotalMarks GO -- Merge Statement MERGE StudentTotalMarks AS stm USING (SELECT StudentID,StudentName FROM StudentDetails) AS sd ON stm.StudentID = sd.StudentID WHEN MATCHED AND stm.StudentMarks > 250 THEN DELETE WHEN MATCHED THEN UPDATE SET stm.StudentMarks = stm.StudentMarks + 25 WHEN NOT MATCHED THEN INSERT(StudentID,StudentMarks) VALUES(sd.StudentID,25); GO -- Select from Table SELECT * FROM StudentDetails GO SELECT * FROM StudentTotalMarks GO -- Clean up DROP TABLE StudentDetails GO DROP TABLE StudentTotalMarks GO The Merge Join performs very well and the following result is obtained. Let us check the execution plan for the merge operator. You can click on following image to enlarge it. Let us evaluate the execution plan for the Table Merge Operator only. We can clearly see that the Number of Executions property suggests value 1. Which is quite clear that in a single PASS, the Merge Operation completes the operations of Insert, Update and Delete. I strongly suggest you all to use this operation, if possible, in your development. I have seen this operation implemented in many data warehousing applications. Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: Pinal Dave, SQL, SQL Authority, SQL Joins, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, T SQL, Technology Tagged: Merge

    Read the article

  • Programatically insert a Word document into an existing document (Word 2007)

    - by cjb
    I have a Word 2007 document that I want to insert an exsiting Word document into - while preserving the header/footer, graphics, borders etc of both documents. I'm doing this using the Word API in C#. It sounds pretty simple, I mean surely you just use the "InsertFile" method... except that in Word 2007 the "insert file" functionality now is actually "insert text from file" and it does just that - leaving out the page border, graphics and footer etc. OK then, I'll use copy and paste instead, like so... _Document sourceDocument = wordApplication.Documents.Open(insert the 8 million by ref parameters Word requries) sourceDocument.Activate(); // This is the document I am copying from wordApplication.Selection.WholeStory(); wordApplication.Selection.Copy(); targetDocument.Activate(); // This is the document I am pasting into wordApplication.Selection.InsertBreak(wdSectionBreakNextPage); Selection.PasteAndFormat(wdFormatOriginalFormatting); wordApplication.Selection.InsertBreak(wdSectionBreakNextPage); which does what you would expect, takes the source document, selects everything, copies it then pastes it into the target document. Because I've added a section break before doing the paste it also preserves the borders, header/footer of both documents. However - now this is where I have the problem. The paste only includes the borders, header etc if I paste at the end of the target document. If I paste it in the middle - despite there being a preceding section break, then only the text gets pasted and the header and borders etc are lost. Can anyone help before I buy a grenade and a one way ticket to Redmond...

    Read the article

  • SQL Server INSERT, Scope_Identity() and physical writing to disc

    - by TheBlueSky
    Hello everyone, I have a stored procedure that does, among other stuff, some inserts in different table inside a loop. See the example below for clearer understanding: INSERT INTO T1 VALUES ('something') SET @MyID = Scope_Identity() ... some stuff go here INSERT INTO T2 VALUES (@MyID, 'something else') ... The rest of the procedure These two tables (T1 and T2) have an IDENTITY(1, 1) column in each one of them, let's call them ID1 and ID2; however, after running the procedure in our production database (very busy database) and having more than 6250 records in each table, I have noticed one incident where ID1 does not match ID2! Although normally for each record inserted in T1, there is record inserted in T2 and the identity column in both is incremented consistently. The "wrong" records were something like that: ID1 Col1 ---- --------- 4709 data-4709 4710 data-4710 ID2 ID1 Col1 ---- ---- --------- 4709 4710 data-4709 4710 4709 data-4710 Note the "inverted", ID1 in the second table. Knowing not that much about SQL Server underneath operations, I have put the following "theory", maybe someone can correct me on this. What I think is that because the loop is faster than physically writing to the table, and/or maybe some other thing delayed the writing process, the records were buffered. When it comes the time to write them, they were wrote in no particular order. Is that even possible if no, how to explain the above mentioned scenario? If yes, then I have another question to rise. What if the first insert (from the code above) got delayed? Doesn't that mean I won't get the correct IDENTITY to insert into the second table? If the answer of this is also yes, what can I do to insure the insertion in the two tables will happen in sequence with the correct IDENTITY? I appreciate any comment and information that help me understand this. Thanks in advance.

    Read the article

  • Unable to insert DateTime format into database

    - by melvg
    I'm unable to insert the DateTime into my database. Am i writing the statement wrongly? Apparently without the DateTime, I am able to insert into the database string dateAndTime = date + " " + time; CultureInfo provider = CultureInfo.InvariantCulture; DateTime theDateTime = DateTime.ParseExact(dateAndTime, "d MMMM yyyy hh:mm tt", provider); //Create a connection, replace the data source name with the name of the SQL Anywhere Demo Database that you installed SAConnection myConnection = new SAConnection("UserID=dba;Password=sql;DatabaseName=emaDB;ServerName=emaDB"); //open the connection ; myConnection.Open(); //Create a command object. SACommand insertAccount = myConnection.CreateCommand(); //Specify a query. insertAccount.CommandText = ("INSERT INTO [meetingMinutes] (title,location,perioddate,periodtime,attenders,agenda,accountID,facilitator,datetime) VALUES ('"+title+"','" + location + "', '" + date + "','" + time + "', '" + attender + "','" + agenda + "', '" + accountID + "','" + facilitator + "','" +theDateTime+ "')"); try { insertAccount.ExecuteNonQuery(); if (title == "" || agenda == "") { btnSubmit.Attributes.Add("onclick", "displayIfSuccessfulInsert();"); //ScriptManager.RegisterStartupScript(this, GetType(), "error", "alert('Please ensure to have a title or agenda!');", true); } else { btnSubmit.Attributes.Add("onclick", "displayIfSuccessfulInsert();"); Response.Redirect("HomePage.aspx"); //ScriptManager.RegisterStartupScript(this, this.GetType(), "Redit", "alert('Minutes Created!'); window.location='" + Request.ApplicationPath + "/HomePage.aspx';", true); } } catch (Exception exception) { Console.WriteLine(exception); } finally { myConnection.Close(); } It does not insert the SQL into my database.

    Read the article

  • How to configure Unity/Compiz in 12.04 so that Update Manager opens maximized w/screen bigger than 1024×600?

    - by Jani Uusitalo
    In Precise, window auto-maximize is disabled on monitors with a resolution above 1024 × 600 [1]. I have a bigger resolution, but I prefer maximized windows anyway. I want Update Manager to start maximized. What I've tried so far: In Compiz Config Settings Manager, I have Place Windows activated and 'Windows with fixed placement mode' has windows matching the rule "(name=gnome-terminal) | (name=update-manager)" set to 'Maximize'. With this, Gnome Terminal starts maximized, Update Manager does not. In Compiz Config Settings Manager, I have set a Window Rules [2] rule to match "name=update-manager". Irregardless of any rules set or not, activating Window Rules results in not being able to bring out Unity Launcher anymore, Alt+Tab window switching becoming slow or nonfunctional entirely and the screen sporadically freezing completely. Not a viable option apparently. I've installed Maximus [3] and started it. Update Manager ignores it (or vice versa). I've not tried devilspie and would prefer not to. Having to configure something external for this would seem stupidly redundant with (the no-brainer) Maximus and all these Compiz options already available. I just can't seem to make them work. [1] https://bugs.launchpad.net/ayatana-design/+bug/797808 [2] http://askubuntu.com/a/53657/34756 [3] How to configure my system so that all windows start maximized?

    Read the article

  • Windows update error code : 80244004

    - by Hamidreza
    I am using Windows 7 and ESET SMART SECURITY 5 . Today I wanted to update my computer using Windows Update but it does give me error : Error(s) found: Code 80244004        Windows Update encountered an unknown error. My System Info : Sony Vaio EA2gfx , Ram : 4GB DDR2 , CPU: Intel Core i 5 I checkd out this links but they didn't help : http://answers.microsoft.com/en-us/windows/forum/windows_7-windows_update/while-updating-i-am-getting-the-error-code/0b9b756c-5b6e-4571-838e-f90c48a4e00c https://www.calguns.net/calgunforum/showthread.php?t=583860 http://www.sevenforums.com/windows-updates-activation/235807-windows-update-error-80244004-a.html Please help me, thanks.

    Read the article

  • Windows 7 Update freezes - what to do?

    - by Tom Tom
    Hi, Yesterday I shutdown my notebook, and Windows 7 Ultimate started to install automatic updates. After one hour, I noticed that the update was still running. I thought OK, I shall go to sleep and let it run. In the morning it was still running. Thus, I thought it had crashed, forced a shutdown of the notebook and then restarted it. With the same effect that the notebook is "freezing" at "Install Update 1 of 5". It does not look like it has crashed. The progress wheel is still moving. But it does not make any progress... Would appreciate any help! Edit: OK, I was able to log-in into safe mode. This way I passed the install update screen. I do not want to generally disable updates, what can I do to not install the last update, which is creating troube. Or how can I find out whats the problem with the last update?

    Read the article

  • The Software Update tool shows already installed updates

    - by Gilead
    The Software Update tool shows already installed updates. I already installed them a few times, clicking either the 'Update All' button or the indivisual 'Update' buttons. The apps are: Keynote, Numbers, Pages, Skitch, Evernote, Fotor. 'Check for unfinished downloads' reports all downloads have finished. Signing out and back in and reloading didn't help. $ sudo softwareupdate -ia Password: Software Update Tool Copyright 2002-2012 Apple Inc. Finding available software No updates are available. Googling didn't help. How can I fix the GUI tool so it updates its status? OSX 10.9.3

    Read the article

  • Windows update on netbook requires CD (hint, there's no CD drive)

    - by bwooceli
    An "Important" update for Microsoft Works (via Windows Update) on a Dell netbook gets about halfway through and then pops up with the super-awesome "Please insert Microsoft Works 9.0 disc" message. Of course, the netbook has no CD rom drive, there is no handy folder (that i can find) containing "Works9.msi", and I have no Works9 disc. It wouldn't be so bad, except the update keeps coming up everytime WU runs. Any suggestions?

    Read the article

  • Hyperlinks in Windows Update window not working?!

    - by w3d
    The actual links in the Windows Update window to open the relevant knowledge base article have stopped working. They still look like links, but they just don't do anything anymore?! This started happening (or not happening!) during the last Windows Update (around 2010-10-23). At the time I believe the first link worked OK and all subsequent links did not!? In the recent Windows Update (today) no links work. I can copy and paste the text of the link into the browser and OK. Web-like links from all other applications work OK. Dec 2010 - Windows Update links still do not work. I guess this must be something specific to my machine as I've not seen it reported anywhere else?!

    Read the article

  • Can't get SubSonic insert to work

    - by Darkwater23
    I'm trying to insert a record into a table without using the SubSonic object in a VB.Net Windows app. (It will take too long to explain why.) Dim q As New SubSonic.Query("tablename") q.QueryType = SubSonic.QueryType.Insert q.AddUpdateSetting("Description", txtDescription.Text) q.Execute() This just updates all the rows in the table. I read in one post that instead of AddUpdateSetting, I should use AddWhere, but that didn't make any sense to me. I don't need a where clause at all. Searching for all:QueryType.Insert at subsonicproject.com didn't return anything (which I thought was weird). Can anyone tell me how to fix this query? Thanks!

    Read the article

  • MySQL INSERT with table alias

    - by Max Kielland
    Hello, I happen to have two columns having the same name as two SQL reserved words, Key and Value. When using the SELECT statement I can create a table alias and solve it that way. Now I'm trying to INSERT data and it seems like you can't create table alias in the INSERT statement. INSERT INTO attributeStrings ats (ats.ItemID,ats.Key,ats.Value) VALUES (3,'Categories','TechGUI') I get error at 'ats (ats.ItemID,ats.Key,ats.Value) VALUES (3,'Categories','TechGUI')' indicating that alias can't be created. Are there any ways to solve this without renaming the columns Key and Value?

    Read the article

  • Insert rows into MySQL table while changing one value

    - by Jonathan
    Hey all- I have a MySQL table that defines values for a specific customer type. | CustomerType | Key Field 1 | Key Field 2 | Value | Each customer type has 10 values associated with it (based on the other two key fields). I am creating a new customer type (TypeB) that is exactly the same as another customer type (TypeA). I want to insert "TypeB" as the CustomerType but then just copy the values from TypeA's rows for the other three fields. Is there an SQL insert statement to make this happen? Somthing like: insert into customers(customer_type, key1, key2, value) values "TypeB" union select key1, key2, value from customers where customer_type = "TypeA" Thanks- Jonathan

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >