<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://beyondrelational.com/live/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results matching tag 'Quick Tip'</title><link>http://beyondrelational.com/live/search/SearchResults.aspx?a=1&amp;o=DateDescending&amp;tag=Quick+Tip&amp;orTags=0</link><description>Search results matching tag 'Quick Tip'</description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><item><title>Preventing projects from deploying when debugging a SSIS package</title><link>http://beyondrelational.com/live/blogs/community/archive/2011/09/02/preventing-projects-from-deploying-when-debugging-a-ssis-package.aspx</link><pubDate>Fri, 02 Sep 2011 05:00:00 GMT</pubDate><guid isPermaLink="false">6e5011fa-7db5-4df3-bb79-9085c1d333b3:13469</guid><dc:creator>jamserra</dc:creator><description>&lt;p&gt;This is a quick tip to help quickly solve a problem I run into sometimes, and now that I am writing a blog about it, will be able to solve it in no time (a big benefit of blogging is to never have to try to remember a solution to a problem you have had before&amp;#8230;just search your blog!):&lt;/p&gt;
&lt;p&gt;In Visual Studio, I have a solution that encompasses three projects: a SSIS project, a SSAS project, and a SSRS project.  Say I&amp;#8217;m working on the SSAS project in this solution and it&amp;#8217;s in an incomplete state.  Then I get an email that there is a problem with a SSIS package, and that package is in the same solution under the SSIS project.  So I go to that package and hit debug, and the SSIS package does not run because it tried to deploy the SSAS project and there were errors.  Why does it try to deploy the SSAS project when I&amp;#8217;m just trying to run a SSIS package?&lt;/p&gt;
&lt;p&gt;The problem is your solution is set up to build and/or deploy ALL the projects when you just want to debug one project.  The solution is simple - right click the solution, select &amp;#8220;Configuration Manager&amp;#8230;&amp;#8221;, and uncheck the &amp;#8220;Build&amp;#8221; and &amp;#8220;Deploy&amp;#8221; boxes:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.jamesserra.com/wp-content/uploads/2011/08/Untitled-picture3.png"&gt;&lt;img class="alignnone size-full wp-image-1518" title="Untitled picture" src="http://www.jamesserra.com/wp-content/uploads/2011/08/Untitled-picture3.png" alt="" width="795" height="498" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Now, when you debug the SSIS package, the SSAS project and any other packages will be ignored.&lt;/p&gt;
</description></item><item><title>How to Run Programs as a Domain User from a Non-domain Computer</title><link>http://beyondrelational.com/live/blogs/community/archive/2011/08/03/how-to-run-programs-as-a-domain-user-from-a-non-domain-computer.aspx</link><pubDate>Wed, 03 Aug 2011 05:00:00 GMT</pubDate><guid isPermaLink="false">6e5011fa-7db5-4df3-bb79-9085c1d333b3:13499</guid><dc:creator>jamserra</dc:creator><description>&lt;p&gt;As a consultant or contractor, many times the client we are at does not provide us with a laptop, so we must use our own.  Usually that is preferred anyway, as we have all the software and tools installed and setup the way we want to make us as productive as possible.  And since we may be working for multiple clients, that means there are multiple client domains we have to access.  But it&amp;#8217;s a real pain to have to join all the clients domains, for the following reasons:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The constant switching between domains if I am working on different clients at the same time can be a real hassle&lt;/li&gt;
&lt;li&gt;Each domain join requires that each companies domain admin has to authorize the join by typing in their credentials when prompted on my laptop&lt;/li&gt;
&lt;li&gt;When joining a domain, each companies Group Policy would be applied to my laptop&lt;/li&gt;
&lt;li&gt;The domain admins would have full rights to my machine and therefore data from other clients&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Usually, not being joined to a client&amp;#8217;s domain is not a big deal.  If you need access to a network share or printer, just browse to it and you will be prompted for your domain credentials.  The fact that you’re using different domain credentials to access the resource from those that you logged in with doesn’t matter.  If you want to maintain a persistent connection to a network share (and avoid a authentication time-out), you can create a batch file and include commands like:&lt;/p&gt;
&lt;p&gt;NET USE \\server /user:domain\username /persistent:yes&lt;/p&gt;
&lt;p&gt;However, there are certain tools, such as SQL Server Management Studio (SSMS), SQL Query Analyzer, and Visual Studio, that don&amp;#8217;t allow you to specify alternate domain credentials for authentication.  For example, SSMS allows you to log into a SQL Server instance using Windows Authentication or SQL Server Authentication.  If the SQL instance requires Windows Authentication – the recommended configuration – SQL Server Management Studio uses your logged in credentials.  This works well if your computer is part of the domain, but fails if it is not.  It doesn’t let you specify alternate credentials or even prompt you for alternate credentials if the log-in fails.&lt;/p&gt;
&lt;p&gt;So how do you get around this problem?  NET USE doesn’t help here because NET USE is specifically for network shares.  Using the SHIFT right-click on a program that gives you the &amp;#8220;Run as different user&amp;#8221; prompt does not work either as it tries to run the command locally as the domain user, who is unknown by your computer because you’re not part of the domain.&lt;/p&gt;
&lt;p&gt;There are a few &amp;#8220;undesirable&amp;#8221; solutions: remote desktop into a domain computer so that you could run the tools such as SSMS, use a domain-joined virtual machine, or ask co-workers to run commands for you.&lt;/p&gt;
&lt;p&gt;The two &amp;#8220;desirable&amp;#8221; solutions are:&lt;/p&gt;
&lt;p&gt;1) Use the &lt;a href="http://technet.microsoft.com/en-us/library/bb490994.aspx"&gt;RUNAS&lt;/a&gt; command with an option that most people have not noticed: /netonly.  The command is run as your local user, but uses the supplied domain credentials only when accessing the network.  For example, to run SSMS:&lt;/p&gt;
&lt;p&gt;RunAs &lt;strong&gt;/netonly&lt;/strong&gt; /user:domain\username “C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe”&lt;/p&gt;
&lt;p&gt;You will be prompted to enter a password when you run this command.  That could be a pain, but fortunately there is a utility that is a RunAs replacement that allows you to specify a password.  It is called &lt;a href="http://www.joeware.net/freetools/tools/cpau/index.htm"&gt;CPAU&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;2) Use the &lt;a href="http://technet.microsoft.com/en-us/sysinternals/cc300361.aspx"&gt;ShellRunAs&lt;/a&gt; utility.  It provides functionality similar to that of RunAs to launch programs as a different user via a convenient shell context-menu entry.  It is essentially the same thing as using the SHIFT right-click on a program which gives you the &amp;#8220;Run as different user&amp;#8221; prompt, except this gives you a &amp;#8220;Run as different user (netonly)&amp;#8221; prompt, meaning it adds the &amp;#8220;netonly&amp;#8221; switch.  This is more convenient than the RunAs command as you don&amp;#8217;t have to type a long DOS command.&lt;/p&gt;
&lt;p&gt;I have found these solutions very helpful for testing purposes.  For example, say I created a role in a SSAS cube called &amp;#8220;Northeast Role&amp;#8221; that is granted access to only a particular subset of data, the northeast region.  The membership of this role includes a windows group, say &amp;#8220;Northeast region&amp;#8221;.  I can have a test windows account created, say &amp;#8220;NEtest&amp;#8221;, and have that account placed in the &amp;#8220;Northeast region&amp;#8221; group.  To make sure that user is only able to see the northeast region, I can use one of the above solutions to login as &amp;#8220;NEtest&amp;#8221; via Excel to access the cube and make sure it&amp;#8217;s working as it is supposed to.&lt;/p&gt;
</description></item><item><title>Dirty looking SQL or MDX? Clean it up</title><link>http://beyondrelational.com/live/blogs/community/archive/2011/05/11/dirty-looking-sql-or-mdx-clean-it-up.aspx</link><pubDate>Wed, 11 May 2011 06:13:00 GMT</pubDate><guid isPermaLink="false">6e5011fa-7db5-4df3-bb79-9085c1d333b3:13567</guid><dc:creator>jamserra</dc:creator><description>&lt;p&gt;
    A quick tip for you: Ever get some SQL or MDX sent to you in an email, or copied
    from a website, or pulled from SQL Profiler, that is difficult to understand because
    it&amp;rsquo;s not formatted? Well, there are a couple of free tools that will clean up your
    SQL: &lt;a href="http://www.sqlinform.com/free_online_sw.html"&gt;SQLinForm&lt;/a&gt; and &lt;a href="http://www.dpriver.com/pp/sqlformat.htm"&gt;Instant SQL Formatter&lt;/a&gt;. Simple copy and paste in the SQL, hit
    the &amp;ldquo;Format&amp;rdquo; button, and wallah, nice clean SQL!&lt;/p&gt;
&lt;p&gt;
    The tools to cleanup MDX are from Nick Medveditskov at this &lt;a href="http://formatmdx.msftlabs.com/"&gt;Microsoft site&lt;/a&gt; (does
    DAX too) and from &lt;a href="http://mdx.mosha.com/"&gt;Mosha Pasumansky&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>A quicker way than using count(*)</title><link>http://beyondrelational.com/live/blogs/community/archive/2011/05/09/a-quicker-way-than-using-count.aspx</link><pubDate>Mon, 09 May 2011 13:16:00 GMT</pubDate><guid isPermaLink="false">6e5011fa-7db5-4df3-bb79-9085c1d333b3:13568</guid><dc:creator>jamserra</dc:creator><description>&lt;p&gt;
    A quick little tip I found a couple of years ago. Ever use the count(*) syntax and
    it takes forever to count all the rows in a table? I had this problem when I would
    sometimes run counts on a bunch of tables to check that my replication was working
    correctly. Here is a much, much quicker way using the DMV sys.dm_db_partition_stats:&lt;/p&gt;
&lt;pre class="brush:sql"&gt;SELECT
	SUM(row_count) AS TotRows
FROM 
	sys.dm_db_partition_stats
WHERE 
	object_name(object_id) = &amp;#39;YourTableName&amp;#39;
	AND index_id &amp;lt; 2
&lt;/pre&gt;
&lt;p&gt;
    Running the count(*) on one of my large tables took 33 seconds. The above statement
    took 1 second.&lt;/p&gt;
&lt;p&gt;
    If you want to do a record count on all tables in a database:&lt;/p&gt;
&lt;pre class="brush:sql"&gt;SELECT 
	OBJECT_NAME(OBJECT_ID) TableName, st.row_count
FROM 
	sys.dm_db_partition_stats st
WHERE 
	index_id &amp;lt; 2
    ORDER BY st.row_count DESC
&lt;/pre&gt;
&lt;p&gt;
    Another little known way to get table counts quickly is in SSMS click View -&amp;gt; Object
    Explorer Details, then click on the &amp;ldquo;Tables&amp;rdquo; folder for any database. By default
    you will see all the table names, but not the row count. To get that, right-click
    on a column header and select &amp;ldquo;Row Count&amp;rdquo;.&lt;/p&gt;</description></item></channel></rss>