Viewing 15 posts - 16 through 30 (of 40 total)
Sorry, after i re-read my post I realized it wasn't very clear.
The Stored Procedure would need WITH EXECUTE AS SOME_USER where SOME_USER has the necessary level of access to...
June 20, 2013 at 7:17 am
You could create a stored procedure that executes the specific job with sp_start_job. If you add 'WITH EXECUTE AS YOUR_JOB_OWNER' to the stored procedure then the users will not need...
June 18, 2013 at 8:25 am
SQLCrazyCertified (6/17/2013)
Thanks, J Good.
Is this script good for SQL 2005?
I am getting the error when I run on 2005...but it worked on 2008 and above.
Msg 208, Level 16, State 1,...
June 18, 2013 at 7:10 am
Times are in microseconds.
SELECT TOP (250) p.NAME AS [SP Name]
,qs.execution_count
,ISNULL(qs.execution_count / DATEDIFF(Second, qs.cached_time, GETDATE()), 0) AS [Calls/Second]
,qs.total_worker_time / qs.execution_count AS [AvgWorkerTime]
,qs.total_worker_time AS [TotalWorkerTime]
,qs.total_elapsed_time
,qs.total_elapsed_time / qs.execution_count AS [avg_elapsed_time]
,qs.cached_time
FROM sys.procedures AS p...
June 17, 2013 at 3:30 pm
Sounds like some try...catch error handling might do the trick.
Check out this link:
June 11, 2013 at 8:43 am
Sean Lange (6/10/2013)
Well technically speaking a table with no defined indexes has an index with a type of "HEAP" which is why your script will still work.
You are correct. Thanks...
June 10, 2013 at 12:40 pm
SQL_Kills (6/10/2013)
What if the table does not have a index or primary key? I take it the above sql will only work if it has this?
Yes, the above query will...
June 10, 2013 at 11:42 am
This script will look at sys.dm_db_index_usage_stats to determine the last reads/writes that occurred on a table; however, this DMV is reset when SQL is restarted, so be aware of that.
WITH...
June 10, 2013 at 10:02 am
You can schedule a job that runs Monday morning at a certain time and runs the following:
You can use this query to get a list of the currently executing job...
June 5, 2013 at 8:42 am
This script has always done the trick for me. It scripts out DB users, roles, object level permissions, and schema level permissions. It works on 2005 and 2008R2, but have...
June 5, 2013 at 7:58 am
Paul Randal had a good, quick article on this for SQLMag...
http://sqlmag.com/blog/rebalancing-data-across-files-filegroup
June 4, 2013 at 10:17 am
You can always wrap your statement inside of a BEGIN TRAN and ROLLBACK and check sys.dm_tran_locks to see what locks it will take.
I ran a quick test using this example...
May 31, 2013 at 12:48 pm
You can grant select access to only the sysjobschedules table like this:
--Create user on msdb for a server login 'testUSER'
--This is assuming you already have the testUSER login created on...
May 31, 2013 at 9:48 am
I believe Redgate has a product called SQL Doc that is supposed to be pretty good.
There are also a ton of T-SQL scripts out there that can help you do...
May 31, 2013 at 9:24 am
I wouldn't look at the Date Modified of the .mdf or .ndf files.
You might try something like this that will show you when the tables in the database were last...
December 19, 2012 at 3:27 pm
Viewing 15 posts - 16 through 30 (of 40 total)