Viewing 15 posts - 49,051 through 49,065 (of 49,552 total)
You can use a trigger to log inserts, updates and deletes. There's no way to audit selects though, not within SQL directly. Books online gives a good overview of trigger...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 28, 2006 at 1:02 am
http://www.microsoft.com/learning/mcp/default.mspx
That'll give you a good overview of what certifications are available and what exams and courses exist for each.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 27, 2006 at 2:39 am
Why do you say that? What exactly doesn't work? I've found it works in most places, missing a few irritating things (like picking up new tables, or when using 3-part...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 26, 2006 at 12:28 am
As I said, it will force the database to grow again, when data is added. This grow may occur at a busy time, slowing the database down. It will fragment your indexes, possibly...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 20, 2006 at 3:39 am
It's not considered good practice to shrink a production database.
If the database has been shrunk and new data is added then it has to grow again, probably at an...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 20, 2006 at 12:10 am
I suggeested it as al alternative to a second table, which he said wasn't really what he was looking for.
A second thought, no need to do the update, can specify...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 19, 2006 at 5:08 am
ALTER TABLE #Table
ADD Variable1 <data type>
ADD Variable2 <Data Type>
UPDATE #Table
SET Variable1 = @Var1, Variable2 = @Var2
Is that what you're looking for?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 19, 2006 at 1:21 am
Is there a question here?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 19, 2006 at 1:14 am
I would suggest you do an integrity check on your database. It looks like you might have allocation errors.
DBCC
CheckDB ('<YourDBName>') Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
We stand on the bridge and no one may pass
July 18, 2006 at 1:15 am
That's users for you.
My pleasure, good luck hunting. If you do fnd the cause, please post your solution here.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 13, 2006 at 11:02 am
It states 1 row inserted cause that's what you set @rowcount to...
SELECT @rowCount = Len(1) FROM inserted
Change that back to SELECT @rowCount = count(*) FROM inserted and the print will read...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 13, 2006 at 8:46 am
Books online doesn't say either way, from what I could see.
Try running this. The trigger gets executed once. All rows inserted are in the inserted table.
CREATE
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
We stand on the bridge and no one may pass
July 13, 2006 at 7:39 am
Why do you want to make them db_owner? Users should never be part of the do_owner role.
Create your own role, add all users to that role and grant the role...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 13, 2006 at 3:14 am
Not cursors, please. Cursors in triggers kill performance. By the looks of the trigger you should be able to change the updates to set-based.
Here's a section of your trigger...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 13, 2006 at 2:08 am
No, they run once per statement, whether it be insert, update or delete. Actions are slower because of the additional code and stuff in the trigger. A well-written trigger shouldn't...
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 12, 2006 at 8:20 am
Viewing 15 posts - 49,051 through 49,065 (of 49,552 total)