Tag Info

New answers tagged

2

Personally I would try using ORIGINAL_LOGIN() instead of USER_NAME(). USER_NAME() returns the database principal or user associated with your login in the database you are connecting to. In this case you are probably connecting to master in both cases. If LinkedServerUser doesn't have a specific login in master on SERVER2 then you will see GUEST. If on ...


0

There are DMVs which will allow you to unravel the call stack from any given stored procedure, using a recursive CTE. Then there are ways to pull the text for each stored procedure, should you need to have that. There are programatic ways to parse SQL if you want to extract the statement (SELECT, INSERT) and the table names, which you likely will if you're ...


0

Instead of manually reviewing the definitions of the stored procedures I have (with some success) used a dependency tracker like redgate SQL Dependency Tracker. It can help resolving external object used in the procedures.


2

The only way you'll be able to do this consistently and correctly is by looking at what each job does, and cross-referencing that with the msdn articles for each command on your given version. For example, DBCC SHOW_STATISTICS has a section: Permissions In order to view the statistics object, the user must own the table or the user must be a ...


3

On a case insensitive server, those two names are identical. I am not sure if you are using the UI for this, but I get the same error when I run the following code: USE msdb; GO EXEC dbo.sp_add_operator @name = N'NIT and Arts'; GO EXEC dbo.sp_update_operator @name = N'NIT and Arts', @new_name = N'NIT and ARTS'; Yields: Msg 14261, Level 16, State 1, ...


2

Replace A-SVR with SRVR. A-SVR is for alerts. SRVR will contain server name and instance name. Refer to document on MSDN.


0

To Get Currently running jobs and their Status --- Script By: Amna Asif___________________For: sqlcache.blogspot.com --- Purpose: Currently running jobs and their Status SELECT jb.name, jb.originating_server ServerName, ja.run_requested_date JobStartTime, DATEDIFF(MINUTE, ja.run_requested_date, ...



Top 50 recent answers are included