<?xml version="1.0" encoding="UTF-8"?>
<!--Generated by Squarespace Site Server v5.11.0 (http://www.squarespace.com/) on Thu, 29 Jul 2010 12:34:15 GMT--><feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"><title>Jeff Jones Blog</title><subtitle>Jeff Jones Blog</subtitle><id>http://blogs.interfacett.com/jeff-jones-blog/</id><link rel="alternate" type="application/xhtml+xml" href="http://blogs.interfacett.com/jeff-jones-blog/"/><link rel="self" type="application/atom+xml" href="http://blogs.interfacett.com/jeff-jones-blog/atom.xml"/><updated>2010-07-21T00:00:44Z</updated><generator uri="http://www.squarespace.com/" version="Squarespace Site Server v5.11.0 (http://www.squarespace.com/)">Squarespace</generator><entry><title>Links to SQL Server User Group Community in Phoenix</title><id>http://blogs.interfacett.com/jeff-jones-blog/2010/7/15/links-to-sql-server-user-group-community-in-phoenix.html</id><link rel="alternate" type="text/html" href="http://blogs.interfacett.com/jeff-jones-blog/2010/7/15/links-to-sql-server-user-group-community-in-phoenix.html"/><author><name>Jeff Jones</name></author><published>2010-07-15T15:24:29Z</published><updated>2010-07-15T15:24:29Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p>Here are a couple of links to the Arizona SQL Server User Group community.&nbsp; The first is the Arizona SQL Server User Group.&nbsp; It usually meets each month except during the summer.&nbsp;</p>
<p>The second is a link to SQL Saturday.&nbsp; A group of SQL Server users are attempting to organize a SQL Saturday event.&nbsp; Check out this link to get the latest status.</p>
<p>Arizona SQL Server User Group:&nbsp; <a href="http://arizona.sqlpass.org">http://arizona.sqlpass.org</a></p>
<p>SQL Saturday Phoenix - <a href="http://www.sqlsaturday.com/47/eventhome.aspx">http://www.sqlsaturday.com/47/eventhome.aspx</a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content></entry><entry><title>SQL Server 2008 Policy Management Links</title><category term="Policy"/><category term="SQL Serrver 2008"/><id>http://blogs.interfacett.com/jeff-jones-blog/2010/5/25/sql-server-2008-policy-management-links.html</id><link rel="alternate" type="text/html" href="http://blogs.interfacett.com/jeff-jones-blog/2010/5/25/sql-server-2008-policy-management-links.html"/><author><name>Jeff Jones</name></author><published>2010-05-25T15:36:24Z</published><updated>2010-05-25T15:36:24Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p>Here are few links to blogs and open source projects related to Policy Management with SQL Server 2008.</p>
<p>The SQL Server Policy Management Team blog - <a href="http://blogs.msdn.com/sqlpbm">http://blogs.msdn.com/sqlpbm</a></p>
<p>Bar Duncan's blog entry on Complex Server "Health" Policies - <a href="http://shrinkster.com/1bqq">http://shrinkster.com/1bqq</a></p>
<p>Codeplex project to provide a dashboard for Policy Management - <a href="http://epmframework.codeplex.com">http://epmframework.codeplex.com</a></p>
<p>&nbsp;</p>]]></content></entry><entry><title>Extracting SSIS Package information using T-SQL</title><category term="SSIS"/><category term="XQuery"/><id>http://blogs.interfacett.com/jeff-jones-blog/2010/5/19/extracting-ssis-package-information-using-t-sql.html</id><link rel="alternate" type="text/html" href="http://blogs.interfacett.com/jeff-jones-blog/2010/5/19/extracting-ssis-package-information-using-t-sql.html"/><author><name>Jeff Jones</name></author><published>2010-05-19T23:59:54Z</published><updated>2010-05-19T23:59:54Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p>SQL Server Integration Services can store it packages in either the file system or the MSDB system database.&nbsp; One of the advantages of storing a package in MSDB is that you can use T-SQL to read the package definition and generate reports on your SSIS package library.&nbsp;</p>
<p>Here are a couple of example queries to extract the package GUID for each package and to display the connection string for each OLEDB connection manager in a package.&nbsp;</p>
<p><strong>Example 1: Package GUID display</strong></p>
<p>USE MSDB<br />GO<br />WITH xmlPackages <br />-- Read sysssispackage and convert packagedata image column to XML datatype<br />AS<br />(SELECT [name]<br />, [Description]<br />, verbuild <br />, CAST(CAST(packagedata as VARBINARY(MAX)) AS XML) PackageXML<br />FROM dbo.sysssispackages)<br />,<br />Packages&nbsp;&nbsp;&nbsp;&nbsp;<br />-- Cross join each package row with itself to extract out the GUID then it to VARCHAR</p>
<p>AS<br />(SELECT [name] <br />, [Description]<br />, [verbuild]<br />, x.guid.value('text()[1]', 'varchar(4000)') PackageGUID<br />FROM xmlPackages <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CROSS APPLY <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PackageXML.nodes('declare namespace DTS="<a href="http://www.microsoft.com/SqlServer/Dts">www.microsoft.com/SqlServer/Dts</a>"; //DTS:Executable/DTS:Property[@DTS:Name="VersionGUID"]') AS x(guid)<br />)</p>
<p>SELECT *<br />FROM Packages</p>
<p><strong>Example 2: Display Connections strings for each OLEDB Connection Manager</strong></p>
<p>USE MSDB<br />GO<br />WITH xmlPackages <br />-- Read sysssispackages and convert packagedata image column to XML datatype<br />AS<br />(SELECT [name]<br />, [Description]<br />, verbuild <br />, CAST(CAST(packagedata as VARBINARY(MAX))&nbsp; AS XML) PackageXML<br />FROM dbo.sysssispackages)<br />,<br />Packages&nbsp;&nbsp;&nbsp; <br />-- Cross join each package row with OLEDB connections found in the package and convert it to VARCHAR<br />AS<br />(SELECT [name] <br />, [Description]<br />, [verbuild]<br />,&nbsp; x.cn.value('text()[1]', 'varchar(4000)') Conn<br />FROM xmlPackages <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CROSS APPLY <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PackageXML.nodes('declare namespace DTS="<a href="http://www.microsoft.com/SqlServer/Dts">www.microsoft.com/SqlServer/Dts</a>"; //DTS:ConnectionManager[DTS:Property="OLEDB"]/DTS:ObjectData/DTS:ConnectionManager/DTS:Property [@DTS:Name="ConnectionString"]') AS x(cn)<br />)<br />SELECT [Name] PackageName&nbsp; <br />, [Description]<br />, [verbuild]<br />, Conn ConnectionString<br />FROM Packages</p>]]></content></entry><entry><title>6232 Class New Lab Files</title><id>http://blogs.interfacett.com/jeff-jones-blog/2010/4/30/6232-class-new-lab-files.html</id><link rel="alternate" type="text/html" href="http://blogs.interfacett.com/jeff-jones-blog/2010/4/30/6232-class-new-lab-files.html"/><author><name>Jeff Jones</name></author><published>2010-04-30T20:49:28Z</published><updated>2010-04-30T20:49:28Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p>The new lab files from the 6232 class on the week of April 26th have been posted.&nbsp;&nbsp; You can&nbsp;download them at the following address:</p>
<p><a href="http://interfacett.com/files/sql/6232newlabfiles.zip">http://interfacett.com/files/sql/6232newlabfiles.zip</a></p>]]></content></entry><entry><title>Reporting Services Interesting Links</title><category term="Links"/><category term="Reporting Services"/><id>http://blogs.interfacett.com/jeff-jones-blog/2010/2/19/reporting-services-interesting-links.html</id><link rel="alternate" type="text/html" href="http://blogs.interfacett.com/jeff-jones-blog/2010/2/19/reporting-services-interesting-links.html"/><author><name>Jeff Jones</name></author><published>2010-02-19T14:55:23Z</published><updated>2010-02-19T14:55:23Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p>Below are links to projects in Codeplex.com where you can download the Adventureworks Sample databases and sample codes for reporting services.&nbsp; I have included a link to download a report to link SQL Agent job names created by Reporting Services to Report Names and some other useful queries against the Report Server databases.</p>
<p>&nbsp;</p>
<p>Adventureworks Sample Databases - <a href="http://msftdbprodsamples.codeplex.com/">http://msftdbprodsamples.codeplex.com/</a></p>
<p>Reporting Services Sample Code - <a href="http://msftrsprodsamples.codeplex.com/">http://msftrsprodsamples.codeplex.com/</a></p>
<p>RS Server Mgmt Report Samples - <a href="http://msftrsprodsamples.codeplex.com/wikipage?title=SS2008%21Server%20Management%20Sample%20Reports&amp;referringTitle=Home">http://msftrsprodsamples.codeplex.com/wikipage?title=SS2008%21Server%20Management%20Sample%20Reports&amp;referringTitle=Home</a></p>
<p>Report Server Job Report, All Subscriptions Query, Cache Expiration Query - <a href="http://interfacett.com/files/sql/reportserverjobreport.zip">http://interfacett.com/files/sql/reportserverjobreport.zip</a></p>
<p>BI6236 Course Demo files - <a href="http://interfacett.com/files/sql/bi6236demos.zip">http://interfacett.com/files/sql/bi6236demos.zip</a></p>
<p>RSScripter and RSLinkGen tool - <a href="http://sqldbatips.com">http://sqldbatips.com</a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content></entry><entry><title>SQL Server Blogs and Forums I Follow</title><id>http://blogs.interfacett.com/jeff-jones-blog/2009/12/31/sql-server-blogs-and-forums-i-follow.html</id><link rel="alternate" type="text/html" href="http://blogs.interfacett.com/jeff-jones-blog/2009/12/31/sql-server-blogs-and-forums-i-follow.html"/><author><name>Jeff Jones</name></author><published>2009-12-31T23:21:23Z</published><updated>2009-12-31T23:21:23Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p>I was asked in class to provide the list of SQL Server&nbsp;Blogs and Forums I follow.&nbsp; This also includes a few Sharepoint blogs as well as I am having to start to learn this product as wll.&nbsp; The following link will download an xml file that is in OPML format.&nbsp; It will load a number of blogs and forums that I follow using Google Reader.&nbsp; You can import this file into Google Reader or any other RSS feed reader.</p>
<p><a href="http://interfacett.com/files/sql/jeff-jones-blog-subscriptions.zip">http://interfacett.com/files/sql/jeff-jones-blog-subscriptions.zip</a></p>]]></content></entry><entry><title>6231 SQL Server 2008 Administration Demo Files</title><id>http://blogs.interfacett.com/jeff-jones-blog/2009/12/31/6231-sql-server-2008-administration-demo-files.html</id><link rel="alternate" type="text/html" href="http://blogs.interfacett.com/jeff-jones-blog/2009/12/31/6231-sql-server-2008-administration-demo-files.html"/><author><name>Jeff Jones</name></author><published>2009-12-31T21:33:23Z</published><updated>2009-12-31T21:33:23Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p>Here is the link to the demo code from the 6231 SQL Server 2008 Class.</p>
<p><a href="http://interfacett.com/files/sql/6231demos.zip">http://interfacett.com/files/sql/6231demos.zip</a></p>]]></content></entry><entry><title>Who has access?</title><category term="SQL Server 2005"/><id>http://blogs.interfacett.com/jeff-jones-blog/who-has-access.html</id><link rel="alternate" type="text/html" href="http://blogs.interfacett.com/jeff-jones-blog/who-has-access.html"/><author><name>Jeff Jones</name></author><published>2007-07-11T23:58:21Z</published><updated>2007-07-11T23:58:21Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p>Occasionally you would like to find out all the&nbsp;tables, views and stored procedures a user can access and what permissions they have.&nbsp; With a combination of the new EXECUTE AS command and the new HAS_PERMS_BY_NAME function you can figure this out.&nbsp;&nbsp;Below&nbsp;is a query that uses the sys.All_Objects metadata view to generate object names.&nbsp; Then&nbsp;it passes the object&nbsp;names&nbsp;through the new function with some additional parameters (the securable type, and permission type) and it returns 1 if the user has that permission and 0 if they do not.</p><p>The result shows both implicit permissions granted through&nbsp;fixed server or database roles. It also shows&nbsp;explicit permission granted though user-defined roles&nbsp;or granted directly to the database user account.&nbsp; </p><p>The EXECUTE AS can only specify individual user principal defined to SQL Server.&nbsp; It cannot reference a Windows Group.&nbsp; This is only valid with SQL Server 2005.&nbsp; </p><p><strong>EXECUTE AS LOGIN = 'miami\anders'</strong></p><p><strong>SELECT SCHEMA_NAME(schema_id) + '.' + name TableName <br />, type_desc<br />, HAS_PERMS_BY_NAME(SCHEMA_NAME(schema_id) + '.' + name, <br />&nbsp;&nbsp;&nbsp; 'OBJECT', 'SELECT') AS have_select<br />, HAS_PERMS_BY_NAME(SCHEMA_NAME(schema_id) + '.' + name, <br />&nbsp;&nbsp;&nbsp; 'OBJECT', 'UPDATE') AS have_update<br />, HAS_PERMS_BY_NAME(SCHEMA_NAME(schema_id) + '.' + name, <br />&nbsp;&nbsp;&nbsp; 'OBJECT', 'INSERT') AS have_insert<br />, HAS_PERMS_BY_NAME(SCHEMA_NAME(schema_id) + '.' + name, <br />&nbsp;&nbsp;&nbsp; 'OBJECT', 'DELETE') AS have_delete<br />, HAS_PERMS_BY_NAME(SCHEMA_NAME(schema_id) + '.' + name, <br />&nbsp;&nbsp;&nbsp; 'OBJECT', 'EXECUTE') AS have_execute<br />FROM sys.all_objects<br />WHERE type_desc IN ('USER_TABLE', 'SQL_STORED_PROCEDURE', 'VIEW')<br />AND SCHEMA_NAME(schema_id) NOT IN ('sys', 'INFORMATION_SCHEMA')<br />ORDER BY type_desc, tablename</strong></p><p><strong>REVERT</strong></p>]]></content></entry><entry><title>SQL Server 2005 Index Information</title><category term="SQL Server 2005"/><id>http://blogs.interfacett.com/jeff-jones-blog/2007/7/11/sql-server-2005-index-information.html</id><link rel="alternate" type="text/html" href="http://blogs.interfacett.com/jeff-jones-blog/2007/7/11/sql-server-2005-index-information.html"/><author><name>Jeff Jones</name></author><published>2007-07-11T23:32:11Z</published><updated>2007-07-11T23:32:11Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p>Here are some queries using the new Dynamic Management views and functions see which indexes are being used and how they are being updated.&nbsp; </p><p>This query shows which indexes are used, whether it was a seek, scan or lookup and the date it was last performed.&nbsp;When using the object_name function, you want&nbsp;to&nbsp;USE the database you are interested in and then filter the view so it only shows objects from that database.&nbsp; Filtering on object_id &gt; 100 eliminates system tables from the output.</p><p><strong>USE Adventureworks</strong></p><p><strong>SELECT object_name(object_id), *<br />FROM sys.dm_db_index_usage_stats<br />WHERE object_id &gt; 100 AND database_id = DB_ID('Adventureworks'</strong>)</p><p>This query provides more information about&nbsp;current low-level I/O, locking, latching, and access method activity for each partition of a table or index in the database.&nbsp;&nbsp; Since this query uses a table-valued function, you must pass parameters for the database id, table id, index id, and partition number.&nbsp; If you want to select all tables in a database you just need to pass the database id and specify DEFAULT for the other three parameters.&nbsp; Filtering on object_id &gt; 100 eliminates system tables from the output.</p><p><br /><strong>SELECT object_name(object_id), *<br />FROM sys.dm_db_index_operational_stats (db_id('Adventureworks'), default, default, default)<br />WHERE object_id &gt; 100</strong></p><p>The last query provides read and write I/O counts by file.&nbsp; This can help you determine which files have the highest I/O activity.&nbsp; <br /><br /><strong>SELECT db_name(database_id), * <br />FROM sys.dm_io_virtual_file_stats(default, default)</strong></p>]]></content></entry><entry><title>Integration Services Security</title><category term="Integration Services"/><id>http://blogs.interfacett.com/jeff-jones-blog/2007/5/18/integration-services-security.html</id><link rel="alternate" type="text/html" href="http://blogs.interfacett.com/jeff-jones-blog/2007/5/18/integration-services-security.html"/><author><name>Jeff Jones</name></author><published>2007-05-18T22:46:27Z</published><updated>2007-05-18T22:46:27Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p>Defining security for SQL Server Integration Services (SSIS) is a bit complex. I want to focus on the security required by a developer to create and manage their own packages and people that are not SysAdmins but need to manage all packages. </p><p>After a package has been developed using BI Development Studio, it must be deployed to a location for subsequent execution. This is a similar model to application dll&rsquo;s and exe&rsquo;s that must be deployed to an object library for execution. With SSIS you can deploy a package to any file system directory, the MSDB database or a special file system directory known by the Integration Services Service. When deploying to a file system directory (whether known by Integration Services Service or not), you must rely on OS file system security to control access to these packages. If you deploy to the MSDB database you have other mechanisms available to control access to packages. </p><p>The MSDB database has three predefined fixed database roles specifically designed for SSIS. They are db_dtsltduser, db_dtsoperator and db_dtsadmin. Each of the roles has execute permissions on a set of MSDB stored procedures that are used to manipulate packages located in the dbo.sysdtspackages90 table. You can also define your own custom database roles to further secure packages deployed to MSDB. The user needs a database user account in MSDB to be assigned to these roles. </p><p>Each package has a default assignment&nbsp;to both the&nbsp;readerrole and writerrole. The readerrole allows for enumerating a packaging (displaying its name), viewing a package&rsquo;s definition, executing a package interactively, exporting a package definition and running a package under SQL Server Agent as a job. The writerrole allows for importing a package, deleting a package and changing package security roles. </p><p>When a package is placed in the MSDB database a default role assignment is made. The package&rsquo;s readerrole is assigned to db_dtsadmin, db_dtsoperator and the creator of the package. The writerrole is assigned to db_dtsadmin and the creator of the package. The details for each role and what&nbsp;they can do is described in SQL Server 2005 Books Online under the &ldquo;Integration Services Roles&rdquo; topic. </p><p>For those developers that need to deploy packages to MSDB, enumerate and execute packages that they own, they need to a member of db_dtsltduser. Again they can only manipulate packages that they own. </p><p>If a person that is not a Sysadmin needs to administer all the packages stored in MSDB, they need to be in the db_dtsadmin role. All users with SysAdmin rights can see and do anything with packages. </p><p>To execute any package, the user must be in the db_dtsoperator role. </p><p>Additional user-defined database roles can be created in MSDB to provide an additional level of control. The additional roles work in conjunction with the fixed roles described above. By default, when a package is placed in the MSDB database, the owner of the package and the users in the db_dtsadmin role can view the package definition (via exporting), modify the package (via importing), and execute the package. Also users in the db_dtsoperator role can execute the package. When you assign a user-defined role as the readerrole, anyone in that user-defined role can view the package and execute it. When you assign a user-defined role&nbsp;as the writerrole, anyone in that user-defined role can update the package definition. The user must also be in the db_dtsltduser role. So users must be in both the user-defined role and the db_dtsltduser role to access packages. </p><p>For example, you have a development team creating Integration Services packages. They decide to deploy the packages to SQL Server MSDB for execution. The packages where created by different developers and therefore the packages have different creators/owners. We want the entire team to be able to read and potentially update the various packages. The DBA does not want to give the developers SysAdmin permissions nor the ability to read, update and execute all the packages in the MSDB database. One approach would be to:</p><p>1.&nbsp;Create a user-defined role in MSDB, place all the developers in that role. </p><p>2. Assign that role to the db_dtsltduser fixed database role. This allows the developer team to access packages that they created and own. </p><p>3. Assign&nbsp;each package the team created to the user-defined role created earlier. </p><p>This will allow all team members to access all associated packages no matter who created them. </p><p>There are other issues related to the encryption of sensitive data in the package that I will cover in another blog post. </p>]]></content></entry></feed>