inside a procedure, I have defined a cursor and based on the results from cursor, i am updating another table. There are a totoal 0f 40,000 updates to the table and i would like to speed it up. I want to know if I can use multi-threading and how?
135087
SQL Server doesn't support multithreading in the way you're describing it. However, it does have a performance enhancing tuner:\n\nhttp://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/rdbmspft.mspx
246919
Yes, I think VB6 is out of date, IMHO.\n\nBut it is still used in quite a lot of legacy applications.\n\nYou just have to understand the key concepts of variables, control structures, and databases to be good at it.
514456
Hyper threading is when the processor is able to see 2 "virtual" process threads and process them sort of at the same time, but not with the power or speed of a Dual Core processor, this is found in Intel processors, I believe that HyperTransport (although im not really sure) is just AMD's version of Hyper Threading and they use it only in AMD processors.
170423
Oracle performance tuning can get rather complicated. First, you have the choice of tuning these queries from the data end or from the query end. Lets take the query end first. Using something like TOAD (http://www.toadsoft.com/) or tora (http://sourceforge.net/projects/tora/)  run an explain-plan. This will show you where the slow parts are. (you can do this from a command-line, but it is hard to read). Then you need to decide what to change in the execution to get it to go faster. Usually, things like Cartesian joins are bad (but not always). You can force the join order with hints:  /*+ use_hash(t1 t2) */ where t1 and t2 are table aliases. There is a lot more to this, let me get you a link: http://www.pafumi.net/Tips_for_Effective_Queries.html That is a pretty good discussion of the main points. You can get the different hints from your oracle manuals. From the server side, you can run heuristics, improve your indexing, make certain tables I/O type. Actually, there are huge number of things you can do, but I have historically dealt with this from the query perspective. In 8i, the database tuning is limited compared to what you can do in 9i and higher.
549455
You use limit in conjunction with 1 or 2 numbers. If you use 1 number like this:\n\nselect * from myTable limit 5;\n\nthen MySQL will grab the first 5 results from the table. However, if you use if like this:\n\nselect * from myTable limit 5,5;\n\nthen MySQL will grab 5 results, starting from record number 5. So it's\n\nlimit [startPos], [numberOfRecords]\n\nEnjoy -
475979
mysqlimport does exactly that. \n\nhttp://dev.mysql.com/doc/refman/5.0/en/mysqlimport.html
69465
I've not done shelling from SQL (we do scheduled jobs via task scheduler), but simply prefixing 'http://' will shell the browser.\n\nHowever, if what you are trying to do is get SQL to do a parameterized call to a web server, I really can't recommend this approach. A web browser needs a user context, and has a fair bit of overhead.\n\nUsing the new SQL 2005, you could write a .NET DLL that sends a WebRequest, and then register the DLL as a .NET stored procedure. Then just call the SP. You won't need a user context, and it won't do end-user style threading, it will run in-process.\n\nOtherwise, keep SQL Server out of the Http request business. It really shouldn't be doing that anyway. That's a middle tier task if I've ever seen it.
409603
This is a multi-threaded server.  Much like a web server could do.\nFor comparison, the previous slide is a single threaded server.\n\nThe loops you are interested in are act as such.\nThe server starts and waits for a connection request from a client.  (Upper right yellow box).\nNext: Someone (like you or me) starts our client application (browser) which connects to the awaiting server.  (Dotted line that enters under the upper right yellow box).\nWhen the accept(...) happens, server creates a 'socket' (not shown).  This server fork() 's off (creates) a thread (process) [center right yellow box] that accepts the socket (not shown) and uses the socket to open an input and output channel which connects to the client (not shown).  This whole thing is generally a very fast operation.  That action is done for this client, so it loops waiting for another client to connect.\n\nBack to the client.  Remember, the last thing the client did was connect to the server.  Now the client wants to make a request (write() ) to the server for information.  This is the left yellow box.  It 'requests' and the server 'read()' the request.  Processes it, write() the response back to the client which read()'s the message and does what it needs to do.\n\nThe Client yellow box, and lower Server (client server) yellow box keep repeating (that's the loops) until the client is finished with all its requests.  A good client may send a 'bye' message to the server, so it can cleanly exit.  Other times just having the client exit, drops the I/O connection to the Server thread, which recognizes that action as the client exited, and that server thread exists.\n\nHope this helps.\n=mike
476374
you can also go :\nTools-Analyze-Documenter\n\nPut this into a module and hit f5. Just a little VB to get you started, let me know if you have any questions.\n\nFunction DocumentTBL()\nDim tdef As TableDef\nDim fld As Field\nDim qry As QueryDef\nDim qryName As String\nDim IndexFields As String\nDim qdefPrimaryKeys\nDim strsql As String\nDoCmd.SetWarnings False\nOn Error Resume Next\nDoCmd.RunSQL "drop table tbltables"\nOn Error GoTo 0\nDoCmd.RunSQL "create table tbltables (ID  COUNTER CONSTRAINT PrimaryKey PRIMARY KEY,TableName text," & _\n                "FieldName text,FieldDataType text,PrimaryKey text,InQueries text,Notes text)"\nFor Each tdef In CurrentDb.TableDefs\n\n    If Left(tdef.Name, 4) = "msys" Then GoTo 1\n    If tdef.Indexes.Count > 0 Then\n        IndexFields = Replace(tdef.Indexes(0).Fields, "+", "")\n    Else\n        IndexFields = ""\n    End If\n    qryName = ""\n    For Each qry In CurrentDb.QueryDefs\n        If InStr(qry.Sql, tdef.Name) > 0 Then\n            qryName = qry.Name & ", " & qryName\n        End If\n    Next qry\n    For Each fld In tdef.Fields\n        DoCmd.RunSQL "insert into tbltables (tablename,FieldName,FieldDataType,InQueries,PrimaryKey) " & _\n                        "values (" & Chr(34) & tdef.Name & Chr(34) & "," & Chr(34) & fld.Name & _\n                        Chr(34) & ",'" & EvalControlType(fld.Type) & "'," & Chr(34) & qryName & Chr(34) & ",'" & IndexFields & "')"\n    Next fld\n1 Next tdef\nOn Error Resume Next\nDoCmd.DeleteObject acQuery, "qryPrimaryKeys"\nOn Error GoTo 0\nstrsql = "SELECT tbltables.TableName, tbltables.PrimaryKey FROM tbltables GROUP BY tbltables.TableName, tbltables.PrimaryKey "\nstrsql = strsql & "HAVING (((tbltables.TableName)<>'tbltables'));"\nSet qdefPrimaryKeys = CurrentDb.CreateQueryDef("qryPrimaryKeys", strsql)\nDoCmd.SetWarnings True\nEnd Function\n\nFunction EvalControlType(ctlType As Integer) As String\nSelect Case ctlType\n    Case acCheckBox\n        EvalControlType = "Check Box"\n    Case acComboBox\n        EvalControlType = "Combo Box"\n    Case acCommandButton\n        EvalControlType = "Button"\n    Case acImage\n        EvalControlType = "Image"\n    Case acLabel\n        EvalControlType = "Label"\n    Case acLine\n        EvalControlType = "Line"\n    Case acObjectFrame\n        EvalControlType = "Frame"\n    Case acOptionButton\n        EvalControlType = "Option Button"\n    Case acOptionGroup\n        EvalControlType = "Option Group"\n    Case acRectangle\n        EvalControlType = "Rectangle"\n    Case acSubform\n        EvalControlType = "SubForm"\n    Case acTabCtl\n        EvalControlType = "Tab Control"\n    Case acTextBox\n        EvalControlType = "Text Box"\n    Case acToggleButton\n        EvalControlType = "Toggle Button"\n    Case acListBox\n        EvalControlType = "List Box"\n    Case dbBigInt\n        EvalControlType = "Big Integer"\n    Case dbBinary\n        EvalControlType = "Binary"\n    Case dbBoolean\n        EvalControlType = "Boolean"\n    Case dbByte\n        EvalControlType = "Byte"\n    Case dbCurrency\n        EvalControlType = "Currency"\n    Case dbDate\n        EvalControlType = "Date / Time"\n    Case dbDecimal\n        EvalControlType = "Decimal"\n    Case dbDouble\n        EvalControlType = "Double"\n    Case dbFloat\n        EvalControlType = "Float"\n    Case dbGUID\n        EvalControlType = "Guid"\n    Case dbInteger\n        EvalControlType = "Integer"\n    Case dbLong\n        EvalControlType = "Long"\n
154881
In simple terms:\n\nProcesses are applications allocated in memory. Each process has atleast one thread. A thread is an instance of a process. A process can have many threads, or instances if it needs to. For example, just imagine a single program that is loaded a few times at the same time. The program is the process and for each time that the program is loaded at the same time is a thread. \n\nA handle is a resource that a thread uses. A handle could be an open file, an open registry key, a call to another thread....etc. You could have many, many handles open at one time and it is perfectly normal.
421158
#include <windows.h>\n\n// set mouse cursor to wait\nHCURSOR hOldCursor = SetCursor(LoadCursor(NULL, IDC_WAIT));\n\n// do your processing that takes some time...\n\n// restore old cursor\nSetCursor(hOldCursor);
321015
Visual FoxPro 6 offers two techniques:\n\nRemote Views which allow you to treat a back-end table as though it were a VFP table\n\nSQL Pass-through which lets you send SQL commands tobe processed on the server.\n\nWhich of these were you planning to use? There is a lot of information on both in VFP Help and on MSDN.
332321
If you have a 1 to many relationship all you need to do is select the corresponding key and then loop to insert the rest of the records into the second table. For example. \n\nuser table\nuserid as int\nuname as varchar(50)\notherdata\nother data\n\nphonenumber table\nuserid as int\nphone as varchar(16)\n\nTo insert three phone numebrs for user John Doe you so a \nselect userid from user where name = "John Doe" ;\n\nNow that you have the userid, assuming they are in an array. \nfor i = 1 to number_of_phonerecs\n   insert into phonenumber values (varuserid,varphone(i));\nnext\n\nExcuse my SQL as it's late and this is an oversimplified example.
279077
ahhh...\nyes\ni recall this from a long looooooooooong time ago\nin a galaxy far away\nwhen some stupid idiot in the Intel Corp. figured out a way to hurt your gaming capabilities and then some marketing guys called it "Hyper-Threading"!!!\nit basically is dual core but it isnt as powerful (like u cant run two games at once, which dual core can do)\n64-bit...thats AMD's technology...\nthe good thing about it is that when you run multi threaded apps (like divx or nero recode or something like quake four i think) it runs faster
149667
dim cn as adodb.connection\ncn.open "..."\n\ncn.execute "update tablename set update='" & now & "' where id='xxx' "\n\ncn.close
643801
Skip calling the stored proc and use a cursor to grab the rows directly and insert them into the second table.\n\nExample cursor:\n--------------------------\nDECLARE @col1_value VARCHAR(100)\nDECLARE @col2_value VARCHAR(100)\n\nDECLARE cc CURSOR FOR\nSELECT col1, col2\nFROM table1\n\nOPEN cc\n\nFETCH NEXT FROM cc INTO @col1_value, @col2_value\n\nWHILE @@FETCH_STATUS=0\nBEGIN\n\nINSERT INTO table2 (column1, column2)\nVALUES @col1_value, @col2_value\n\nEND\n\nCLOSE cc\nDEALLOCATE cc\n--------------------------
121455
Once a new UserConnection object has been inserted into the project, you can add new Query objects to it. These query objects can be either stored procedure calls or user-defined SQL statements. Each query object defined at design-time will automatically be available as a method of the new UserConnection class.\n\nTo add a Query object, click the leftmost button on the toolbar. The new Query object is added hierarchically below the UserConnection object, and its Properties Window appears.\n\nSelecting Stored Procedures\nSelect Insert Stored Procedure to view the available stored procedures on the database. The UserConnection designer attempts to establish a connection to the database, using the connection properties you entered. If successful, it enumerates the available stored procedures on the database, allowing you to select one to define the Query object:\n\nQuery Properties dialog box\n\n\n\nInserting User-Defined Queries\nChoose Based on User-Defined SQL to create a local query against the remote database. This enables the SQL property box, into which you enter SQL statements to define your query.\n\nAlternatively, you can click the Build button, which opens the MS-Query query design tool. MS-Query provides a visual interface that allows you to drag and drop database tables and fields, define conditions and set relationships to define the query. When you exit from MS-Query, your visually-designed query is automatically translated into SQL code and inserted into the User-Defined SQL property box.\n\nFor More Information   For more information about using the MS-Query query builder, see MSQry32.hlp which is installed in the &#92;Program Files&#92;Common Files&#92;Microsoft Shared&#92;vba directory.\n\nSetting Other Query Properties\nIn addition to the defining properties discussed above, the Query Property Page has two additional tabs for defining Parameters and advanced properties.\n\nThe Parameters tab on the query property page allows the developer to adjust properties for each parameter in the current query.\n\nParameters properties\n\n\n\nThe parameters shown in the Parameters list box are determined automatically from the query source, and cannot be changed here. Parameters are generated for each parameter marker in the SQL statement for the query (or call statement for stored procedures). Parameter markers are designated by a "?" in accordance with the ODBC specification. For example, the following query would contain two parameters:\n\nSELECT * FROM authors WHERE state = ? AND zip = ?\n\nThe parameter properties that can be changed here are the Name, Direction, ODBC Binding Data Type, and Visual Basic Data Type.\n\nThe Name property can be changed to allow your Visual Basic code to recognize the parameter by a familiar sounding name, if its actual name is complex or not intuitive.\n\nSetting the Direction of a parameter may be necessary for some ODBC databases for which the driver is not capable of determining the direction (input, input/output, or return values). The same is true for the data types, and you may wish to override the default type conversion into Visual Basic data types for use with your code.\n\nAdvanced Query Properties\nThe Advanced tab of the Query Properties page allows for fine-tuning the query by setting limits and thresholds.\n\nAdvanced properties\n\n\n\nThe Call Syntax text box lets you change the call syntax that RDO will use to call the stored procedure. This can be edited to adjust the number of parameters and presence of the return value. Editing the call syntax is an advanced operation and should only be done by developers who understand the ramifications.\n\nUsing the UserConnection Object in Your Code\nYou can insert the UserConnection object into your Visual Basic code just as you would with any class, by creating an object variable and instantiating it with a new instance of the UserConnection class you have defined. For example:\n\nOption Explicit\nPrivate MyConnect As M