SQL 2012 :: Powershell Script To Verify Showplan Enabled For User?

May 18, 2015

I am looking for a sample PowerShell script that allows me to verify that showplan is enabled for a user on a SQL Server 2012 instance. Haven't figured out how to code it.

View 2 Replies


ADVERTISEMENT

Grant Showplan To &&<user&&>

May 22, 2006


I was trying to review some query statistics and received the following message:

SHOWPLAN permission denied in database Test
I gave the user permission by the following command:
Grant showplan to user.
I am curious as to how much perfomance does this effect? Is there an alternative?
regards

View 6 Replies View Related

SQL 2012 :: Sorting In Powershell

Aug 20, 2015

i am using powershell to get the output..I am planning implement sorting to my output.below is the format I am writing my objects to html file.I want sort the object of lastrunoutocome field.

foreach($item in $sqlServer.JobServer.Jobs)
{
Write-Host $sqlserver $item.name $item.OwnerLoginName $item.IsEnabled $item.LastRunDate $item.LastRunOutcome
writeDiskInfo $ServiceFileName $sqlServer $item.name $item.OwnerLoginName
}

View 2 Replies View Related

Verify User

Jan 1, 2008

Hi, all!
I'm really confused about how to run a query on the database to check to see the CustomerID filed value already exists in the database.
If it’s true, I want to display a message: “Valid� the user to proceed with the next steps
Else
Display the customer number doesn’t exist in the database, and cancel.
I tried all sorts of things and I just can't get it to do it. Hopefully you can help. Thank you
 

View 5 Replies View Related

SQL 2012 :: How To Insert Powershell Output Into A Table

Mar 20, 2015

I'd like to know how to get windows events script below into a SQL Server Table.

Get-WinEvent -LogName application -MaxEvents 200 | where {$_.LevelDisplayName -eq "Error"}

View 1 Replies View Related

SQL 2012 :: Named Pipes Error From PowerShell

Jun 15, 2015

1) I can connect to SQL Server 2012 named instance from SSMS.

I can launch Power shell in any of the supported data contexts, for example from the named instance.

However when I try to run a query in Power Shell, I get the named pipes error.

2)I can also provide a connection string and connect to the SQL Server Instance form Windows PowerShell after launching SQLPS, the same as in the above. I can open the connection and verify its state, but trying to run a query results in the same error.

I also see that named pipes is enabled in the SQL Server Configuration Manager.

Some of this is the result of some ambiguity in the Windows User Account in Windows 8 computer. Some of this is documented in more detail here: [URL] .....

This link is not directly related to the above problem, but arises out of the ambiguity in the Username retrieval: [URL] ....

View 0 Replies View Related

SQL 2012 :: Powershell Command To Install Specific KB

Jul 1, 2015

My system is windows 2012 core, no gui installed..I need to install missing kb through powershell. Need the powershell command to install specific KB

View 1 Replies View Related

Generating User Instances In Sql Server Is Disabled. Use Sp_configure User Instances Enabled To Generate User Instances.

Sep 28, 2007

 When I am in Visual Studio 2005, and I try to add an SQL database, I get the following error "generating user instances in sql server is disabled. use sp_configure user instances enabled to generate user instances." I am currently using SQL server 2005 Express. What do I need to do, to create an SQL database? Thanks in advance. 

View 4 Replies View Related

Integration Services :: Deploy SSIS Packages 2012 And Run Job Through Powershell

Jun 1, 2015

Any script  in ssis 2012 packages deployment  and create the jobs though power shell script.

View 3 Replies View Related

Reporting Services :: Powershell Script To Configure SSRS 2012?

Jun 12, 2015

We have 15-20 report server environments including Dev/SIT/UAT/PROD/DR etc. so instead of configuring it on each servers, we would like a script to use with parameters.

After installing the SSRS 2012 package on each server with given instance and service account, I would like to configure the SSRS through script instead on running the Configuration manager RSConfigTool.exe manually.

we already have created the database beforehand using the scripts provided by WMI. do we need db_owner permission on msdb and master database to configure SSRS?

View 2 Replies View Related

User Instance Enabled.

Jun 2, 2007

Does annybody know how I can chance de User Instance to True.

I don't mean chanching it in web.config but by the SQL Server 2005 configuration.



I try to add a database to my project but i get the following message.





Generating user instance in SQL Server is disabled. Use sp_configure 'user instance enabled' to generate user instance.



Thanks for responding.



Erich.

View 1 Replies View Related

Sp_configuration 'user Instances Enabled' - PLEASE HELP!

May 6, 2007

HiI'm having no end of problems with Visual Web Developer and SQL Server 2005 Express Edition.

View 1 Replies View Related

SQL 2012 :: Database With Filestream Enabled?

Jul 16, 2015

We have a server with a database with filestream enabled. The filestream data is in a filegroup with three files spread across 3 LUNs F:, G:, and H: each with a capacity of 1.8 TB.

The file stream containers in those three LUNs reference the same column in the same table.

The F: Drive has only 64 GB free space left. The H: However has around 700 GB free.

We are looking to move some filestream content from the container in F: to the container in H:.

View 2 Replies View Related

SQL 2012 :: Data Movement On TDE Enabled Database

Feb 13, 2015

I am aware that TDE protects data at Rest and not during communication or data in motion (UNLESS you use Encrypted communication channels using SSL certs etc). Hence I am thinking of doing data export from a TDE encrypted database to a database on the instance where TDE is not enabled or supported. I believe it works and need to take care of relationships between tables.The target database is hosted on SQL 2012 standard edition on which TDE is not supported.

View 4 Replies View Related

SQL 2012 :: Encrypting A Column On TDE Enabled Database

Sep 23, 2015

I have a database that is the publisher in transactional replication and also part of an availability group. I have put the pertinent certificates on all of the involved servers, and it is encrypted on all servers and operated as expected. However, we are adding additional security for personal data and we have targeted columns in multiple tables for column encryption. I have a master key and certificates that are stored in the master database. Following an example where I am to create the database master key:

-- Create database Key
USE encrypt_test;
GO
CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'Password123';
GO

But when I try to create a certificate on the database:

-- Create self signed certificate
USE encrypt_test;
GO
CREATE CERTIFICATE Certificate1
WITH SUBJECT = 'Protect Data';
GO

It get the following:
Msg 15151, Level 16, State 1, Line 1
Cannot find the certificate 'Certificate1', because it does not exist or you do not have permission.

Can I add a database certificate to an already TDE enabled database and if not to I create the symmetric key through the certificate located on the master database? And how will that effect decrypting the column values in stored procedures and function on the user database?

View 0 Replies View Related

SQL Server 2012 :: Script To Reorganize All Enabled Indexes

Jul 30, 2015

My index reorganise maintenance plan fails partly due to the disabled indexes

Executing the query "ALTER INDEX [I_ModelSecurityCommon_RECID] ON [dbo]...

" failed with the following error: "Cannot perform the specified operation on disabled index 'I_ModelSecurityCommon_RECID' on table 'dbo. Model SecurityCommon'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

I don't want to delete the indexes as they are standard indexes that where on the DB from install.. any script that will reorganise all enabled indexes? and also to rebuild?

View 5 Replies View Related

SQL 2012 :: Queue Activation Is Enabled But No Receive Executed

Sep 14, 2015

Our Sql server is not responding, So we restarted the server and modified one of the sp code. After that we are getting frequently every 2 min giving the below error

The queue 855365233 in database 9 has activation enabled and contains unlocked messages but no RECEIVE has been executed for 453199 seconds

View 0 Replies View Related

Data Mining :: Deleting Old Data From Adventure Works 2012 With Powershell

May 3, 2015

I am trying to delete tables from data where the ModifiedDates older than 9 years in AdventureWorks2012 database . I get console notified that foreign keys are dropped but the delete statement is throwing errors. I am sure that somewhere the key constraints are not getting altered, but i'm not able to figure it out as i'm a relative beginner to T-SQL. The error and code:

The DELETE statement conflicted with the REFERENCE constraint "FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID". The conflict
occurred in database "AdventureWorks2012", table "Sales.SalesOrderHeader
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | Out-Null
$option_drop = new-object Microsoft.SqlServer.Management.Smo.ScriptingOptions;
$option_drop.ScriptDrops = $true;

[Code] ....

View 3 Replies View Related

SQL 2012 :: Calculate TempDB Size For Read Committed Snapshot Enabled

Apr 14, 2014

I receive Error: 3967, Severity: 17, State: 1. Insufficient space in tempdb to hold row versions. We have 8 data files for temp db of 10210 GB size and given 10240 GB as max size.

As MS suggest to calculate the temp db file size and growth rate we need to monitor the perform counters Free Space in Tempdb (KB) and Version Store Size (KB) in the Transactions object.

basic formula: [Size of Version Store] = 2 * [Version store data generated per minute] * [Longest running time (minutes) of your transaction

My report disk utilizations says tempdb is full ? I thonk I need a shrink for the file .

Still I am confused in calculating the size , My perform counter gives me data as such

Free Space in tempdb (KB)               279938496
Version Generation rate (KB/s)           53681040
Version Cleanup rate (KB/s)       53422320
Version Store Size (KB)      258720
Version Store unit count        22
Version Store unit creation                      774
Version Store unit truncation         752

View 4 Replies View Related

SQL 2012 :: Cannot Truncate Table Because It Is Published For Replication Or Enabled For Change Data Capture

Jul 8, 2015

I get the following error message when a job calls a Stored Procedure that TRUNCATES a Table:

Cannot truncate table 'CombinedSurveyData' because it is published for replication or enabled for Change Data Capture

Is my only option to change the TRUNCATE to DELETE?

[URL]

View 2 Replies View Related

SQL 2012 :: Monitoring Tool Using Powershell And Performance Monitoring

Sep 15, 2014

We are in plan to build a Monitoring tool using PowerShell and Performance Monitor which could monitor 10 to 20 servers. Do you have any reference of any existing tool using Performance Monitor to monitor the SQL Server and available for free? I didn't want to put some effort, if something is available already.

View 2 Replies View Related

SQL 2012 :: Local Backup Strategy On Primary With Transaction Log Shipping Enabled To Secondary DR Site

Oct 2, 2014

I have a scenario where a customer is going to be using Log Shipping to the DR site; however, we need to maintain the normal backup strategy on the current system. (i.e. Nightly Full, Every 6 Hour Differential and Hourly Transaction Log backup)I know how to setup Transaction Log Shipping and Fail-over to DR and backup but now the local backup strategy is going to be an issue. I use the [URL] .... maintenance solution currently.

Is it even possible to do regular backups locally keeping data integrity for your backup strategy with Transaction Log Shipping enabled?

View 2 Replies View Related

Showplan Difference

Mar 9, 2001

Hi,

I have a view in a database called PS_EMPLMT_SRCH_US and it joins around five tables. I have two databases which are identical structures including data. But when run one query
ie "SELECT * FROM PS_EMPLMT_SRCH_US where EMPLID like '00918%' and OPRCLASS like 'ALLPANLS' ",
response time is totally different even though both databases have same data and same indexes. When I looked at showplan and stats time, both are totally different and order of table fetch is totally different. Is there any idea why this difference? Any help would be appreciated.



Here is the show plan info:
-------------------------------------------------------------------
GOOD Performance Query and plan
-------------------------------------------------------------------

SELECT * FROM PS_EMPLMT_SRCH_US where EMPLID like '00918%' and OPRCLASS like 'ALLPANLS'



SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.
SQL Server parse and compile time:
CPU time = 156 ms, elapsed time = 156 ms.

Table 'PS_SCRTY_TBL_DEPT'. Scan count 2, logical reads 4, physical reads 0, read-ahead reads 0.
Table 'PSTREENODE'. Scan count 13, logical reads 26, physical reads 0, read-ahead reads 0.
Table 'PS_JOB'. Scan count 29, logical reads 87, physical reads 0, read-ahead reads 0.
Table 'PS_NID_TYPE_TBL'. Scan count 1, logical reads 2, physical reads 0, read-ahead reads 0.
Table 'PS_PERS_NID'. Scan count 1, logical reads 2, physical reads 0, read-ahead reads 0.
Table 'PS_PERSONAL_DATA'. Scan count 1, logical reads 3, physical reads 0, read-ahead reads 0.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 5 ms.
SQL Server parse and compile time:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

PLAN:
|--Nested Loops(Left Semi Join)
|--Nested Loops(Inner Join)
| |--Nested Loops(Inner Join)
| | |--Nested Loops(Inner Join)
| | | |--Filter(WHERE:([PS_JOB].[EFFSEQ]=[Expr1016]))
| | | | |--Nested Loops(Inner Join)
| | | | |--Filter(WHERE:([PS_JOB].[EFFDT]=[Expr1012]))
| | | | | |--Nested Loops(Inner Join)
| | | | | |--Nested Loops(Inner Join)
| | | | | | |--Index Seek(OBJECT:([HRNEW].[dbo].[PS_PERSONAL_DATA].[PS#PERSONAL_DATA]), SEEK:([PS_PERSONAL_DATA].[EMPLID] >= '00918' AND [PS_PERSONAL_DATA].[EMPLID] < '00919') ORDERED)
| | | | | | |--Index Seek(OBJECT:([HRNEW].[dbo].[PS_JOB].[PS#JOB]), SEEK:([PS_JOB].[EMPLID]=[PS_PERSONAL_DATA].[EMPLID]) ORDERED)
| | | | | |--Table Spool
| | | | | |--Stream Aggregate(DEFINE:([Expr1012]=MAX([PS_JOB].[EFFDT])))
| | | | | |--Top(1)
| | | | | |--Index Seek(OBJECT:([HRNEW].[dbo].[PS_JOB].[PSAJOB]), SEEK:([PS_JOB].[EMPLID]=[PS_JOB].[EMPLID] AND [PS_JOB].[EMPL_RCD#]=[PS_JOB].[EMPL_RCD#] AND [PS_JOB].[EFFDT] <= Convert(Convert(getdate()))) OR
| | | | |--Table Spool
| | | | |--Stream Aggregate(DEFINE:([Expr1016]=MAX([PS_JOB].[EFFSEQ])))
| | | | |--Index Seek(OBJECT:([HRNEW].[dbo].[PS_JOB].[PSAJOB]), SEEK:([PS_JOB].[EMPLID]=[PS_JOB].[EMPLID] AND [PS_JOB].[EMPL_RCD#]=[PS_JOB].[EMPL_RCD#] AND [PS_JOB].[EFFDT]=[PS_JOB].[EFFDT]) ORDERED)
| | | |--Clustered Index Seek(OBJECT:([HRNEW].[dbo].[PS_PERS_NID].[PS_PERS_NID]), SEEK:([PS_PERS_NID].[EMPLID]=[PS_JOB].[EMPLID]) ORDERED)
| | |--Clustered Index Seek(OBJECT:([HRNEW].[dbo].[PS_NID_TYPE_TBL].[PS_NID_TYPE_TBL]), SEEK:([PS_NID_TYPE_TBL].[COUNTRY]=[PS_PERS_NID].[COUNTRY] AND [PS_NID_TYPE_TBL].[NATIONAL_ID_TYPE]=[PS_PERS_NID].[NATIONAL_ID_TYPE]) ORDERED)
| |--Filter(WHERE:(like([PS_SCRTY_TBL_DEPT].[OPRID], 'ALLPANLS')))
| |--Clustered Index Seek(OBJECT:([HRNEW].[dbo].[PS_SCRTY_TBL_DEPT].[PS_SCRTY_TBL_DEPT]), SEEK:([PS_SCRTY_TBL_DEPT].[OPRID] BETWEEN 'ALLPANLS' AND 'ALLPANLS') ORDERED)
|--Row Count Spool
|--Filter(WHERE:([PS_JOB].[EFFDT]>=Convert(Convert(getdate())) OR (([PS_SCRTY_TBL_DEPT].[ACCESS_CD]='Y' AND [PS_JOB].[EFFDT]=[Expr1022]) AND [Expr1031])))
|--Nested Loops(Left Semi Join, WHERE:([PS_JOB].[EFFDT]>=Convert(Convert(getdate()))))
|--Nested Loops(Inner Join, WHERE:([PS_JOB].[EFFDT]>=Convert(Convert(getdate()))))
| |--Clustered Index Seek(OBJECT:([HRNEW].[dbo].[PS_JOB].[PS_JOB]), SEEK:([PS_JOB].[EMPLID]=[PS_JOB].[EMPLID]) ORDERED)
| |--Table Spool
| |--Stream Aggregate(DEFINE:([Expr1022]=MAX([PS_JOB].[EFFDT])))
| |--Index Seek(OBJECT:([HRNEW].[dbo].[PS_JOB].[PSAJOB]), SEEK:([PS_JOB].[EMPLID]=[PS_JOB].[EMPLID] AND [PS_JOB].[EMPL_RCD#]=[PS_JOB].[EMPL_RCD#] AND [PS_JOB].[EFFDT] <= Convert(Convert(getdate()))) ORDERED)
|--Row Count Spool
|--Nested Loops(Left Anti Semi Join, WHERE:([PSTREENODE].[TREE_NODE_NUM]>=[PS_SCRTY_TBL_DEPT].[TREE_NODE_NUM] AND [PSTREENODE].[TREE_NODE_NUM]<=[PS_SCRTY_TBL_DEPT].[TREE_NODE_NUM_END]))
|--Index Seek(OBJECT:([HRNEW].[dbo].[PSTREENODE].[PSCPSTREENODE]), SEEK:([PSTREENODE].[TREE_NODE]=[PS_JOB].[DEPTID] AND [PSTREENODE].[SETID]=[PS_SCRTY_TBL_DEPT].[SETID] AND [PSTREENODE].[TREE_NAME]='DEPT_SECURITY' AND [PSTRE
|--Filter(WHERE:([PS_SCRTY_TBL_DEPT].[TREE_NODE_NUM]<[PS_SCRTY_TBL_DEPT].[TREE_NODE_NUM] OR [PS_SCRTY_TBL_DEPT].[TREE_NODE_NUM]>[PS_SCRTY_TBL_DEPT].[TREE_NODE_NUM]))
|--Index Seek(OBJECT:([HRNEW].[dbo].[PS_SCRTY_TBL_DEPT].[PSASCRTY_TBL_DEPT]), SEEK:([PS_SCRTY_TBL_DEPT].[OPRID]=[PS_SCRTY_TBL_DEPT].[OPRID] AND [PS_SCRTY_TBL_DEPT].[TREE_NODE_NUM] BETWEEN [PS_SCRTY_TBL_DEPT].[TREE_NODE_



-----------------------------------------------------------------------------

BAD Performance Query and plan
-------------------------------------------------------------------------


SELECT * FROM PS_EMPLMT_SRCH_US where EMPLID like '00918%' and OPRCLASS like 'ALLPANLS'


SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.
SQL Server parse and compile time:
CPU time = 0 ms, elapsed time = 0 ms.

Table 'PS_JOB'. Scan count 168595, logical reads 515067, physical reads 0, read-ahead reads 0.
Table 'PS_PERSONAL_DATA'. Scan count 1, logical reads 3, physical reads 0, read-ahead reads 0.
Table 'PS_PERS_NID'. Scan count 1, logical reads 3, physical reads 0, read-ahead reads 0.
Table 'PS_NID_TYPE_TBL'. Scan count 1, logical reads 3, physical reads 0, read-ahead reads 0.
Table 'PS_SCRTY_TBL_DEPT'. Scan count 2, logical reads 4, physical reads 0, read-ahead reads 0.
Table 'PSTREENODE'. Scan count 1, logical reads 2, physical reads 0, read-ahead reads 0.

SQL Server Execution Times:
CPU time = 15797 ms, elapsed time = 4500 ms.
SQL Server parse and compile time:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.




|--Nested Loops(Left Semi Join)
|--Nested Loops(Inner Join, WHERE:([PS_JOB].[SETID_DEPT]=[PS_SCRTY_TBL_DEPT].[SETID]))
| |--Parallelism(Gather Streams)
| | |--Hash Match(Inner Join, HASH:([PS_PERS_NID].[EMPLID])=([PS_JOB].[EMPLID]), RESIDUAL:([PS_JOB].[EMPLID]=[PS_PERS_NID].[EMPLID]))
| | |--Parallelism(Distribute Streams, PARTITION COLUMNS:([PS_PERSONAL_DATA].[EMPLID]))
| | | |--Nested Loops(Inner Join)
| | | |--Nested Loops(Inner Join)
| | | | |--Index Seek(OBJECT:([HRTEST].[dbo].[PS_PERSONAL_DATA].[PS#PERSONAL_DATA]), SEEK:([PS_PERSONAL_DATA].[EMPLID] >= '00918' AND [PS_PERSONAL_DATA].[EMPLID] < '00919') ORDERED)
| | | | |--Clustered Index Seek(OBJECT:([HRTEST].[dbo].[PS_PERS_NID].[PS_PERS_NID]), SEEK:([PS_PERS_NID].[EMPLID]=[PS_PERSONAL_DATA].[EMPLID]) ORDERED)
| | | |--Clustered Index Seek(OBJECT:([HRTEST].[dbo].[PS_NID_TYPE_TBL].[PS_NID_TYPE_TBL]), SEEK:([PS_NID_TYPE_TBL].[COUNTRY]=[PS_PERS_NID].[COUNTRY] AND [PS_NID_TYPE_TBL].[NATIONAL_ID_TYPE]=[PS_PERS_NID].[NATIONAL_ID_TYPE]) ORDERE
| | |--Filter(WHERE:([PS_JOB].[EFFDT]>=Convert(Convert(getdate())) OR ([PS_JOB].[EFFDT]=[Expr1018] AND [PS_JOB].[EFFSEQ]=[Expr1022])))
| | |--Parallelism(Repartition Streams, PARTITION COLUMNS:([PS_JOB].[EMPLID]))
| | |--Nested Loops(Inner Join, WHERE:([PS_JOB].[EFFDT]>=Convert(Convert(getdate()))))
| | |--Parallelism(Repartition Streams, PARTITION COLUMNS:([PS_JOB].[EMPLID], [PS_JOB].[EFFDT], [PS_JOB].[EMPL_RCD#]), ORDER BY:([PS_JOB].[EFFDT] ASC, [PS_JOB].[EMPL_RCD#] ASC, [PS_JOB].[EMPLID] ASC))
| | | |--Nested Loops(Inner Join, WHERE:([PS_JOB].[EFFDT]>=Convert(Convert(getdate()))))
| | | |--Sort(ORDER BY:([PS_JOB].[EFFDT] ASC, [PS_JOB].[EMPL_RCD#] ASC, [PS_JOB].[EMPLID] ASC))
| | | | |--Clustered Index Scan(OBJECT:([HRTEST].[dbo].[PS_JOB].[PS_JOB]))
| | | |--Table Spool
| | | |--Stream Aggregate(DEFINE:([Expr1018]=MAX([PS_JOB].[EFFDT])))
| | | |--Index Seek(OBJECT:([HRTEST].[dbo].[PS_JOB].[PSAJOB]), SEEK:([PS_JOB].[EMPLID]=[PS_JOB].[EMPLID] AND [PS_JOB].[EMPL_RCD#]=[PS_JOB].[EMPL_RCD#] AND [PS_JOB].[EFFDT] <= Convert(Convert(getdate()))) O
| | |--Table Spool
| | |--Stream Aggregate(DEFINE:([Expr1022]=MAX([PS_JOB].[EFFSEQ])))
| | |--Index Seek(OBJECT:([HRTEST].[dbo].[PS_JOB].[PSAJOB]), SEEK:([PS_JOB].[EMPLID]=[PS_JOB].[EMPLID] AND [PS_JOB].[EMPL_RCD#]=[PS_JOB].[EMPL_RCD#] AND [PS_JOB].[EFFDT]=[PS_JOB].[EFFDT]) ORDERED)
| |--Filter(WHERE:(like([PS_SCRTY_TBL_DEPT].[OPRID], 'ALLPANLS')))
| |--Index Seek(OBJECT:([HRTEST].[dbo].[PS_SCRTY_TBL_DEPT].[PSBSCRTY_TBL_DEPT]), SEEK:([PS_SCRTY_TBL_DEPT].[ACCESS_CD]='Y' AND [PS_SCRTY_TBL_DEPT].[OPRID] BETWEEN 'ALLPANLS' AND 'ALLPANLS') ORDERED)
|--Row Count Spool
|--Nested Loops(Left Anti Semi Join)
|--Index Seek(OBJECT:([HRTEST].[dbo].[PSTREENODE].[PSCPSTREENODE]), SEEK:([PSTREENODE].[TREE_NODE]=[PS_JOB].[DEPTID] AND [PSTREENODE].[SETID]=[PS_SCRTY_TBL_DEPT].[SETID] AND [PSTREENODE].[TREE_NAME]='DEPT_SECURITY' AND [PSTREENODE].[EFFDT]
|--Filter(WHERE:([PS_SCRTY_TBL_DEPT].[TREE_NODE_NUM]<>[PS_SCRTY_TBL_DEPT].[TREE_NODE_NUM]))
|--Index Seek(OBJECT:([HRTEST].[dbo].[PS_SCRTY_TBL_DEPT].[PSASCRTY_TBL_DEPT]), SEEK:([PS_SCRTY_TBL_DEPT].[OPRID]=[PS_SCRTY_TBL_DEPT].[OPRID] AND ([PS_SCRTY_TBL_DEPT].[TREE_NODE_NUM], [PS_SCRTY_TBL_DEPT].[TREE_NODE_NUM_END], [PS_SCRTY_

View 1 Replies View Related

SHOWPLAN Permission

May 5, 2008

Hi

How can I provide SHOWPLAN permission.

Regards,
Reddy

View 4 Replies View Related

SHOWPLAN Through ODBC

Feb 29, 2008

I´m wriing a small perl script that connects to SQL Server through ODBC, using DBI and DBD-ODBC modules.

I can get data from a query, but I cannot get the execution plan for it... instead, I got "[Microsoft][ODBC Driver Manager] Function sequence error".

Using Profiler, I can see both "set showplan_xml on" and my query as "SQL BatchCompleted" events on target database. The same happens when I use "set showplan_text on".

Is it possible to get an execution plan through ODBC?

Thanks!!!

++Vitoco

View 2 Replies View Related

SHOWPLAN Through ODBC

Feb 29, 2008

I´m writing a small perl script that connects to SQL Server through ODBC, using DBI and DBD-ODBC modules.

I can get data from a query, but I cannot get the execution plan for it... instead, I got "[Microsoft][ODBC Driver Manager] Function sequence error".

Using Profiler, I can see both "set showplan_xml on" and my query as "SQL BatchCompleted" events on target database. The same happens when I use "set showplan_text on".

Is it possible to get an execution plan through ODBC?

Thanks!!!

++Vitoco

View 5 Replies View Related

SQL Server 2012 :: Query To Find User Who Last Modified User Roles / Access?

Dec 6, 2013

I would like to know if there is a way to find out who changed a users roles/access WITHOUT using the audit function. For example, if a user account was created and given SA access then changed to read only, how can I find out who made that change? I tried searching for an answer, but kept getting no results. I'm thinking this may tie into the sys.sysusers view?

View 3 Replies View Related

SQL 2012 :: How To Grant A New User Same Direct Privilege To Tables As Existing User

Feb 18, 2014

I am relatively new to sql developer. There is a new user that just joined our organization. I am trying to grant him the same direct grants privilege to the tables that an existing user has. The existing user has a ton of direct table access privileges and it will take days if I had to do each grant one by one like: grant select,insert,delete,update on 'table name' to 'user id'. Is there a way of copying or inserting an existing user's privilege and granting it to a new user.

View 2 Replies View Related

SQL 2012 :: Moving SSIS Solution To Another User - Reset User Encryption Key

Oct 22, 2014

I have an SSIS package built by another developer, and now that I'm running it under my login the passwords won't save. The solution and packages are setup with ProtectionLevel EncryptSensitiveWithUserKey, but how do I get the User Key to reset so I can now save passwords? I can re-enter them, but whenever I enter hte password and test it then click OK it still has the red arrow next to the connection as if there's an error. I can create new connections and those passwords save fine, but with 40-50 items in this package I hate the thought of having to go into each and change the connection.

I tried changing the package and solution to DontSaveSensitive then rebuilding and closing then reopening, I hoped there was some option to reset the User Key just as if I created the solution. If this option doesn't exist why?

View 1 Replies View Related

Powershell Sql Server Performance

Mar 31, 2008

Hi,
I am trying to get performance data using powershell. When I run the command "get-wmiobject -list" I get classes like
Win32_PerfRawData_MSSQLSQLEXPRESS1_MSSQLSQLEXPRESS1Locks. However when I run the command

get-wmiobject -query "select * from Win32_PerfRawData_MSSQLSQLEXPRESS1_MSSQLSQLEXPRESS1Locks" powershell gives me an error. Why is this happening? any help in this regard is appreciated.

Regards
Sourashis

View 2 Replies View Related

Replication :: Powershell Not Scripting All Options Specified

Oct 2, 2015

I would get from scripting the replication out from SQL Server itself. However, there are a couple of things that are not showing up in the script,Adding the option to IncludeUninstallDistributor or UninstallDistributor doesn't appear to add any code to actually do that. i.e. the below code is never added.

/****** Uninstalling the server as a Distributor. Script Date: 10/1/2015 4:34:13 PM ******/
use master
exec sp_dropdistributor @no_checks = 1, @ignore_distributor = 1
GO
Also, adding the reverse for the create script generation, IncludeInstallDistributor or InstallDistributor, does not add the below code.
use master
exec sp_adddistributor @distributor = N'xxxxxx', @password = N''
GO

The purpose of the script is simply to script out all drop/create scripts for all publications and subscriptions, run the drop script, restore over the databases using backups of non-replicated databases, run the create replication script, and have it re-sync.

param ([Parameter(Position=0, Mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $Publisher,
[Parameter(Position=1, Mandatory=$true)] [ValidateNotNullOrEmpty()] [string] $Directory,
[Parameter(Position=2, Mandatory=$false)] [switch] $Create = $true,
[Parameter(Position=3, Mandatory=$false)] [switch] $Drop)

[code]....

View 2 Replies View Related

SQL Server 2014 :: Using Powershell Commands Within Scripts

Mar 15, 2015

I would like to use powershell commands within my TSQL scripts. how to do that?

The reason is that up until now I have been using SQLCMD and XP_CMDSHELL to rename files before importing them into a database. Powershell is a better tool for this job.

View 9 Replies View Related

SQL Server 2008 :: Create A Table Using Powershell

Apr 28, 2015

I'm trying to create a table using powershell..following is my syntax

$conn = New-Object System.Data.SqlClient.SqlConnection("Data Source=.sqlexpress; Initial Catalog=testdata1; Integrated Security=SSPI")
$conn.Open()
$db= $srv.Databases.Item("TestData1")
$tb = new-object Microsoft.SqlServer.Management.Smo.Table($db, "companytable")
$col1 = new-object Microsoft.SqlServer.Management.Smo.Column($tb,"CompanyName", [Microsoft.SqlServer.Management.Smo.DataType]::NChar(50))

[code]...

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved