Ian Beckett

RSS feed

    Recent comments

    Authors

    get web page host using c#

    Request.URL.Host

    and

    objResponse = objRequest.GetResponse();
    this.Host = objResponse.ResponseUri.Host;


    Categories: .NET | C#
    Posted by ibeckett on Saturday, May 01, 2010 3:12 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    IF exists SQL

    IF EXISTS( SELECT 1 FROM PartnerAccount WHERE AccountID = @AccountID )
    BEGIN
     ...
    END

     


    Posted by ibeckett on Monday, April 19, 2010 2:33 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    How-to: Setup Visio Graphics Services group execution account in SharePoint 2010

     

    Step 1:

    Browse to SharePoint Central Administrator by opening your web browser and going to http://yourservernamehere:12808/default.aspx

     

    Step 2:

    Under Application Management, select "Manage service applications"...

    Click "manage service applications".

     

    Step 3:

    Click "Secure store service"...

    Application Registry ServiceApplication Registry ServiceBusiness Data ConnectivityBusiness Data ConnectivityManaged Metadata ServiceMaria’;ed Metadata Service-Parrh Adrniriistrati’:ri V/cE’ ServceErrSearch Service AppIcationSearch Service ApplicationSto re Se rviceSecure Store ServiceSecurity Token Service Application

     

    Step 4:

    If you haven't done so already, you will need to generate an encryption key and pass phrase.  SP will warn you that you need to do this and walk you through it.  It's really easy.  If you don't get the warning for some reason, and have not yet generated the key, you can do so on this screen by clicking the "Generate new key" button.  Once you have the encryption key setup, proceed to next step…

    click "generate new key"

     

    Step 5:

    Once you have the encryption key setup, it's time to setup the Target Application ID, group, and assign users to the group.  Start by clicking "New" in the menu on the Secure Store Service screen…

    Click new to setup a new target application ID

     

    Step 6:

    Clicking "New" will take you to the Target Application Settings screen.  Fill out the form similar to what is in the screen shot below, replacing the values I've used with your own. Be sure to select "Group" for Target Application Type! Click Next.

    Target Application IDI vgsdernoDisplay NameI vgsdernoContact E-mailmicrosoft cornTarget Application TypeIGroupTarget Application Page URLC Use default pageC Use custom pageNone

     

    Step 7:

    On the next screen, leave it the way it is and click Next.  It should look like this:

    Leave the settings as they are on this screen...

     

    Step 8:

    On the next screen, you add users who should have admin privelges to edit the secure store target application.  You add the users to the first box on the screen. 

     

    In the second text box, you add the users who should be mapped to the group execution account.  In this example you can see I added two domain user groups, and they will be mapped to the group login "vgsdemo" (we setup the group login in Step 6).  When finished click OK…

    Target Application AdministratorsThe list of users who have access to manage the Target Application settings. The Farmadministrator will have access by default.Ian Beckett (Database Marketing Grour’, Iric) :kvUsers who have Full Control or All Target Applications privileges canadminister this Secure Store Target Application.MembersThe users and groups that are mapped to the credentials defined for this Target Application.After creating the new application, you can add credential mappings by using the “Set Credentials”buRon for the selected application. You can edit the settings of this application later at the Managerarget Applications page.RFDMOND\domain users ; NORTHAMERICA\domain users ;OKCancel

     

    Step 9:

    You will see the generic SP 2010 "processing" splash screen, and after a few seconds if everything is successful, you will see the new Target App ID listed in the secure store service list…

    all done!  you can see the vgs demo user has been setup successfully...

     


    Posted by ibeckett on Thursday, April 08, 2010 3:49 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    Comparing DateIDs and Comparing dates without times in SQL Server

    WHERE DateID=FLOOR(CONVERT(FLOAT,GETDATE()))

    SELECT CAST(FLOOR(CAST( getdate() AS float)) AS datetime)

    http://www.stillnetstudios.com/comparing-dates-without-times-in-sql-server/


    Tags:
    Categories: SQL 2008 | T-SQL
    Posted by ibeckett on Friday, March 26, 2010 5:42 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    VBA, How to stop list box activeX control autosize

    Set IntegralHeight property to false...

    ListBox1.IntegralHeight = False

    "An ActiveX ListBox Control has a IntegralHeight Property, which by default is set to True. Go into the Properties Window of the ListBox and set it to False. This should stop the Auto re-sizing. -Dave Hawley "

    http://www.ozgrid.com/forum/showthread.php?t=10568


    Posted by ibeckett on Wednesday, February 10, 2010 7:33 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    Tip: Restoring System Databases in SQL Server, Service Pack version is important!

    It's important to keep Service Pack version in mind in your backup/restore strategies and operations for system databases like MSDB.

    System databases can only be restored to a SQL Server version identical to the one used to create the backup. This condition goes down to the Service Pack level. A system database backup made with SQL Server SP1 cannot be restored on SQL Server SP2. If you are in a situation where you need to restore from a backup created with a different SP, you will need to do a fresh install & restore the backup before upgrading to the latest build.


    Posted by ibeckett on Tuesday, January 12, 2010 2:22 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    Connecting to SQL Server Analysis Services in Visio 2010

    This post is about accessing SSAS using Visio 2010.  For a great article on SSAS & Visio 2007, check out Dinesh Asanka's article here.

    Some of the menu options are different between Visio 2010 and it's predecessor Visio 2007.  In Visio 2007 there was a Pivot Diagram option in the Data menu that would allow you to use Analysis Services as the data source.  As far as I can tell, Pivot Diagram has been removed from the Data menu in Visio 2010.  Of course you can still use the Pivot Diagram feature in Visio 2010, but it involves using the Shapes menu. 

    Just create a Visio document and open the shapes menu. 

    Then using the shapes menu browse to: More Shapes -> Business -> Pivot Diagram -> Pivot Diagram Shapes.

    Pivot Diagram Shape Menu

    In the Pivot Diagram Shapes menu, there is a shape called "Pivot Node".

    Pivot Node Shape Option

    After dragging the Pivot Node shape on to the sheet, you will be presented with the Data Selector wizard, which allows you to select Analysis Services as an option.

    Pivot Diagram Data Selector in Visio 2010

    Complete the wizard and connect to SSAS, just like you would in Visio 2007. 

    From this point on, everything you know about working with Pivot Diagrams from Visio 2007 carries over to Visio 2010.

    Enjoy!


    Posted by ibeckett on Saturday, January 02, 2010 5:48 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    the cutting edge with Visio 2010 and the new JavaScript mashup API

    Chris Hopkins, Visio guru at Microsoft, has a trailblazing tutorial on the web demonstraing Visio Services 2010, SharePoint 2010, and the new JavaScript mashup API for Visio Graphics Services.  Get the demo & white paper here.

    The simplicity and elegance, and just how plain easy it is to build graphically rich and interactive reports using Visio is truly revolutionary.   The integration with Silverlight and how easy it is to embed Visio reports in a web page is wow factor to the max.

     


    Posted by ibeckett on Wednesday, December 16, 2009 10:37 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    SQL HTML Ampersand to character conversion database function

    In my web crawling adventures I have the recurring need to translate HTML Ampersand codes into the actual characters they represent.   In this post you will find the user defined function that I use in SQL Server 2008 to handle this requirement. 

    I have also included a copy of the conversion table for your viewing pleasure.  Please let me know if you find any Ampersand commands that are missing from the mapping table! 

    Enjoy!

    Usage:

    SELECT 'Death ' + dbo.ReplaceAmpersands('&') + ' Taxes'

    Output: Death & Taxes

    T-SQL to create the function:

    CREATE FUNCTION dbo.ReplaceAmpersands
    (
     @input nvarchar(MAX)
    )
    RETURNS NVARCHAR(MAX)
    AS
    BEGIN
     SELECT @input = REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
         REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
         REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
         REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
         REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
         REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
         REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
         REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
         REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
         REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
         REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
         REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
         REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
         REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
         REPLACE(REPLACE(REPLACE(@input,'&lt;','<'),'&gt;','>'),
         '&amp;','&'),'&quot;','"'),'&nbsp;',' '),'&Ccedil;','Ç'),
         '&ccdil;','ç'),'&Ntilde;','Ñ'),'&ntilde;','ñ'),'&THORN;','Þ'),
         '&thorn;','þ'),'&Yacute;','Ý'),'&yacute;','ý'),'&yuml;','ÿ'),
         '&szlig;','ß'),'&AElig;','Æ'),'&Aacute;','Á'),'&Acirc;','Â'),
         '&Agrave;','À'),'&Aring;','Å'),'&Atilde;','Ã'),'&Auml;','Ä'),
         '&aelig;','æ'),'&aacute;','á'),'&acirc;','â'),'&agrave;','à'),
         '&aring;','å'),'&atilde;','ã'),'&auml;','ä'),'&ETH;','Ð'),
         '&Eacute;','É'),'&Ecirc;','Ê'),'&Egrave;','È'),'&Euml;','Ë'),
         '&eth;','ð'),'&eacute;','é'),'&ecirc;','ê'),'&egrave;','è'),
         '&euml;','ë'),'&Iacute;','Í'),'&Icirc;','Î'),'&Igrave;','Ì'),
         '&Iuml;','Ï'),'&iacute;','í'),'&icirc;','î'),'&igrave;','ì'),
         '&iuml;','ï'),'&Oacute;','Ó'),'&Ocirc;','Ô'),'&Ograve;','Ò'),
         '&Oslash;','Ø'),'&Otilde;','Õ'),'&sect;','§'),'&laquo;','«'),
         '&raquo;','»'),'&sup3;','³'),'&iquest;','¿'),'&deg;','°'),
         '&brvbar;','¦'),'&frac12;','½'),'&frac34;','¾'),'&sup1;','¹'),
         '&sup2;','²'),'&cent;','¢'),'&pound;','£'),'&yen;','¥'),
         '&frac14;','¼'),'&plusmn;','±'),'&micro;','µ'),'&para;','¶'),
         '&middot;','·'),'&ucirc;','û'),'&ugrave;','ù'),'&uuml;','ü'),
         '&reg;','®'),'&Ucirc;','Û'),'&Ugrave;','Ù'),'&Uuml;','Ü'),
         '&uacute;','ú'),'&oslash;','ø'),'&otilde;','õ'),'&ouml;','ö'),
         '&Uacute;','Ú'),'&Ouml;','Ö'),'&oacute;','ó'),'&ocirc;','ô'),'&ograve;','ò');
     RETURN @input
    END

     

    And here is the actual conversion table that was used to build this function:

    AmpCommand AmpChar
    &lt; <
    &gt; >
    &amp; &
    &quot; "
    &nbsp;  
    &Ccedil; Ç
    &ccdil; ç
    &Ntilde; Ñ
    &ntilde; ñ
    &THORN; Þ
    &thorn; þ
    &Yacute; Ý
    &yacute; ý
    &yuml; ÿ
    &szlig; ß
    &AElig; Æ
    &Aacute; Á
    &Acirc; Â
    &Agrave; À
    &Aring; Å
    &Atilde; Ã
    &Auml; Ä
    &aelig; æ
    &aacute; á
    &acirc; â
    &agrave; à
    &aring; å
    &atilde; ã
    &auml; ä
    &ETH; Ð
    &Eacute; É
    &Ecirc; Ê
    &Egrave; È
    &Euml; Ë
    &eth; ð
    &eacute; é
    &ecirc; ê
    &egrave; è
    &euml; ë
    &Iacute; Í
    &Icirc; Î
    &Igrave; Ì
    &Iuml; Ï
    &iacute; í
    &icirc; î
    &igrave; ì
    &iuml; ï
    &Oacute; Ó
    &Ocirc; Ô
    &Ograve; Ò
    &Oslash; Ø
    &Otilde; Õ
    &sect; §
    &laquo; «
    &raquo; »
    &sup3; ³
    &iquest; ¿
    &deg; °
    &brvbar; ¦
    &frac12; ½
    &frac34; ¾
    &sup1; ¹
    &sup2; ²
    &cent; ¢
    &pound; £
    &yen; ¥
    &frac14; ¼
    &plusmn; ±
    &micro; µ
    &para;
    &middot; ·
    &ucirc; û
    &ugrave; ù
    &uuml; ü
    &reg; ®
    &Ucirc; Û
    &Ugrave; Ù
    &Uuml; Ü
    &uacute; ú
    &oslash; ø
    &otilde; õ
    &ouml; ö
    &Uacute; Ú
    &Ouml; Ö
    &oacute; ó
    &ocirc; ô
    &ograve; ò


    Posted by ibeckett on Thursday, December 10, 2009 4:29 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    Add "nofollow" rel attribute by default for comments in Blog Engine .NET

    By default "nofollow" is not added to the comment user URLs in Blog Engine .NET. 

    You probably want to use "nofollow", because you do not necessarily trust the links being added by your visitors, and you do not want to lose page rank by linking to potentially bad sites.

    This is very easy to do with Blog Engine .NET version 1.5.  Simply follow the steps:

    1. Open the CommentView.ascx file in your theme directory (root\themes\).

    2. Find the only "href" character string in the file.  It's on this line:

    <%= Comment.Website != null ? "<a href=\"" + Comment.Website + "\" class=\"url fn\">" + Comment.Author + "</a>" : "<span class=\"fn\">" +Comment.Author + "</span>" %>

    3. Change "a href=\" to "a rel=\"nofollow\" href=\"

    4. Save the file, and you're done! 

    Refresh the page, take a look at the source, and you see the issue is fixed:


    Categories: .NET
    Posted by ibeckett on Saturday, October 10, 2009 5:47 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    StringHelper class to reverse strings using C#

    I was surprised to find that C# does not have a built in method to reverse strings.  A quick search on Bing brought up the below code snippet from Sam Allen at dotnetperls.com.  The StringHelper class below contains a single static method named ReverseString.  Works like a charm!

    Input:  [1] framework
               [2] samuel
               [3] example string

    Output: [1] krowemarf
                [2] leumae
                [3] gnirts elpmaxe

    using System;

    static class StringHelper
    {
        /// <summary>
        /// Receives string and returns the string with its letters reversed.
        /// </summary>

        public static string ReverseString(string s)
        {
            char[] arr = s.ToCharArray();
            Array.Reverse(arr);
            return new string(arr);
        }
    }

    class Program
    {
        static void Main()
        {
            Console.WriteLine(StringHelper.ReverseString("framework"));
            Console.WriteLine(StringHelper.ReverseString("samuel"));
            Console.WriteLine(StringHelper.ReverseString("example string"));
        }
    }


    Posted by ibeckett on Tuesday, August 11, 2009 12:04 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    Outlook Social Networking Plugin

    EDIT: With Office 2010, almost all of the best Xobni features have been integrated with Outlook!!!

    http://www.xobni.com/

    This is a cool plugin for Outlook that I heard about from friend at work. It's not new, but it's new to me :)

    Word of warning: it doesn't really work with Office 2010 (yet)...

    Xobni demo video
    A tour of Xobni, a social networking and search plugin for Microsoft Outlook

     


    Posted by ibeckett on Tuesday, July 28, 2009 2:46 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    RegEx Text Scrape C# Function

    I wrote the following code to make RegExing easier in C#.  The function takes two parameters, Text and Pattern.  Text is a string target that you want to scrape, and Pattern is the RegEx expression to match.

    The actual code:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Collections;
    using System.Text.RegularExpressions;

    namespace Scraper
    {
        static class ScrapeText
        {
            static public ArrayList Scrape(string Pattern, string Text)
            {
                ArrayList MatchedValues = new ArrayList();
                Regex r;
                Match m;
                r = new Regex(Pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);
              
                string foundVal;
                for (m = r.Match(Text); m.Success; m = m.NextMatch())
                {
                    foundVal = m.Groups[0].ToString();
                    MatchedValues.Add(foundVal);
                }

                return MatchedValues;
            }
        }
    }



    Using ScrapeText:

    ArrayList ScrapedList = ScrapeText .Scrape(@"(?s)<li>.*?</li>", "<ul><li>a</li><li>b</li><li>c</li></ul>");

    In this example, I pass "(?s)<li>.*?</li>" as the RegEx expression - this will match any string beginning with "<li>" and ending with "</li>" in the HTML text source.

    For the text to search, I pass a dummy HTML snippet: 
     <ul>
      <li>a</li>
      <li>b</li>
      <li>c</li>
     </ul>

    The output is an ArrayList containing a list item for each RegEx match.  In this example it would be an array list containing the values "a","b", and "c".  In this example it would be an array list containing the values "<li>a</li>","<li>b</li>", and "<li>c</li>".  Once I have this Array List I can scrub and transform the values however I want.   In this example I might strip out the HTML list elements to isolate the alphabetical values.


    Posted by ibeckett on Thursday, July 16, 2009 5:46 PM
    Permalink | Comments (1) | Post RSSRSS comment feed

    Return identity key value after insert into a MS SQL Server database

    When you want to immediately return the identity value (often the primary key) after doing an insert, add the below to your sproc:

    declare @newid int
    INSERT INTO ... VALUES (...)
    SELECT @newid = @@IDENTITY
    return @newid 


    Categories: SQL 2005 | SQL 2008 | T-SQL
    Posted by ibeckett on Tuesday, July 14, 2009 5:21 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    how to differentiate between SATA and PATA drives

    Just look at the connectors to differentiate between SATA and PATA


    Categories: hardware
    Posted by ibeckett on Saturday, July 11, 2009 5:19 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    System Requirements for Windows Server 2008

    Windows Server 2008 System Requirements

    To use Windows Server 2008 you need:

    Processor
    • Minimum: 1GHz (x86 processor) or 1.4GHz (x64 processor)
    • Recommended: 2GHz or faster
    Note: An Intel Itanium 2 processor is required for Windows Server 2008 for Itanium-Based Systems

    Memory
    • Minimum: 512MB RAM
    • Recommended: 2GB RAM or greater
    • Maximum (32-bit systems): 4GB (Standard) or 64GB (Enterprise and Datacenter)
    • Maximum (64-bit systems): 32GB (Standard) or 2TB (Enterprise, Datacenter and Itanium-Based Systems)

    Available Disk Space
    • Minimum: 10GB
    • Recommended: 40GB or greater
    Note: Computers with more than 16GB of RAM will require more disk space for paging, hibernation, and dump files

    Drive
    DVD-ROM drive

    Display and Peripherals
    • Super VGA (800 x 600) or higher-resolution monitor
    • Keyboard
    • Microsoft Mouse or compatible pointing device

    source: msdn.microsoft.com


    Posted by ibeckett on Friday, July 10, 2009 3:52 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    Excel Services Compatibility Checker

    One of the annoyances that I have come across in my short time working with Excel Services is the cycle of; change workbook -> publish to share point -> make sure everything works -> repeat.  Today I happened to find a compatibility checker that works extremely well, especially considering that it is in (probably permanent) beta.

    I don't think that I can do a better job explaining how to use it than the author, so just go check out the site!  If you just want to download the installation file, you can get it here.


    Issues that the compatiblity checker knows how to find/fix

    The following is a list of the issues that can be found:

    AutoFix available (all of these will be removed from the workbook when auto-fixed):

    • Comments
    • DialogSheets
    • Display Formulas
    • Macro Sheet
    • OleObjects
    • Query Tables
    • Shapes
    • Validation
    • XML Maps

    AutoFix sometimes available (will be removed if possible):

    • IRM - AutoFix will work if there's no password.
    • Protection - AutoFix will work if there's no password.
    • VBA - AutoFix will work if the trust-cente enables Automation to interact with the VBA project.

    AutoFix will not work for these:

    • Unsupported formulas such as External Workbooks and RTD()
    • FileFormatResult

    excerpt from http://blogs.msdn.com/cumgranosalis


    Posted by ibeckett on Saturday, June 20, 2009 5:01 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    An Overview of Data Connections in Excel 2007

    Data Connections in Excel 2007

    Every workbook that imports data from an external location uses a data connection to retrieve data from the data source.  There are two types of connections in Excel 2007 – Embedded, and Linked connections.


    Embedded connection
    Embedded connections exist within the file definition of the containing Excel document – they are bundled together.  This is useful in scenarios where there is no central data connection library available, or for when you want to deploy a completely standalone solution.

    Linked connection
    Linked connections are connections that are stored in a separate file with a .odc (Office Data Connection) extension.   Using ODC files is good for scenarios where you have many different workbooks that utilize identical data connections.  You can deploy the connection file to a central location, where multiple workbooks can access it.  If the connection details ever need to be changed, only a single file needs to be updated, rather than updating the connection within every single workbook.


    Within Excel both types of connections are utilized in the exact same way, there is no functional difference.

    A single connection within an Excel workbook can be both embedded and linked at the same time.  Whenever you use the data connection wizard to setup a new connection file, the file is referenced by that connection by default.  However if you go into the connection settings within Excel and change any part of the connection, you will get a warning that the connection in the workbook will no longer match the linked connection, and the link to the external connection will be severed.

    Optionally, the workbook can be forced to use the linked connection exclusively by checking the “always use connection file” option within the connection properties menu  (see screenshot to the right).  By doing this, Excel will always reference the external connection- even when it differs from the connection within the file.

    The benefit of leaving “always use connection file” unchecked is that if one connection fails for whatever reason, the workbook will try the other one before giving up completely.  This gives you two shots at making the connection!


    Posted by ibeckett on Thursday, June 18, 2009 4:15 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    SharePoint development on Windows Vista

    Check out Bamboo Nation's setup helper

    from their site:
    If you are a developer for SharePoint your best friend has been Virtual PC or VMWare. It’s time to introduce a new friend, Bamboo Nation's SharePointOnVista J

    We have put together an installer that allows you to install WSS3.0 SP1 on Vista, both x86 and x64.  This will allow you to develop on your workstation with all the power of a non virtualized environment.


    Posted by ibeckett on Tuesday, May 26, 2009 6:16 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    ISO Recorder by Alex Feinman

    I'm posting this because I keep losing the link. 

    This is the greatest little tool for those times when you need to burn an ISO image to a DVD.

    Check it out here

    From the website:
    ISO Recorder is a tool (power toy) for Windows XP, 2003 and now Windows Vista, that allows (depending on the Windows version) to burn CD and DVD images (DVD support is only available on Windows Vista), copy disks, make images of the existing data CDs and DVDs and create ISO images from a content of a disk folder.

    Posted by ibeckett on Sunday, May 24, 2009 6:11 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    SharePoint Designer 2007

    UPDATE: SharePoint Designer 2010 Beta has been released!  Get it here...

     

    Recently I was tasked with setting up a custom themed SharePoint portal to do a blog & news letter for a project I am involved with at work.  It looks like the place to start is SharePoint designer.  I plan to post on my progress as I work with this tool.


    From Microsoft.... 

    SHAREPOINT DESIGNER 2007 IS NOW FREE! Learn more about these changes and future direction. Watch the Q&A video to learn more.

    Office SharePoint Designer 2007 provides the powerful tools you need to deliver compelling and attractive SharePoint sites and quickly build workflow-enabled applications and reporting tools on the SharePoint platform, all in an IT-managed environment.

    Posted by ibeckett on Thursday, May 14, 2009 4:46 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    URL rewriting guides on the web...

    http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx

    http://msdn.microsoft.com/en-us/library/ms972974.aspx


    Posted by ibeckett on Sunday, May 10, 2009 7:31 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    Build a Data-Driven Web Site in less than 14min

    "See how simple it is to create data-driven web sites using ASP.NET 2.0, Visual Web Developer 2005 Express Edition, and SQL Server 2005 Express Edition. Learn how to create a database, add its data, and display that data on a web page.

    Duration: 13 minutes, 41 seconds"

    watch it at http://www.asp.net/learn/videos/video-49.aspx 


    Categories: .NET | ASP.NET | C# | web stuff
    Posted by ibeckett on Tuesday, April 28, 2009 4:36 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    How do I get row field headings to repeat in a pivot table?

    The VBA script below is really useful if you need to flatten a pivot table output into a regular table with repeating labels.  Select a column, run the macro, and the blanks are filled!

    source http://www.contextures.com/xlfaqPivot.html#Repeat 

    The row headings show once in a Pivot Table, and there's no setting you can change to force them to repeat. To create a table with a heading on each row, you could copy the pivot table, paste it as values in another location, and fill in the blanks, using the technique shown here: http://www.contextures.com/xlDataEntry02.html.

    Fill Blank Cells Programmatically

    If you frequently have to fill blank cells, you may prefer to use a macro. The following code will fill blank cells in the active column:

    Sub FillColBlanks()
    'by Dave Peterson  2004-01-06
    'fill blank cells in column with value above
    Dim wks As Worksheet
    Dim rng As Range
    Dim LastRow As Long
    Dim col As Long

    Set wks = ActiveSheet
    With wks
       col = activecell.column
       'or
       'col = .range("b1").column

       Set rng = .UsedRange  'try to reset the lastcell
       LastRow = .Cells.SpecialCells(xlCellTypeLastCell).Row
       Set rng = Nothing
       On Error Resume Next
       Set rng = .Range(.Cells(2, col), .Cells(LastRow, col)) _
                      .Cells.SpecialCells(xlCellTypeBlanks)
       On Error GoTo 0

       If rng Is Nothing Then
           MsgBox "No blanks found"
           Exit Sub
       Else
           rng.FormulaR1C1 = "=R[-1]C"
       End If

       'replace formulas with values
       With .Cells(1, col).EntireColumn
           .Value = .Value
       End With

    End With

    End Sub


    Posted by ibeckett on Monday, March 09, 2009 2:02 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    SSRS 2008 Report Builder 2.0

    With Reporting Services 2008 came a new report authoring tool geared towards business & power users.  The tool is called Report Builder 2.0, and is available as a standalone download. I have to say this tool works really well with Analysis Services 2008 cubes. You can browse the cubes just like you do in SQL Management Studio cube browser, and can even view/copy the MDX generated by the designer.  Report Builder has been a nice addition to my toolbox.

    You can download Report Builder 2.0 here: http://www.microsoft.com/downloads/details.aspx?familyid=9f783224-9871-4eea-b1d5-f3140a253db6&displaylang=en

    And here is some good but outdated background info from one of the members of the SSRS team at MS: http://blogs.msdn.com/bwelcker/archive/2007/12/11/transmissions-from-the-satellite-heart-what-s-up-with-report-builder.aspx

    Posted by ibeckett on Thursday, March 05, 2009 3:22 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    check if CDC is enabled in SQL 2008

    Change Data Capture (CDC) is disabled by default in SQL 2008.  To check if it is enabled for a given DB use this SELECT:

    -- if column is_cdc_enabled exists in the result, then CDC is enabled for the database

    select name, is_cdc_enabled from sys.databases


    Posted by ibeckett on Saturday, February 28, 2009 4:23 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    Light weight photo shop... Paint.NET

    Lately I've been trying to improve my graphics skills but photoshop CS4 gives me a GUI headache.  I've ended up using Paint.NET (http://www.getpaint.net/download.html) a lot for simple web effects stuff.  It's nice to have an easy to use and powerful graphics program that will run swiftly even on a 5 year old lap top.

    Posted by ibeckett on Thursday, February 12, 2009 2:53 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    End of beta is in sight for Windows 7

    Microsoft has confirmed that it will not be releasing any more beta versions of Windows 7, with the next release likely to be the first release candidate of the eagerly anticipated operating system.

    The successor to Vista has been very well received since it arrived in beta, which will come as an almighty relief to Microsoft after the failure of Vista to hit the heights that were expected for it.....

    -http://www.techradar.com/news/software/end-of-beta-is-in-sight-for-windows-7-516516


    Posted by ibeckett on Monday, February 02, 2009 5:49 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    View a pivot table's underlying MDX query in Excel

    After running these scripts you can easily view the underlying MDX query for any pivot table that uses a SSAS cube for its datasource:
     

    Use the following script to add a show MDX Query option when you right click a pivot table in Excel 2007:

    Private Sub Workbook_Open()
       Dim ptcon As CommandBar
       
        Set ptcon = Application.CommandBars("PivotTable context menu")

    insertDisplayMDX:
       Dim cmdMdx As CommandBarControl
       For Each btn In ptcon.Controls
           If btn.Caption = "MDX Query" Then GoTo doneDisplayMDX
       Next btn
      
       ' Add an item to the PivotTable context menu.
       Set cmdMdx = ptcon.Controls.Add(Type:=msoControlButton, temporary:=True)
      
       ' Set the properties of the menu item.
       cmdMdx.Caption = "MDX Query"
       cmdMdx.OnAction = "DisplayMDX"
          
    doneDisplayMDX:

    End Sub 



    And put this in a seperate module:
    Sub DisplayMDX()
        Dim mdxQuery As String
        Dim pvt As PivotTable
        Dim ws As Worksheet
      
        Set pvt = ActiveCell.PivotTable
        mdxQuery = pvt.MDX
       
        ' Add a new worksheet.
        Set ws = Worksheets.Add
        ws.Range("A1") = mdxQuery
    End Sub

    Works great!

    The code comes from http://sqljunkies.com/WebLog/sqlbi/archive/2007/01/18/26875.aspx


    Posted by ibeckett on Sunday, February 01, 2009 6:04 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    SQL server currently runing queries

    This code provides you with a list of queries that are currently running on the SQL server:

    SELECT sqltext.TEXT,
    req.session_id,
    req.status,
    req.command,
    req.cpu_time,
    req.total_elapsed_time
    FROM sys.dm_exec_requests req
    CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS sqltext

    source


    Posted by ibeckett on Sunday, January 11, 2009 4:59 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    find out which tables are referenced by a stored procedure

    Use this script to get a list of tables that are referenced in a stored procedure.  Just replace the value set for the variable "@sproc" to the name of the sproc you are evaluating:

    declare @sproc varchar(8000)

    set @sproc='spMyStoredProc'

    CREATE TABLE #endchars (endchar char(1))

    INSERT INTO #endchars (endchar)

    select ' ' union select ')' union select ']' union select ';'
    union select char(9) union select char(10) union select char(13)

    select so.name
    from sysobjects so, syscomments sc, #endchars ec
    where so.type='U'
        and object_name(sc.id)=@sproc
    group by so.name
    having sum(charindex(so.name+ec.endchar ,sc.text+' '))<>0
    order by name

    DROP TABLE #endchars

    source: http://www.sqlservercentral.com/scripts/SQL+Server+2000/65162/


    Categories: SQL 2000 | SQL 2005 | SQL 2008
    Posted by ibeckett on Tuesday, December 30, 2008 12:40 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    beware of case sensitivity on lookup transforms in SSIS 2005

    The Lookup transformation in SSIS is case sensitive.  "ABC" will not be matched to "abc".  There is no option to change this behavior.

    There are a few ways to get around this:

    1. change the case of your source & lookup columns using UPPER() or LOWER() T-SQL function, or an SSIS function in a derived column transform.
    2. Disable caching by setting "Enable Memory Restriction" to true on the advanced tab for the lookup transform. This will force SQL server to do the comparison rather than SSIS.  This may cause OR improve performance problems depending on the situation.

    Tags: ,
    Categories: SQL 2005
    Posted by ibeckett on Saturday, November 08, 2008 5:14 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    where is Activity Monitor in SQL 2008?

    Turns out it has been moved.  To open the new Activity Monitor you either right click a database and select 'Activity Monitor', or you click the icon that looks like a chart on the far right of SSMS.

    Tags: ,
    Categories: SQL 2008
    Posted by ibeckett on Thursday, October 23, 2008 12:43 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    Using the DATE data type in SQL 2008

    Great introduction to the DATE data type (different from DATETIME)...

    http://www.sqlteam.com/article/using-the-date-data-type-in-sql-server-2008


    Posted by ibeckett on Saturday, October 18, 2008 6:08 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    Extracting data from SSAS using SSIS in SQL 2005

    http://geekswithblogs.net/darrengosbell/archive/2006/04/26/76418.aspx

    Step 1: Add the SSAS server as a linked server.

    Step 2: Use OpenQuery clause in SELECT statement to write MDX query that will be the data source within a data transfer task in SSIS.


    Categories: SQL 2005
    Posted by ibeckett on Saturday, October 18, 2008 12:30 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    Data Profile Viewer in SQL 2008

    http://www.sqlservercentral.com/articles/Integration+Services/64133/

    great introduction to Data Profile Viewer in SQL 2008.... the gist of it is that you use an SSIS task to create an xml profile that can be loaded into the "Data Profile Viewer" to analyze the metadata.


    Posted by ibeckett on Thursday, October 09, 2008 6:20 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    Change Data Capture in SQL Server 2008

    Basics of change data capture (CDC) in SQL 2008: http://msdn.microsoft.com/en-us/library/cc645937.aspx

    This is a great introduction to the CDC capabilities of SQL 2008.  It's part of the larger CDC topic covered in BOL: http://msdn.microsoft.com/en-us/library/bb522489.aspx


    Categories: SQL 2008
    Posted by ibeckett on Wednesday, October 01, 2008 12:07 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    Passed the 70-431 SQL 2005 MCTS certification exam today

    I passed the 70-431 exam today and I now have my MCTS (certified technology specialist) title!  :)

    here's more info on the exam: http://www.microsoft.com/learning/en/us/exams/70-431.aspx


    Posted by ibeckett on Wednesday, October 01, 2008 4:36 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    Excel 2007 connections in SSIS 2005

    If you want to interact with Excel 2007 file formats in SSIS 2005 don't bother with the Excel connection component. Setup your connections using Microsoft Office 12.0 Access OLE DB Provider and set extended properties to Excel 12.0....

    While you can use an Excel connection manager to connect to a data source that uses Microsoft Office Excel 2003 or earlier, you cannot use an Excel connection manager to connect to a data source that uses Microsoft Office Excel 2007. Also, you cannot use the Microsoft Jet 4.0 OLE DB Provider to connect to an Excel 2007 data source. To connect to an Excel 2007 data source, use an OLE DB connection manager, and for Provider, select Microsoft Office 12.0 Access Database Engine OLE DB Provider. Then, on the All page of the Connection Manager dialog box, for Extended Properties, enter Excel 12.0.

    To load data from or to an Excel 2007 data source, use an OLE DB source or an OLE DB destination, respectively. You cannot use an Excel source or Excel destination to connect to an Excel 2007 data source. 

    source:http://msdn.microsoft.com/en-us/library/ms139836(SQL.90).aspx

     

     


    Posted by ibeckett on Friday, August 22, 2008 7:38 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    windows update fails

    Running the below commands will fix your windows update issues on XP/2003 almost every time.  This advice is repeated all over the web, not sure where the original source is.

    Click Start, click Run, type cmd, and then click OK.
    Copy and paste each of the following commands. Press ENTER after each command.

    regsvr32 wuapi.dll
    regsvr32 wuaueng.dll
    regsvr32 wuaueng1.dll
    regsvr32 wucltui.dll
    regsvr32 wups.dll
    regsvr32 wups2.dll
    regsvr32 wuweb.dll

    After reregistering the dll's try microsoft update again!


    Posted by ibeckett on Wednesday, July 16, 2008 6:06 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    SQL Server Sample Databases; AdventureWorks, Northwind, etc.

    I keep losing these so here are the links to fresh copies... for safe keeping Wink

    Northwind and pubs Sample Databases for SQL Server 2000

    http://www.microsoft.com/downloads/details.aspx?FamilyID=06616212-0356-46A0-8DA2-EEBC53A68034&displaylang=en

     

    SQL Server 2005 Samples and Sample Databases

    http://www.microsoft.com/downloads/details.aspx?familyid=E719ECF7-9F46-4312-AF89-6AD8702E4E6E&displaylang=en

     

     


    Posted by ibeckett on Wednesday, July 09, 2008 4:54 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    Spool operators in recursive query plans

    Nice article on reading recursive query execution plans in SQL 2005...

    http://blogs.msdn.com/sqltips/archive/2007/08/30/spool-operators-in-query-plan.aspx


    Posted by ibeckett on Monday, June 02, 2008 4:45 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    check for index fragmentation in SQL 2005

    Query to check for index fragmentation in SQL 2005 (shoot for below 10% fragmentation):

    -- Replace "YourDatabase" and "YourTable" with your specfic object names

    USE YourDatabase

    SELECT  CAST(DB_NAME(DATABASE_ID) AS VARCHAR(20)) AS 'DatabaseName',
     CAST(OBJECT_NAME([OBJECT_ID]) AS VARCHAR(20)) AS 'TableName',
     INDEX_ID,
     CAST(INDEX_TYPE_DESC AS VARCHAR(20)) AS INDEX_TYPE_DESC,
     AVG_FRAGMENTATION_IN_PERCENT   
    FROM   SYS.DM_DB_INDEX_PHYSICAL_STATS (DB_ID('YourDatabase'),OBJECT_ID('dbo.YourTable'),NULL,NULL,NULL );


    Posted by ibeckett on Friday, May 30, 2008 4:14 PM
    Permalink | Comments (1) | Post RSSRSS comment feed

    Page Scraping Options

    I am working on some fun expiriments in data collection that will require massive automated page scraping... below is a quick list of initial web research resources.

    Page scrape in ASP.NET: http://www.4guysfromrolla.com/webtech/070601-1.shtml 

    "Web Scrape" free page scrape utility: http://www.webscrape.com/

    External links (from http://en.wikipedia.org/wiki/Screen_scraping)

  • PHP & cURL Screen Scraping Tutorials
  • PHP scraping Web site about web scraping using PHP
  • Data extraction for Web 2.0: Screen scraping in Ruby/Rails - Article about web scraping using Ruby
  • Screen-scraping with WWW::Mechanize - Article about web scraping using Perl
  • How to write screen scrapers - Article on writing Javascript-based screen scrapers
  • Creating XML Web Services That Parse the Contents of a Web Page - Microsoft MSDN article
  • Three common methods for data extraction - Article from a blog about Screen Scraping
  • FEAR-less Site Scraping - An article about how to do screen scraping using FEAR::API
  • Web scraping with Java - Article about web scraping using the Java programming language (requires commercial library)
  • Web scraping with PHP and Tcl - Articles about web scraping using PHP and Tcl
  • TTSS. Rapid implimentation of Scanning systems. Since 1991 Inovators in Scanning Airlines and Tour Operators Systems
  • Techreform - web scraping - A commercial provider of web scraping services based in the United Kingdom
  • OutWit Technologies - Publishers of a Web Collection Engine for Firefox
  • Piggy Bank - A joint project by W3C and MIT

  • Posted by ibeckett on Friday, May 30, 2008 2:55 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    analytic functions introduced with SQL 2005

    New Analytic Functions

    Several new analytic functions provide basic analytic capabilities within Transact-SQL. These functions will be useful in data warehouses that allow user queries into the relational database rather than exclusively through Analysis Services. Also, these complex calculations are commonly used during data staging to develop valuable data attributes.

    ROW_NUMBER. Returns the sequential row number of the result set.

    RANK. Returns the rank of rows in a result set. RANK would be identical to ROW_NUMBER on an ordered set, but for the treatment of rows that tie. All rows with the same ordered value receive the same rank. The next rank matches up with the ROW_NUMBER again. In other words, if there is a two-way tie for first place, rows one and two receive RANK=1, and row three receives RANK=3. No rows receive RANK=2.

    DENSE_RANK. Returns the rank of rows in a result set. The DENSE_RANK function is similar to RANK, but squeezes out the gaps left by the RANK function. In the sample above, rows one and two receive RANK=1, and row three receives RANK=2.

    NTILE. Divides an ordered set into the specified number of groups of approximately equal size.

    source: http://www.microsoft.com/technet/prodtechnol/sql/2005/dwsqlsy.mspx


    Posted by ibeckett on Thursday, May 29, 2008 5:31 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    What steps are required to prepare a database for initiation of a mirroring session in SQL 2005?

    1.       Identify the Principal, Mirror, and Witness 

    2.       Create a certificate for authentication between the end points on the Principal/Mirror 

    3.       Create the end points on the Principal/Mirror 

    4.       Set the Principal and Mirror recovery models to "Full" or else you will get an error 

    5.       Ensure that the Principal and Mirror are synchronized by backing up the Principal and applying the backup to the mirror using the "no recovery" option


    Posted by ibeckett on Tuesday, May 20, 2008 4:08 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    FTP component fails in SSIS 2005 even though the connection manager appears to be working

    Problem: FTP component fails with error "unable to connect" even though when testing the connection manager you are able to connect.

    Solution:
    1. Add "SSIS Debug Host" to firewall exceptions

    2. Add visual studio / BIDS to firewall exceptions

    3. Make sure package security property "ProtectionLevel" is set to some setting that will keep the FTP password encrypted (anything other than "DontSaveSensitive").  If you have it set to the common option "DontSaveSensitive" then your FTP task will fail.

    Tags: ,
    Categories: SQL 2005
    Posted by ibeckett on Monday, May 05, 2008 10:31 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    accessing SharePoint document libraries using UNC in Windows Server 2003

    Recently I wrote a .net console script to automate some stuff in Excel and part of the script includes uploading all of the contents of a given directory to a SharePoint document library.  After moving the script to production it did not work. Turns out that you need to have the WebClient service enabled. This service is disabled by default in Server 2003 so you will need to set it to Automatic or Manual and then start the service.

    After starting the WebClient service you can access the SharePoint library like: \\sharepoint\site1\documentlibrary


    Posted by ibeckett on Sunday, May 04, 2008 5:19 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    be sure to kill rogue processes when debugging SSIS packages in BIDS 2005

    Recently I have been dealing with a very annoying issue when debugging large SSIS packages using busines intelligence development studio.  Child packages called from parent package will fail randomly with an error something like "package already being used or locked by another process".  Turns out the solution is to kill left over rogue processes that may still be running from prior executions.

    Jamie Thompson at blogs.conchango.com explains:

    Packages in BIDS are executed by a process called DtsDebughost.exe. Child packages called from there are executed by dtshost.exe. These are managed processes and can sometimes be left as running processes (viewable in Task Manager) after the packages have actually completed. I'm guessing this is because they are waiting for garbage collection.
    Anyway, I am guessing these might be the problem. You could kill the processes manually if they are causing a problem.

    May 1, 2008 16:18 

     source: http://blogs.conchango.com/jamiethomson/archive/2005/05/16/1414.aspx?CommentPosted=true#commentmessage


    Posted by ibeckett on Thursday, May 01, 2008 1:22 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    XML in 10 points

    XML, XLink, Namespace, DTD, Schema, CSS, XHTML ... If you are new to XML, it may be hard to know where to begin. This summary in 10 points attempts to capture enough of the basic concepts to enable a beginner to see the forest through the trees. And if you are giving a presentation on XML, why not start with these 10 points?

    http://www.w3.org/XML/1999/XML-in-10-points.html


    Categories: XML
    Posted by ibeckett on Thursday, May 01, 2008 7:40 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    how to specify which source fields to display in drillthrough reports for report models developed using SSRS 2005

    Took me a while to figure out how to do this.  I was really pulling my hair out and then the solution turned out to be so simple!

    Problem:  Reports generated using SSRS 2005 Report Builder (ad hoc) based on Report Models developed using SSRS 2005 BIDS have a really neat drillthrough capability that allows end users to click an aggregate in the data region of a matrix report in order to drill down to the details behind that number.  By default the Report Model wizard attempts to choose which columns should be displayed in the drillthrough report for you, but it does not always pick the fields that you would like it to. 

    Solution: In this situation you need to manually choose which fields to include in the drillthrough report.  The mistake I made was in assuming that the "include in drillthrough report" indicator would be a property at the attribute level within a Report Model, something you could set true/fales for each source field.  As it turns out you manage this via a collections property named "DefaultDetailAttributes" at the Query object level.  See screen shot:

    report model example

    Model Designer Object Properties: http://msdn.microsoft.com/en-us/library/ms159611.aspx 

    Model Designer Query Properties: http://msdn.microsoft.com/en-us/library/ms157375.aspx


    Posted by ibeckett on Tuesday, April 29, 2008 4:46 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    configure drill through reports to open in a new window in SSRS 2005 using JavaScript

    this is a nice tutorial explaining how to hack SSRS 2005 using JavaScript to make drillthrough reports open in a new browser window rather than overlaying the parent report.

    http://www.mssqltips.com/tip.asp?tip=1283


    Posted by ibeckett on Monday, April 28, 2008 2:54 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    SSRS 2005 Export Control - How to add or remove entries from the export list (excel, pdf, csv, etc.)

    In the RSReportServer.config file there is a <render> section.  This is where you specify which options will show up in the export control list within the report viewer UI.

    source: http://forums.asp.net/p/1239637/2260726.aspx


    Posted by ibeckett on Tuesday, April 22, 2008 5:23 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    What does the "Network Interface/Output Queue Length" counter in System/Perf Monitor measure?

    It measures the number of packets waiting to be sent back to clients.  A value greater than 2 represents a potential network bottleneck.

    source: these 2 basic sentences are repeated over and over on different sites all over the web, I'm not sure what the original source is Frown


    Posted by ibeckett on Tuesday, April 22, 2008 3:02 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    Using SQL Profiler, which trace event can be used to find the execution duration of each statement executed within a sproc?

    StoredProcedures\SP:StmtCompleted

    source: http://msdn2.microsoft.com/en-us/library/ms175481.aspx


    Posted by ibeckett on Sunday, April 13, 2008 6:31 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    what versions of SQL 2005 allow you to configure a transactional replication publication?

    any version except for Express edition

     source: http://msdn2.microsoft.com/en-us/library/ms143761.aspx


    Posted by ibeckett on Saturday, April 12, 2008 2:33 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    What trace events can be used in SQL Server Profiler to detect a missing index?

    1. Scans\Scans Started - this event is triggered whenever a table or index scan begins, if it shows as a table scan then the table is missing an index.
    2. Performance\Autostats - this event is triggered whenever SQL Server has to create statistics in order to improve query performance.  Statistics are only created if there is not an existing index that can be used to boost efficiency.

    books online source: http://msdn2.microsoft.com/en-us/library/ms175481.aspx


    Posted by ibeckett on Saturday, April 12, 2008 1:02 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    What permissions are required in order for a user to create a user defined data type?

    1. ALTER permission on the schema
    2. CREATE TYPE permissions on the database
    3. REFERENCES permission on the registered assembly being used for the user defined type.

    books online source: http://msdn2.microsoft.com/en-us/library/ms175007.aspx


    Posted by ibeckett on Saturday, April 12, 2008 12:57 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    How do you setup a logical backup device on a USB hard drive?

    Use the sp_dumpdevice system stored procedure.  For example (after mounting the USB drive as "g"):

     EXEC sp_addumpdevice 'disk', 'mydiskdump', 'g:\dump\dump1.bak';

    source: http://msdn2.microsoft.com/en-us/library/ms188409.aspx


    Posted by ibeckett on Saturday, April 12, 2008 12:41 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    What is required for a mirroring session to provide automatic failover in SQL 2005?

    The session must be configured for High Availability operating mode, which provides synchronous data transfer between the primary and secondary (principal/mirror) servers, and which also requires a third server (witness) to handle the failover process.

     books online source: http://msdn2.microsoft.com/en-us/library/ms178104.aspx


    Posted by ibeckett on Saturday, April 12, 2008 9:08 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    how are deadlock victims selected in SQL 2005?

    By default, the Database Engine chooses as the deadlock victim the session running the transaction that is least expensive to roll back. Alternatively, a user can specify the priority of sessions in a deadlock situation using the SET DEADLOCK_PRIORITY statement

    books online source: http://msdn2.microsoft.com/en-us/library/ms178104.aspx


    Posted by ibeckett on Saturday, April 12, 2008 8:49 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    What's the best way to alert admin when running out of disk space?

    You can use system/performance monitor to define an alert, then set the alert to notify admin.

    url to MS KB source article: http://support.microsoft.com/kb/324796


    Posted by ibeckett on Friday, April 11, 2008 6:35 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    what are some things to keep in mind when using the pivot operator in SQL 2005?

    • you cannot return non aggregate data with pivoted columns
    • you have to specifiy a derived table to pivot on
    • pivot operator does not allow dynamic columns
    • pivot operator does not allow multiple types of aggregation within a single operation

    books online source: http://msdn2.microsoft.com/en-us/library/ms177410.aspx


    Posted by ibeckett on Friday, April 11, 2008 6:28 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    what methods can be used to perform side by side upgrade without affecting database availability?

    1. you can use SQL Management Objects Copy Database Wizard
    2. you can do an online backup and restore
    3. you can manually copy the database files

    books online for sp_detach_db: http://msdn2.microsoft.com/en-us/library/ms188031.aspx

    books online for how to detach using management studio: http://msdn2.microsoft.com/en-us/library/ms191491.aspx

    books online for copy datanase wizard: http://msdn2.microsoft.com/en-us/library/ms188664.aspx

     


    Posted by ibeckett on Friday, April 11, 2008 5:28 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    adding partitioned indexes in SQL 2005

    when creating partitioned indexes in sql 2005 the ON clause must reference the partition scheme

    books online URL discussing indexes: http://msdn2.microsoft.com/en-us/library/ms188783.aspx


    Posted by ibeckett on Friday, April 11, 2008 5:18 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    Which versions of SQL Server can be directly upgraded to SQL Server 2005?

    SQL 7.0 and SQL 2000 can both be directly upgraded to SQL 2005.  SQL 6.5 cannot be directly upgraded to SQL 2005.

     books online source: http://msdn2.microsoft.com/en-us/library/ms143695.aspx


    Posted by ibeckett on Friday, April 11, 2008 4:10 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    What does the Processor\% Processor Time counter within System Monitor indicate?

    It's a measure of how much time a processor is spending executing threads.  A high % Processor Time can be an indication of performance issues, but by itself cannot definitively verify performance issues.

    books online source for more info on objects and counters to monitor activity: http://msdn2.microsoft.com/en-us/library/ms190382.aspx


    Posted by ibeckett on Friday, April 11, 2008 4:05 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    What types of events can trigger execution of a SQL Server Agent Job?

    You can schedule a job to run:

    • Whenever SQL Server Agent starts.
    • Whenever CPU utilization of the computer is at a level you have defined as idle.
    • One time, at a specific date and time.
    • On a recurring schedule.

    books online source: http://msdn2.microsoft.com/en-us/library/ms175138.aspx


    Posted by ibeckett on Friday, April 11, 2008 4:01 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    Which types of schedules are required for log shipping in SQL Server 2005?

    You need to setup Backup, Copy, and Restore schedules for log shipping in SQL Server 2005.

    URL to books online article "Understanding Log Shipping": http://msdn2.microsoft.com/en-us/library/ms187103.aspx


    Posted by ibeckett on Friday, April 11, 2008 3:48 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    go to this site to register for a microsoft certification exam

    I am about to go for my first certification... the url to go to if you want to register for an exam is:

    http://www.microsoft.com/learning/mcpexams/register/default.mspx


    Posted by ibeckett on Wednesday, April 09, 2008 4:19 PM
    Permalink | Comments (0) | Post RSSRSS comment feed

    SSRS 2005 Data Model Wizard: Data is Null. This method or property cannot be called on Null values.

    Data is Null. This method or property cannot be called on Null values. 

    Recently received this error while playing with Report Models in SQL 2005 Reporting Services.  Turns out you get this error if you have partitioned tables in your database which do not have unique clustered indexes.  Adding the indexes fixes the error in BIDS. 

    In my case the partitioned table was a test table that was not even really needed.

    credit: http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=3101589&SiteID=17


    Posted by ibeckett on Friday, April 04, 2008 3:59 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    tool for testing web services (such as SQL End Points)

    http://www.soapui.org/

    soapUI; the Web Services Testing tool.

    soapUI is tool for Web Service Testing. With more than 300 000 downloads, it's the most used tool for SOA testing in the world.

    soapUI is Free and Open Source and is used for Inspecting Web Services, Invoking Web Services, Developing Web Services, Web Service Simulation and Web Service Mocking and Functional Testing of Web Services Load Testing of Web Services over HTTP.


    Posted by ibeckett on Monday, March 31, 2008 5:26 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    sliding window partition swapping

    Download:
    Project Description
    Sliding Window technique is commonly used with partitioned tables to manage large data volumes. It allows efficient loading of new data and archival or removal of the old data. The challenges in a sliding window scenario is to create the staging table(s) correctly for efficient partition SWITCH operations. This utility provides a command line interface to:

    1. Remove all the data from one partition by switching it out to a staging table. It creates the required staging table.
    2. Create a staging table for loading data into a partition. The staging table can be created with or without indexes -- if created without indexes this utility provides a separate command to create appropriate indexes on the staging table, before SWITCHing it into the partitioned table.

    The commands can be invoked from other scripts for end-to-end sliding window scenarios.

    Refer to the attached readme.htm file for more details and command syntax.

    Posted by ibeckett on Monday, March 31, 2008 5:15 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    adding http namespaces for end points

    HOWTO: The user '{whatever}' does not have permission to register endpoint '{whatever}' on the specified URL

    Cause: This happens when you try to create an HTTP ENDPOINT in SQL Server 2005 because the SQL Server process lacks permissions to register the endpoint with HTTP.SYS.

    Fix: Issue the following command before executing the CREATE ENDPOINT

    EXEC sp_reserve_http_namespace N'http://{hostname}:{port}/{path}'

    credit: http://sqljunkies.com/WebLog/ktegels/archive/2005/04/14/11616.aspx


    Categories: SQL 2005
    Posted by ibeckett on Monday, March 31, 2008 5:10 AM
    Permalink | Comments (0) | Post RSSRSS comment feed

    TableDifference version 2.0 released!!

    I just caught this (almost a month late) but TableDifference 2.0 by Alberto Ferrari has been released!  This is a great custom component for SQL 2005 Integration Services.  It is used within a dataflow step and the component accepts two inputs; one for "old" data (the existing table) and another for "new" data (new incoming rows).  The component compares rows from the two streams and provides output paths such as "new", "updated", "deleted", "unchanged", as well as any custom outputs you define. 

     There were a number of bugs in version 1x that have hopefully been resolved in v2. I really look forward to using this tool!

    http://www.sqlbi.eu/ - home of TableDifference SSIS component

     Here is the official annoucement:

    Table Difference 2.0 is ready

    Guys,

    The new version 2.0 of TableDifference is finished and available in the download area.

    The zip file contains both the DLL and complete sources. Moreover, in the sources folder there is a README.DOCX document that explains how to use the new features of the component, so I will not discuss them here.

    Main features are:

    User interfaces completely rewritten and made much more user-friendly
    Ability to disable output flows and/or single columns in the outputs
    Ability to ignore case in string comparisons
    Some speed improvement (haven't tested it carefully but it seems faster. :))
    Have a good download and don't be afraid to ask if something is going wrong.

    Alberto


    Posted by ibeckett on Monday, March 31, 2008 3:08 AM
    Permalink | Comments (0) | Post RSSRSS comment feed