Drop Table
Support Forum for database administrators and web based access to important newsgroups related to databasesaccording to the mysql manual, multiple inserts can be sped up by locking the table before doing them and unlocking the table afterwards. is the same true of multiple inserts in mysql? if so, how would the table be locked? any insights would be appreciated - thanks!
Post Follow-up to this messagezelnaga@gmail.com wrote: > according to the mysql manual, multiple inserts can be sped up by > locking the table before doing them and unlocking the table afterwards. > > is the same true of multiple inserts in mysql? if so, how would the > table be locked? > > any insights would be appreciated - thanks! Um, this is a newsgroup dedicated to Microsoft SQL Server. You're probably better off checking in news:comp.databases.mysql . Cheers robert
Post Follow-up to this message(zelnaga@gmail.com) writes: > according to the mysql manual, multiple inserts can be sped up by > locking the table before doing them and unlocking the table afterwards. > > is the same true of multiple inserts in mysql? if so, how would the > table be locked? > > any insights would be appreciated - thanks! In case "mysql" in the second paragraph is a type for MS SQL Server, the answer is that you cannot really lock a table as such in MS SQL Server, and definitely not unlock it. You can specify a locking hint to get a table lock when you insert the first row. Note that you need to have a user-defined transaction in progress, or else the lock will be released since statements auto-commit in SQL Server. To "unlock" you simply commit the transaction. However, normally you don't play these games for insert statments. It's better to let SQL Srever choose the locking mode. If you need to load lots of data, you use BCP (a command-line tool) or BULK INSERT (an SQL Statement). With these you can specify table lock to speed up the operation. -- Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se Books Online for SQL Server 2005 at http://www.microsoft.com/technet/pr...oads/books.mspx Books Online for SQL Server 2000 at http://www.microsoft.com/sql/prodin...ions/books.mspx
Post Follow-up to this messageRobert Klemme wrote: > zelnaga@gmail.com wrote: > > Um, this is a newsgroup dedicated to Microsoft SQL Server. You're > probably better off checking in news:comp.databases.mysql . err... sorry. I should have said mssql in the second paragraph. i'm more familiar with mysql, hence my example in the first paragraph. unfortunately, i'm not sure how to translate this to mssql, hence the second paragraph. also, why would i quote the manual of some dbms and then ask if "the same" is true of that dbms? bleh.
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread