![]() |
|
|
#1 | |
|
Архивный участник
Join Date: Feb 2005
Posts: 307
|
The warning message cache spams when a user without time data logs in:
Quote:
I wrote this in about 2 minutes and didnt bother to make it quick to run, because you only need to do it once. It takes about 5 minutes on SQL 2000 and 15 seconds on 2005. Code:
Declare @acc int Set @acc = 0 WHILE(@acc < 150000) BEGIN INSERT lin2world.dbo.time_data (account_id, last_logout, used_sec) VALUES (@acc, '1/1/2004 1:00:00 AM', '0') Set @acc = @acc + 1 END Edit: This should leave current time data which already exists in tact, SQL errors and continues when a duplicate row is detected in INSERT. |
|
|
|
|
|
#2 |
|
Архивный участник
Join Date: Mar 2005
Posts: 475
|
cool if it works. yea.
|
|
|
|
|
#3 |
|
Архивный участник
Join Date: Jan 2006
Posts: 73
|
How it to put?
|
|
|
|
|
#4 |
|
Архивный участник
Join Date: Feb 2005
Posts: 307
|
Run it in Query Analyzer (2000) or just a new query in management studio (2005).
|
|
|
|
|
#5 |
|
Архивный участник
Join Date: Jan 2006
Posts: 73
|
Simply to execute SQL inquiry
Or it needs to be executed on lin2db or lin2world? |
|
|
|
|
#6 |
|
Архивный участник
Join Date: Feb 2005
Posts: 307
|
I specified the Db object in the script itself, so you don't have to set a target, but if you really want to target Lin2World.
|
|
|
|
|
#7 |
|
Архивный участник
Join Date: Jun 2005
Posts: 242
|
this is PROCEDURES? if YES, to what prosedres copy??
|
|
|
|
|
#8 |
|
Архивный участник
Join Date: Feb 2005
Posts: 307
|
Just run it once, easy as that.
|
|
|
|
|
#9 |
|
Архивный участник
Join Date: Jun 2005
Posts: 242
|
so this there will be one time, and it is necessary automatically
|
|
|
|
|
#10 |
|
Архивный участник
Join Date: Sep 2005
Posts: 220
|
works great, thnx author zzhhooshh
|
|
|
|
|
#11 |
|
Архивный участник
Join Date: Feb 2005
Posts: 307
|
Unless you end up with over 150,000 accounts, yeah, just need it once.
|
|
|
|
|
#12 |
|
Архивный участник
Join Date: Feb 2006
Posts: 88
|
why don't u add a single insert statement to account creation scripts?
filling 150k lines into the db is . . . not really useful |
|
|
|
|
#13 |
|
Архивный участник
Join Date: Feb 2005
Posts: 307
|
It would produce the same thing either way, this is a fix for a current issue, putting an insert line in the account creation script will only help for newly created accounts. Let alone that creating 150k rows assures the problem is solved for that number of accounts, which not many servers achieve anyways.
|
|
|
|
|
#14 |
|
Архивный участник
Join Date: Jan 2006
Posts: 73
|
How to correct these mistakes?
http://img240.imageshack.us/img240/3487/err3hf.jpg |
|
|
|
|
#15 |
|
Архивный участник
Join Date: Feb 2005
Posts: 307
|
Get a faster machine / database server? Optimize your database and data? That isn't an error, it's a warning message telling you that the query it ran took longer than your set max sql execution time. If you don't like them you can raise the value of that setting in cache's ini.
13 seconds for an item amount change? You should really consider upgrading or having a look into that issue. |
|
|
|
|
#16 |
|
Архивный участник
Join Date: Feb 2006
Posts: 88
|
try this, it will insert missing lines into lin2world for all accounts that are defined in lin2db (maybe u have to change the script to fit your db structure)
[php:1:72ff948c5c]. INSERT INTO lin2world.dbo.time_data SELECT a.uid, '2004-01-01', 0 FROM lin2db.dbo.user_account a LEFT OUTER JOIN time_data t ON a.uid = t.account_id WHERE (t.account_id IS NULL) [/php:1:72ff948c5c] |
|
|
|
|
#17 |
|
Архивный участник
Join Date: Feb 2005
Posts: 307
|
Generally the accounts are in numericial order, so the original post is the simplest way to do it, but yeah thanks for the feedback.
|
|
|
|
|
#18 |
|
Архивный участник
Join Date: Feb 2006
Posts: 88
|
There are entries in this table,
because the server safes the lastlogout date and total playtime in this table. Why generating so much errors? ![]() Filling only nescessary lines is exactly the same like an huge bulk insert? ok... |
|
|
|
|
#19 |
|
Архивный участник
Join Date: Feb 2005
Posts: 307
|
[][][]
|
|
|
|
|
#20 |
|
Архивный участник
Join Date: Feb 2006
Posts: 88
|
so u prefer to fix a bug with creating a lot of useless data?
instead fixing the root of the bug itself? btw - yes, I know what my script is doing and yes... your script CAN'T overwrite data... but it spits out a huge amount of error messages |
|
|
|
|
#21 |
|
Архивный участник
Join Date: Jun 2006
Posts: 163
|
after i putted this On my DB... it f****ed UP all my server... when it shows me the message [Account.cpp] etc. i get disconnect....
![]() and sometimes..... all server crashes.... or it crash`es before loading the NPC`s... damn! someone knows how to fix it? |
|
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|