Showing posts with label updated. Show all posts
Showing posts with label updated. Show all posts

Tuesday, March 20, 2012

REINDEXING?

I have a big table with more than 7583117
records. The table is updated every day during the End of the day activity.

There is a job running a query on this table for updating another table.

The table is not reindexed and the job running freezes on the EXECUTING state many times is it because of not reindexing the indexes?

Thanks in advance

Jacx

Hi Jacx,

What dou you see in SQL Server Error Log?

In the moment of this job running you monitoring the locks?

Regards,

|||

I checked the error log nothing about that particular job because it is not cancelled because of an error but it stays in the executing state.

|||When you say it "freezes" what do you mean, where are you seeing it "freeze"? Have you run the Profiler to see what is reallly going on?

How are you updating the table and selecting the records? Are you doing:

INSERT INTO XXX
SELECT ......

If so, that is probably expanding tempdb when you see it "freeze" because it writtes the entire select to tempdb and then inserts it into the target table.

Without seeing exactly how you are "updating" the table, it is hard to say what it is doing. The index being corrupt and needing reindexing is not normally a problem in MS SQL.

Saturday, February 25, 2012

Registering User changing data

Hello there
I have many tables that i would like to kbow on each record who inserted,
updated data and when it happend?
For this i've learned about function call SUSER_SNAME() that always gives me
the current user who is in the system. For insert case i've solved it
simply: added two fields:
ChangeBy with the SUSER_SNAME() function as default value
ChangeAt with the GETDATE() function as default value
This works fine for Inserting.
But what i need to do for updating: do i have to use a trigger for this?> But what i need to do for updating: do i have to use a trigger for this?
Yes, you can use a trigger. You can also use SQL Profiler for auditing -
check
http://www.sqlservercentral.com/col...ityLearning.com

Monday, February 20, 2012

register hasnt been updated

hi,
i have a programmer problem. When i exec a update sql with odbc
drivers, in database i dont update register, but if i exec the execute
sql in manager, then i update the register. Someone knwos what is
happening?
thanks for answer.AKS (dagato2@.terra.es) writes:
> i have a programmer problem. When i exec a update sql with odbc
> drivers, in database i dont update register, but if i exec the execute
> sql in manager, then i update the register. Someone knwos what is
> happening?

Eh, no. I'm not sure that I understand. Is "register" a table, or do
you mean the registry?

If you are working with code, could you supply an example?

--
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