<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>SharePoint Branding and Desing - Tom Wilson</title>
	
	<link>http://styledpoint.com/blog</link>
	<description>A blog about Design, ASP.Net, Microsoft SharePoint, HTML, CSS and Javscript</description>
	<lastBuildDate>Thu, 21 Jan 2010 20:46:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/StyledPoint" /><feedburner:info uri="styledpoint" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Developing for SharePoint 2010 with jQuery Intellisense and more!</title>
		<link>http://feedproxy.google.com/~r/StyledPoint/~3/_3yq9607UNA/</link>
		<comments>http://styledpoint.com/blog/developing-for-sharepoint-2010-with-jquery-intellisense-and-more/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 20:44:56 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://styledpoint.com/blog/?p=155</guid>
		<description><![CDATA[
Do  you ever have days when you sit back, take a breath and ponder just how rudimentary SharePoint Designer can feel when compared with a real IDE?
I know I do and it&#8217;s this very thought that compelled me to search for an alternative. What I ended up with was a quick and easy setup that [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://styledpoint.com/blog/wp-content/uploads/2010/01/title-jqueryr.png"><img class="alignnone size-full wp-image-172" title="title-jqueryr" src="http://styledpoint.com/blog/wp-content/uploads/2010/01/title-jqueryr.png" alt="" width="460" height="101" /></a></p>
<p>Do  you ever have days when you sit back, take a breath and ponder just how rudimentary SharePoint Designer can feel when compared with a real IDE?</p>
<p>I know I do and it&#8217;s this very thought that compelled me to search for an alternative. What I ended up with was a quick and easy setup that allows me to have code collapse,  better syntax highlighting and jQuery Intellisense when I need to do some serious JavaScript editing.</p>
<p><span id="more-155"></span>Before I explain I want to make something clear. This is not for everyone. SharePoint Design is great for everything and anything SharePoint. It handles Wysiwyg editing, Web Part creation and much more, but some times I spend days upon days on just html, css and javascript. All I need is access to my layouts and branding files. If this sounds like you, keep on reading.</p>
<p>I have been using Visual Studio 2008 /2010 to edit files stored in my SharePoint Content database by simply mapping my Site Collection&#8217;s WebDAV to a drive! Follow these steps and you can too!</p>
<p><img class="alignnone size-full" title="Capture1" src="http://styledpoint.com/blog/wp-content/uploads/2010/01/Capture1.png" alt="" width="134" height="57" /><em> </em></p>
<p><em>1) Map a network Drive</em></p>
<p><em><br />
</em></p>
<p><img class="size-full alignnone" title="Capture1" src="http://styledpoint.com/blog/wp-content/uploads/2010/01/Capture2.png" alt="" width="520" height="360" /></p>
<p><em>Enter your SharePoint site&#8217;s address and make sure you login with the SharePoint creds</em></p>
<p><em><br />
</em></p>
<p><img class="alignnone size-full" title="Capture1" src="http://styledpoint.com/blog/wp-content/uploads/2010/01/Capture3.png" alt="" /></p>
<p><em>In Visual Studio open a website</em></p>
<p><img class="alignnone size-full" title="Capture1" src="http://styledpoint.com/blog/wp-content/uploads/2010/01/Capture5.png" alt="" /></p>
<p><em>If you need to access a hidden folder simply type it and click open</em></p>
<p><em><br />
</em></p>
<p><img class="alignnone size-full" title="Capture1" src="http://styledpoint.com/blog/wp-content/uploads/2010/01/Capture6.png" alt="" /></p>
<p><em>Tada! SharePoint files from a content database in Visual Studio!</em></p>
<p><em><br />
</em></p>
<p><img class="alignnone size-full" title="Capture1" src="http://styledpoint.com/blog/wp-content/uploads/2010/01/Capture7.png" alt="" /></p>
<p><em>To add additional folders simply click the solution and &#8220;add&#8221; an &#8220;existing web site&#8221;</em></p>
<p><em><br />
</em></p>
<p><img class="alignnone size-full" title="Capture1" src="http://styledpoint.com/blog/wp-content/uploads/2010/01/Capture8.png" alt="" /></p>
<p><em>Here you can see 3 sites added. Instead of including the root directory I just mapped the 3 I would be using.</em></p>
<p><em>Now what about jQuery Intellisense?</em></p>
<p><img class="alignnone size-full" title="Capture1" src="http://styledpoint.com/blog/wp-content/uploads/2010/01/Capture9.png" alt="" /></p>
<p><em><a href="http://docs.jquery.com/Downloading_jQuery">Download</a> the most current &#8220;Documentation: Visual Studio&#8221; on the<a href="http://docs.jquery.com/Downloading_jQuery"> jQuery website.</a></em></p>
<p><em>Include it in Javascript Directory. And add the following refrence at the top of your Javascript files.</em></p>
<p><img class="alignnone size-full" title="Capture1" src="http://styledpoint.com/blog/wp-content/uploads/2010/01/Capture10.png" alt="" /></p>
<p><em>Look! Intellisense on a JavaScript File located in the SharePoint Content Database!</em></p>
<p><img class="alignnone size-full" title="Capture1" src="http://styledpoint.com/blog/wp-content/uploads/2010/01/Capture11.png" alt="" /></p>
<p><em>You can even open Page Layouts, Edit and save.</em></p>
<p><img class="alignnone size-full" title="Capture1" src="http://styledpoint.com/blog/wp-content/uploads/2010/01/Capture12.png" alt="" /></p>
<p>Unfortunatly you can&#8217;t open Master Pages. But CSS and aspx pages are ok!</p>
<img src="http://feeds.feedburner.com/~r/StyledPoint/~4/_3yq9607UNA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://styledpoint.com/blog/developing-for-sharepoint-2010-with-jquery-intellisense-and-more/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://styledpoint.com/blog/developing-for-sharepoint-2010-with-jquery-intellisense-and-more/</feedburner:origLink></item>
		<item>
		<title>Ribbon Customization: Changing Placement, Look and Behavior</title>
		<link>http://feedproxy.google.com/~r/StyledPoint/~3/19EvpSuK5Dw/</link>
		<comments>http://styledpoint.com/blog/ribbon-customization-changing-placement-look-and-behavior/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 16:48:13 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://styledpoint.com/blog/?p=97</guid>
		<description><![CDATA[
One of the biggest features of SharePoint 2010 is the Office Ribbon. Whether you love it or hate it, it&#8217;s here to stay and eventually you will be faced with the choice of including the ribbon within your site branding. What can be edited and changed in the ribbon? Microsoft spent millions, if not billions of [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://styledpoint.com/blog/ribbon-customization-changing-placement-look-and-behavior/"><img class="aligncenter size-full wp-image-139" title="title-customribbon" src="http://styledpoint.com/blog/wp-content/uploads/2010/01/title-customribbon.png" alt="" width="460" height="230" /></a></p>
<p>One of the biggest features of SharePoint 2010 is the Office Ribbon. Whether you love it or hate it, it&#8217;s here to stay and eventually you will be faced with the choice of including the ribbon within your site branding. What can be edited and changed in the ribbon? Microsoft spent millions, if not billions of dollars to research and develop the ribbon so how much should we change?</p>
<p>Just because we can&#8230;does it mean we should?</p>
<p><span id="more-97"></span>I was recently at a meeting with one of our clients and a Microsoft rep. The client was having a hard time grasping the concept of the SharePoint Ribbon and its role in editing, administering and browsing a site.  The discussion went back forth. Eventually everything was sorted out but it got me thinking&#8230;the new ribbon is quite the mental hurdle and this discussion is bound to repeat itself as 2010 adoption grows.</p>
<p>I also realized the impact that the ribbon is going to have on branding. With SharePoint 2007, if you had the skills, you could essentially make SharePoint look any way your heart desired. As long as you included the &#8220;site actions&#8221; and other essential one click menus you could design and layout SharePoint as you wished.</p>
<p>In SharePoint 2010, the ribbon is static at the top the screen and it never scrolls. It plays a massive part in usability and administration. I am always on the quest to customize SharePoint to a point beyond recognition, but how far can I alter the ribbon?</p>
<p><strong>My Mission</strong>: To brand a 2010 site to my hearts content AND alter the look and feel of the ribbon making sure that it retains all previously established functionality and usability.</p>
<p><strong>The Rules:</strong> Just using CSS, Javascript and a custom Master Page. No Server Side Code. I&#8217;m not adding functionality. I&#8217;m just altering the look and feel.</p>
<p><a href="http://styledpoint.com/blog/wp-content/uploads/2010/01/newdesign.jpg"><img class="aligncenter size-full wp-image-100" title="newdesign" src="http://styledpoint.com/blog/wp-content/uploads/2010/01/newdesign.jpg" alt="" width="460" height="262" /></a></p>
<p><strong><br />
The Design:</strong>Whoa!  What did I do?! The ribbon isn&#8217;t at the top! What&#8217;s the reason for this? Well&#8230; I wanted to put more emphasis on the sites title and navigation; separating the two. This will allow my creativity to flourish because the ribbon is now it&#8217;s own entity. I can now focus on the design of the site as if it were a typical website; not having to worry about about my design functionality and its ability to mesh with the fixed ribbon on the top.</p>
<p><img class="aligncenter size-full wp-image-101" title="ribbon comparison-layout" src="http://styledpoint.com/blog/wp-content/uploads/2010/01/ribbon-comparison-layout.jpg" alt="" width="460" height="304" /></p>
<p><em>This image illustrates how I have removed the content from the &#8220;browse&#8221; tab and made it static, above the ribbon. If you were to click the browse button the ribbon will now just collapse. </em></p>
<p><em><img class="aligncenter size-full wp-image-106" title="ribbon comparison" src="http://styledpoint.com/blog/wp-content/uploads/2010/01/ribbon-comparison.jpg" alt="" width="460" height="287" /></em></p>
<p><em>As far as the design of the ribbon goes, I have just changed the colours, added the ruler background and rounded the corners all in an effort to align it with the look and feel I have chosen for the rest of the site.</em></p>
<p><strong>Changing the Position of the Ribbon: </strong>I know that changing the placement of the ribbon seems like a daunting task, but in reality it&#8217;s just the tabs and actions of the ribbon in two controls. There are other items in the default ribbon and they do include the nav and title but once you understand what each control does, it&#8217;s not hard to pick it apart and move the pieces around.</p>
<p>Here is a breakdown of the essential controls laid out to better understand how it all works:</p>
<div style="width: 440px; background-color: #e4e4e4; padding: 10px;"><strong>1 . </strong>&lt;SPRibbon PlaceholderElementId=&#8221;RibbonContainer&#8221;&gt;<br />
<strong>2 . </strong>&lt;SharePoint:SPRibbonPeripheralContent Location=&#8221;TabRowLeft&#8221;&gt;<br />
<strong>3 . </strong>&lt;SharePoint:SiteActions&gt;<br />
<strong>4 . </strong>&lt;asp:ContentPlaceHolder id=&#8221;PlaceHolderGlobalNavigation&#8221;&gt;<br />
&lt;SharePoint:PopoutMenu ID=&#8221;GlobalBreadCrumbNavPopout&#8221;&gt;<br />
&lt;SharePoint:PageStateActionButton&gt;<br />
<strong>5 . </strong>&lt;SharePoint:SPRibbonPeripheralContent Location=&#8221;TabRowRight&#8221;&gt;</div>
<p><img class="aligncenter size-full wp-image-110" title="guide1" src="http://styledpoint.com/blog/wp-content/uploads/2010/01/guide1.jpg" alt="" width="460" height="159" /></p>
<p>To move the pieces, we want to the correct zone so we simply move the following areas:</p>
<p><img class="aligncenter size-full wp-image-126" title="guide2" src="http://styledpoint.com/blog/wp-content/uploads/2010/01/guide2.jpg" alt="" width="455" height="150" /></p>
<p>The Following code can be placed anywhere in your master page to change the location of the ribbon tabs and action icons.</p>
<pre class="brush: html">
&lt;SharePoint:SPRibbon
runat=&quot;server&quot;
PlaceholderElementId=&quot;RibbonContainer&quot;
CssFile=&quot;&quot;&gt;
&lt;SharePoint:SPRibbonPeripheralContent
runat=&quot;server&quot;
Location=&quot;TabRowRight&quot;
ID=&quot;RibbonTabRowRight&quot;
CssClass=&quot;s4-trc-container s4-notdlg&quot;&gt;
&lt;/SharePoint:SPRibbonPeripheralContent&gt;
&lt;/SharePoint:SPRibbon&gt;
</pre>
<p><strong>Changing how the Ribbon looks: </strong>Just like any SharePoint branding it takes time and patience. To style the ribbon, I created a set of styles to work with the html that the SPRibbon Controls output. These styles are loaded last and override the initial default styles. In addition to these, I have used 3 background images to attain my design.</p>
<pre class="brush: css">

/* Removes the original background from the ribbon */
body #s4-ribboncont{
background-image:none;
margin-top:10px;
}

/* Globally set all the background colors to transparent and remove background images / borders */
#s4-ribbonrow,
#s4-ribbonrow *
{
background-color:transparent !important;
background-image:none;
border-width:0px;

}
.s4-ribbonrowhidetitle{
height:inherit !important;
}
/* After globally turning off borders.. turn back on the separators for the large icons*/
.ms-cui-groupSeparator {
border-right:1px solid #E7E7E8 !important;
}
.ms-cui-topBar2{
border-width:0px;
}

/* Set the background for the tabs at the top (Browse / Page) */
.ms-cui-ribbonTopBars{
background:url(&#039;../img/ribbon-top.png&#039;) no-repeat !important;
padding-top:0px;
padding-bottom:5px;
}

/* Set the background for the bottom part of the ribbon */
.ms-cui-tabContainer{
background:url(&#039;../img/ribbon-bottom.png&#039;) no-repeat !important;
padding-bottom:5px;
position:relative;
top:-6px;
}

/* Set the background for the additional dynamic tabs (Web parts / Lists ect) */
.ms-cui-cg-i{
background-image:url(&#039;../img/ribbon-tab.png&#039;) !important;
background-position:bottom left;
background-repeat:no-repeat !important;
height:20px;
margin-bottom:2px;
}
.ms-cui-cg-db .ms-cui-cg-t{
height:17px;
background-image:url(&#039;../img/ribbon-tab.png&#039;) !important;
background-position:bottom right !important;
background-repeat:no-repeat !important;
margin-left:4px;
}
.ms-cui-cg-t-i{
color:white;
font-weight:bold;
}
.ribbon-wrapper{
position:relative;
}

/* For use with the next step! read on! */

.fixed-ribbon{
position:fixed;
top:0;
width:950px;
z-index:21;
}
</pre>
<p><em>Have a look at the background images to give you an idea how I did it.</em></p>
<p><em>ribbon-top.png<br />
<a href="http://styledpoint.com/blog/wp-content/uploads/2010/01/ribbon-top.png"><img class="aligncenter size-thumbnail wp-image-133" title="ribbon-top" src="http://styledpoint.com/blog/wp-content/uploads/2010/01/ribbon-top-150x52.png" alt="" width="459" height="21" /></a></em> <em>ribbon-bottom.png<a href="http://styledpoint.com/blog/wp-content/uploads/2010/01/ribbon-bottom.png"> </a></em></p>
<p><a href="http://styledpoint.com/blog/wp-content/uploads/2010/01/ribbon-bottom.png"><img class="aligncenter size-thumbnail wp-image-132" title="ribbon-bottom" src="http://styledpoint.com/blog/wp-content/uploads/2010/01/ribbon-bottom-150x96.png" alt="" width="460" height="29" /></a></p>
<p><strong>Changing how the Ribbon behaves: </strong>Now that I have the ribbon in the correct location and it&#8217;s styled to my liking, I have one last step. The ribbon was designed to always be visible. That&#8217;s why it&#8217;s fixed at the top of the screen. An example of this would be a content editor web part at the bottom of a page. You scroll down to the bottom but the controls to edit, change fonts and add links are in the header and would not be visible. I have now taken the ribbon from the fixed position at the top of the screen and have included it in the master page as a relative HTML box that scrolls.</p>
<p>With some jQuery we can overcome this inherent problem by toggling the ribbon to become fixed when the page scrolls to a position where the ribbon would be out of the viewable area.<br />
<em>*Note: This assumes that the ribbon has been placed in a custom div with the class of &#8220;ribbon-wrapper&#8221;</em></p>
<pre class="brush: javascript">
// This is written in jQuery.
// This piece of code will toggle the ribbon from a fixed position to a relative position based on the viewable area in the browser

// When the Window Scrolls
$(window).scroll(function () {

// The Current Window in an object
var jWindow = $(window);

// If the Ribbon is turned on...
if(hideRibbon != true)
{

//If the top of the page is over 145 pixels scrolled then...
if(jWindow.scrollTop() &gt; 145)
{

// Set the height of the ribbon box and toggle it to fixed.
$(&quot;.ribbon-wrapper&quot;).css(&quot;height&quot;, $(&quot;#s4-ribbonrow&quot;).height() + &quot;px&quot;);
$(&quot;#s4-ribbonrow&quot;).addClass(&quot;fixed-ribbon&quot;);

}

//If the top of the page is less than 145 pixels scrolled then...
else if(jWindow.scrollTop() &lt; 146)
{

// Remove the set height and toggle it back to relative
$(&quot;#s4-ribbonrow&quot;).removeClass(&quot;fixed-ribbon&quot;);
$(&quot;.ribbon-wrapper&quot;).removeAttr(&quot;style&quot;);

}
}

});
</pre>
<p>Last but not least, since I have now removed the title from being displayed in the ribbon when &#8220;browse&#8221; is selected, let&#8217;s collapse the ribbon to only show the tabs.</p>
<pre class="brush: javascript">

// If there aren&#039;t any buttons in the ribbon don&#039;t display the box.
hideRibbon = true;

// The the Ribbon is loaded in the DOM
$(&quot;#RibbonContainer&quot;).ready(function(){

// Loop through the children of the ribbon icons. And if you find a child, set the flag to false.
$(&quot;#s4-ribboncont .ms-cui-tts li&quot;).each(function(){
hideRibbon = false
});

//If the flag was never triggered (no icons were found) then hide the ribbon box.
if(hideRibbon)
{
$(&quot;#s4-ribbonrow&quot;).hide();
}
});
</pre>
<p><strong>Conclusion: </strong>Branding the ribbon is not for the faint of heart. As you can see it takes a lot of time and effort. I know that the ribbon was never meant to be branded or moved but I really do think that we can&#8217;t fully establish a custom look and feel until everything has been branded.</p>
<p>Being able to change the location and design of the ribbon to a safe level of customization will satisfy those of us on the eternal quest to make SharePoint our own&#8230;for ourselves and for our customers.</p>
<img src="http://feeds.feedburner.com/~r/StyledPoint/~4/19EvpSuK5Dw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://styledpoint.com/blog/ribbon-customization-changing-placement-look-and-behavior/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		<feedburner:origLink>http://styledpoint.com/blog/ribbon-customization-changing-placement-look-and-behavior/</feedburner:origLink></item>
		<item>
		<title>NEW SharePoint Branding Whitepaper</title>
		<link>http://feedproxy.google.com/~r/StyledPoint/~3/2GS51CTs2cE/</link>
		<comments>http://styledpoint.com/blog/new-sharepoint-branding-whitepaper/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 15:44:30 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://styledpoint.com/blog/?p=88</guid>
		<description><![CDATA[
The new whitepaper I just wrote on branding SharePoint has just been release by the company I call home, Non~Linear Creations.
In my paper I dive into the Five steps for transforming the visual design of SharePoint.
Check it out and let me know what you think.
http://www.nonlinearcreations.com/sharepoint_branding
]]></description>
			<content:encoded><![CDATA[<p><a href="/blog/new-sharepoint-branding-whitepaper/"><img class="aligncenter size-full wp-image-89" title="title-image-whitepaper" src="http://styledpoint.com/blog/wp-content/uploads/2010/01/title-image-whitepaper.png" alt="" width="460" height="101" /></a></p>
<p>The new whitepaper I just wrote on branding SharePoint has just been release by the company I call home, Non~Linear Creations.</p>
<p>In my paper I dive into the Five steps for transforming the visual design of SharePoint.</p>
<p>Check it out and let me know what you think.</p>
<p><a href="http://www.nonlinearcreations.com/sharepoint_branding"><strong>http://www.nonlinearcreations.com/sharepoint_branding</strong></a></p>
<img src="http://feeds.feedburner.com/~r/StyledPoint/~4/2GS51CTs2cE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://styledpoint.com/blog/new-sharepoint-branding-whitepaper/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://styledpoint.com/blog/new-sharepoint-branding-whitepaper/</feedburner:origLink></item>
		<item>
		<title>Fixed width, centered SharePoint 2010 Site</title>
		<link>http://feedproxy.google.com/~r/StyledPoint/~3/EHG3SxJ8tlc/</link>
		<comments>http://styledpoint.com/blog/fixed-width-centered-sharepoint-2010-site/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 19:56:10 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://styledpoint.com/blog/?p=72</guid>
		<description><![CDATA[
I was faced with the challenge of creating my first fixed width SharePoint site and the content had to be centered!
SharePoint 2010 implements a complicated system of divs, css and JavaScript to attain their static ribbon at the top of the screen but unfortunately this can get messy with different layout types.
In the master page [...]]]></description>
			<content:encoded><![CDATA[<p><a href="blog/fixed-width-centered-sharepoint-2010-site/"><img class="aligncenter size-full wp-image-76" title="title-image-fixed width" src="http://styledpoint.com/blog/wp-content/uploads/2009/12/title-image-fixed-width.png" alt="" width="460" height="101" /></a></p>
<p>I was faced with the challenge of creating my first fixed width SharePoint site and the content had to be centered!</p>
<p>SharePoint 2010 implements a complicated system of divs, css and JavaScript to attain their static ribbon at the top of the screen but unfortunately this can get messy with different layout types.</p>
<p><span id="more-72"></span>In the master page remove the s4-workspace ID from the the div. This is the ID the java script looks for to resize the content.</p>
<p>Second, add the following to your branding css file or a style tag in the header after the core.css</p>
<pre class="brush: css">/* Page Wrapper */
body{
overflow:auto;

}
form
{
width:950px;
margin-left:auto;
margin-right:auto
}
</pre>
<p>That&#8217;s it!</p>
<p>The fixed width gets centered by the auto margins and the page properly shows the scroll bars because of the overflow:auto!</p>
<img src="http://feeds.feedburner.com/~r/StyledPoint/~4/EHG3SxJ8tlc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://styledpoint.com/blog/fixed-width-centered-sharepoint-2010-site/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://styledpoint.com/blog/fixed-width-centered-sharepoint-2010-site/</feedburner:origLink></item>
		<item>
		<title>SP Designer 2007: An annoying error: Solved!</title>
		<link>http://feedproxy.google.com/~r/StyledPoint/~3/YuFRfRJlT68/</link>
		<comments>http://styledpoint.com/blog/an-annoying-error-solved/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 17:43:13 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[SharePoint Designer 2007]]></category>

		<guid isPermaLink="false">http://styledpoint.com/blog/?p=68</guid>
		<description><![CDATA[
I recieved this weird error in SharePoint Designer.
Cannot perform this operation. The file is no longer checked out or has been deleted.
After googling it I found some solutions.
but all were in mention to the web cache.
Locate the WebsiteCache directory below and delete it:
Vista: %UserProfile%\AppData\Local\Microsoft\WebsiteCache
Windows 2003/XP: %UserProfile%\Local Settings\Application Data\Microsoft\WebsiteCache
This didn&#8217;t work for me. After trying a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="/blog/an-annoying-error-solved/"><img class="aligncenter size-full wp-image-81" title="title-image-error" src="http://styledpoint.com/blog/wp-content/uploads/2008/11/title-image-error.png" alt="" width="460" height="101" /></a></p>
<p>I recieved this weird error in SharePoint Designer.</p>
<blockquote><p>Cannot perform this operation. The file is no longer checked out or has been deleted.</p></blockquote>
<p>After googling it I found some solutions.</p>
<p><span id="more-68"></span>but all were in mention to the web cache.</p>
<blockquote><p>Locate the WebsiteCache directory below and delete it:</p>
<p>Vista: <strong>%UserProfile%\AppData\Local\Microsoft\WebsiteCache</strong></p>
<p>Windows 2003/XP: <strong>%UserProfile%\Local Settings\Application Data\Microsoft\WebsiteCache</strong></p></blockquote>
<p>This didn&#8217;t work for me. After trying a million things I found out that you can&#8217;t access your site from anything but the host name. For me I use an external version of SharePoint designer accessing my SharePoint VM.</p>
<p>So instead of using an IP I ended up making an entry in my host file</p>
<blockquote><p><code>%SystemRoot%\system32\drivers\etc\host</code></p>
<p>123.123.123.123      sharepointvm1</p></blockquote>
<p>Simple solution? Yes. but took me a while and wanted to share my findings.</p>
<img src="http://feeds.feedburner.com/~r/StyledPoint/~4/YuFRfRJlT68" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://styledpoint.com/blog/an-annoying-error-solved/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://styledpoint.com/blog/an-annoying-error-solved/</feedburner:origLink></item>
		<item>
		<title>Where have I been?!</title>
		<link>http://feedproxy.google.com/~r/StyledPoint/~3/peDy4UzlQ8o/</link>
		<comments>http://styledpoint.com/blog/where-have-i-been/#comments</comments>
		<pubDate>Thu, 23 Oct 2008 15:03:55 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://styledpoint.com/blog/?p=64</guid>
		<description><![CDATA[
You as my ever so loyal reader must be wondering where I have been for the last 2 weeks. Well I went to Italy!
I&#8217;m back and It&#8217;s time to get back to work! Expect some more interesting posts in the future!
]]></description>
			<content:encoded><![CDATA[<p><a href="/blog/where-have-i-been/"><img class="aligncenter size-full wp-image-84" title="title-image-italy" src="http://styledpoint.com/blog/wp-content/uploads/2008/10/title-image-italy.png" alt="" width="460" height="101" /></a><br />
You as my ever so loyal reader must be wondering where I have been for the last 2 weeks. Well I went to Italy!</p>
<p>I&#8217;m back and It&#8217;s time to get back to work! Expect some more interesting posts in the future!</p>
<img src="http://feeds.feedburner.com/~r/StyledPoint/~4/peDy4UzlQ8o" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://styledpoint.com/blog/where-have-i-been/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://styledpoint.com/blog/where-have-i-been/</feedburner:origLink></item>
		<item>
		<title>It came!</title>
		<link>http://feedproxy.google.com/~r/StyledPoint/~3/pmI8dRZQWZ4/</link>
		<comments>http://styledpoint.com/blog/it-came/#comments</comments>
		<pubDate>Tue, 30 Sep 2008 20:13:04 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[SharePoint 2007]]></category>

		<guid isPermaLink="false">http://styledpoint.com/blog/?p=61</guid>
		<description><![CDATA[My Wrox SharePoint 2007 Design book came from Amazon.ca! OH JOY! Let the learning and the fun that comes with it begin!

]]></description>
			<content:encoded><![CDATA[<p>My <a href="http://www.wrox.com/WileyCDA/WroxTitle/Professional-SharePoint-2007-Design.productCd-047028580X.html">Wrox SharePoint 2007 Design</a> book came from Amazon.ca! OH JOY! Let the learning and the fun that comes with it begin!</p>
<p><a href="http://styledpoint.com/blog/wp-content/uploads/2008/09/itcame.jpg"><img class="alignnone size-full wp-image-62" title="itcame" src="http://styledpoint.com/blog/wp-content/uploads/2008/09/itcame.jpg" alt="" width="500" height="223" /></a></p>
<img src="http://feeds.feedburner.com/~r/StyledPoint/~4/pmI8dRZQWZ4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://styledpoint.com/blog/it-came/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://styledpoint.com/blog/it-came/</feedburner:origLink></item>
		<item>
		<title>Hand Coding HTML in SharePoint Designer 2007 vs. DreamWeaver CS3</title>
		<link>http://feedproxy.google.com/~r/StyledPoint/~3/TiBtdWoQ8vs/</link>
		<comments>http://styledpoint.com/blog/hand-coding-html-in-sharepoint-designer-2007-vs-dreamweaver-cs3/#comments</comments>
		<pubDate>Tue, 30 Sep 2008 19:46:07 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[SharePoint 2007]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://styledpoint.com/blog/?p=34</guid>
		<description><![CDATA[Well I have officially coded my design comp for my first sharepoint demo site.
The Photoshop Comp

The Results of my HTML Coding.

Seeing that I am doing this for SharePoint I decided to tackle my HTML with SharePoint Designer.
The official blurb from Microsoft.com wraps it up nice and vaguely =)
Office SharePoint Designer 2007 provides you with tools [...]]]></description>
			<content:encoded><![CDATA[<p>Well I have officially coded my design comp for my first <a href="http://styledpoint.com/blog/example/SharePointDemo1/">sharepoint demo site.</a></p>
<p><em>The Photoshop Comp</em></p>
<p><a href="http://styledpoint.com/blog/wp-content/uploads/2008/09/sharepointdemo-copy1.jpg"><img class="alignnone size-medium wp-image-42" title="sharepointdemo-copy1" src="http://styledpoint.com/blog/wp-content/uploads/2008/09/sharepointdemo-copy1-600x327.jpg" alt="" width="420" height="229" /></a></p>
<p><em>The Results of my HTML Coding.</em></p>
<p><span style="text-decoration: underline; color: #0000ee;"><a href="http://styledpoint.com/blog/wp-content/uploads/2008/09/sharepointdemo-html1.jpg"></a><a href="http://styledpoint.com/blog/wp-content/uploads/2008/09/sharepointdemo-html2.jpg"><img class="alignnone size-medium wp-image-45" title="sharepointdemo-html2" src="http://styledpoint.com/blog/wp-content/uploads/2008/09/sharepointdemo-html2-600x327.jpg" alt="" width="420" height="229" /></a></span></p>
<p>Seeing that I am doing this for SharePoint I decided to tackle my HTML with <a href="http://office.microsoft.com/en-us/sharepointdesigner/default.aspx">SharePoint Designer</a>.</p>
<p>The official blurb from Microsoft.com wraps it up nice and vaguely =)</p>
<blockquote><address><em><span style="color: #808080;">Office SharePoint Designer 2007 provides you with tools to automate your business processes, build efficient applications on top of the Microsoft SharePoint platform, and tailor your SharePoint site to your needs, all in an IT-managed environment.</span></em></address>
</blockquote>
<p>I know that SharePoint Designer is a full solution for <strong>SharePoint developmen</strong><strong>t</strong> and <strong>content editing</strong>, but at this point in the game I&#8217;m using her strictly for HTML development.</p>
<p>When coding in HTML i believe in doing it the right way. Unfortunately (Or fortunately as I see it) this means WYSIWYG is out of the picture. I hand code everything. In the past I have used DreamWeaver, but today that&#8217;s not in the bag. As you can see. The <a href="http://styledpoint.com/blog/example/SharePointDemo1/">Demo Site</a> I coded is <a href="http://validator.w3.org/check?uri=http://styledpoint.com/blog/example/SharePointDemo1/&amp;charset=(detect+automatically)&amp;doctype=Inline&amp;group=0">XHTML 1.0 Strict!</a> (valid HTML).</p>
<p>It&#8217;s also important to take note that I assumed SharePoint Designer was Visual Studio 2008&#8217;s HTML editor stripped and stuck into Another App, but it&#8217;s not. It looks the same but there is subtle and extreme differences. Don&#8217;t be fooled!</p>
<h3><strong>The first look and comparison.</strong></h3>
<p><a href="http://styledpoint.com/blog/wp-content/uploads/2008/09/comparison.jpg"><img class="size-medium wp-image-35 alignnone" title="comparison" src="http://styledpoint.com/blog/wp-content/uploads/2008/09/comparison-600x233.jpg" alt="" width="600" height="233" /></a></p>
<p>As you can see. Both look simple enough.</p>
<p>Each have</p>
<ul>
<li> Syntax Coloring</li>
<li>Line Numbers</li>
<li>File Navigation</li>
<li>Code hints</li>
<li>Auto Completion</li>
<li>WYSIWYG (Never used it, don&#8217;t ask)</li>
</ul>
<p>Everything else is over and above the features I would use in a typical hand coding session. I don&#8217;t like the buttons you push that sticks in pre made tags.  Any part of the IDE that inserts or alters my code in any way is risking my page and it&#8217;s chances of passing validation. Microsoft products are notorious for this. Especially in WYSIWYG and the ASP.Net HTML controls.</p>
<p>Off the top of my head. Things that Microsoft loves that aren&#8217;t valid.</p>
<ul>
<li>Uppercase tags (&lt;DIV&gt;&lt;/DIV&gt;)</li>
<li>No quotes on attributes (&lt;div id=tom rocks&gt;&lt;/div&gt;)</li>
<li>HTML tags aren&#8217;t properly constructed (&lt;br&gt; instead of &lt;br /&gt;)</li>
<li>Tags are grandfathered (&lt;b&gt; instead of &lt;strong&gt;)</li>
</ul>
<div><strong><br />
</strong></div>
<h3><strong>The Verdict?</strong></h3>
<div>I can&#8217;t believe I&#8217;m about to say this, but SharePoint is the winner. I know. I can&#8217;t believe it!</div>
<div>Here are my favorite things about this bad boy.</div>
<div><span style="text-decoration: underline;">Out of the box Syntax Highlighting</span></div>
<div>I say out of the box because you can customize the syntax highlighting in the options of each IDE but out of the box SharePoint designer won. I realize this is purely subjective. but have a look</div>
<div><strong>SharePoint</strong></div>
<div><span style="text-decoration: underline;"><a href="http://styledpoint.com/blog/wp-content/uploads/2008/09/screenhunter_12-sep-30-13511.jpg"><img class="alignnone size-full wp-image-38" style="border: 1px solid grey;" title="screenhunter_12-sep-30-13511" src="http://styledpoint.com/blog/wp-content/uploads/2008/09/screenhunter_12-sep-30-13511.jpg" alt="" width="512" height="166" /></a></span></div>
<div><strong>Dreamweaver</strong></div>
<div><span style="text-decoration: underline;"><img class="alignnone size-full wp-image-36" style="border: 1px solid grey; margin-bottom:20px;" title="screenhunter_11-sep-30-1351" src="http://styledpoint.com/blog/wp-content/uploads/2008/09/screenhunter_11-sep-30-1351.jpg" alt="" width="530" height="176" /></span></div>
<p><strong><span style="text-decoration: underline;">CSS Inteli Sense</span></strong></p>
<p>Intelisense is something I have always loved in ASP.Net coding. Any developer would agree that it&#8217;s one of their favorite features in Visual Studio. It&#8217;s partly the reason the I fell in love with DreamWeaver when it first came out. It&#8217;s code completion for HTML and CSS was astounding. I loved it.</p>
<p>Typical code completion.</p>
<p>SharePoint                      DreamWeaver</p>
<div style="display:block"><a href="http://styledpoint.com/blog/wp-content/uploads/2008/09/screenhunter_13-sep-30-1403.jpg"><img class="alignnone size-medium wp-image-40" style="border: 1px solid grey;" title="screenhunter_13-sep-30-1403" src="http://styledpoint.com/blog/wp-content/uploads/2008/09/screenhunter_13-sep-30-1403.jpg" alt="" width="138" height="162" /></a><a href="http://styledpoint.com/blog/wp-content/uploads/2008/09/screenhunter_14-sep-30-1403.jpg"> <img class="alignnone size-medium wp-image-39" style="border: 1px solid grey;" title="screenhunter_14-sep-30-1403" src="http://styledpoint.com/blog/wp-content/uploads/2008/09/screenhunter_14-sep-30-1403.jpg" alt="" width="119" height="186" /></a></div>
<p>but I found that SharePoint Desinger had great intuition in a couple of other situations. Take CSS for example. If I was coding CSS to alter a specific Child Element of a parent with an ID. SharePoint Designer would give me a list of all child elements of that parent element. VERY COOL!</p>
<p><a href="http://styledpoint.com/blog/wp-content/uploads/2008/09/example-of-code-completion.jpg"><img class="alignnone size-full wp-image-46" style="border: 1px solid grey;" title="example-of-code-completion" src="http://styledpoint.com/blog/wp-content/uploads/2008/09/example-of-code-completion.jpg" alt="" width="356" height="300" /></a></p>
<p>See how all the child elements are listed? So useful!</p>
<p><strong><span style="text-decoration: underline;">Validation Tips!</span></strong></p>
<p>You can&#8217;t put nested Style tags in HTML for XHTML strict? THANKS!</p>
<p><a href="http://styledpoint.com/blog/wp-content/uploads/2008/09/validation.jpg"><img class="alignnone size-full wp-image-47" style="border: 1px solid grey;" title="validation" src="http://styledpoint.com/blog/wp-content/uploads/2008/09/validation.jpg" alt="" width="390" height="134" /></a></p>
<p>Don&#8217;t get me wrong. DreamWeaver has validation. but it&#8217;s a tool you run every once and a while. The results are shown in a list. I never use it. This just adds error lines under the wrong tags (Just like when coding in Visual Studio).</p>
<p><span style="text-decoration: underline;"><strong>Tag Erros!</strong></span></p>
<p>As you are typing along there is always checks going on behind. Have a look here. Because one &lt;ul&gt; tag is broken the IDE tells you multiple spots this affects other tags.</p>
<p><a href="http://styledpoint.com/blog/wp-content/uploads/2008/09/screenhunter_18-sep-30-1446.jpg"><img class="alignnone size-full wp-image-48" style="border: 1px solid grey;" title="screenhunter_18-sep-30-1446" src="http://styledpoint.com/blog/wp-content/uploads/2008/09/screenhunter_18-sep-30-1446.jpg" alt="" width="365" height="329" /></a></p>
<p>The Error Messages</p>
<p><a href="http://styledpoint.com/blog/wp-content/uploads/2008/09/validation3.jpg"><img class="alignnone size-full wp-image-49" style="border: 1px solid grey;" title="validation3" src="http://styledpoint.com/blog/wp-content/uploads/2008/09/validation3.jpg" alt="" width="500" height="337" /></a></p>
<h3><strong>Conclusion</strong></h3>
<p>I was really surprised with my results. I like HTML coding. I find it to be challenging. I never use cross browser hacks. I never use IE if cases. My CSS is solid across Firefox, IE, Safari and Chrome. I guess the point I&#8217;m trying to make it this&#8230; I&#8217;m a solid HTML coder that sticks to his tools and knows what&#8217;s useful and what&#8217;s not when it comes to advanced coding in an IDE.</p>
<p>When I was recommend to try SharePoint Designer 2007 I laughed hearing that it was the new front page, but what I got was a rock solid HTML coding textpad with perks. Just the way I like it.  I&#8217;m astonished to see the amount of work gone into just the source code editing.</p>
<p>If you take home anything&#8230; I hope that maybe I&#8217;ve opened your eyes, or maybe make you second guess your preconceptions on SharePoint designer.</p>
<h3>&#8230; A couple &#8216;hope to have improvements&#8217; in the future from my perspective</h3>
<p>Taking what I love from each of the IDEs I use on a weekly basis (VS 2008, DreamWeaver, SQL Manager) here are some things I think would really put SharePoint Designer on the top as far as hand coding goes.</p>
<ul>
<li>Intuitive tag closing. In DreamWeaver if you make a &lt;div&gt; opening tag. It won&#8217;t auto make the closing tag (It does in SPD2007 but you can turn it off). You can type in content and then just type &#8220;&lt;&#8221; and the IDE will know what tag to close it with.</li>
<li>Javascript Debugging. It&#8217;s in VS 2008. Would be nice to have it in SPD.</li>
<li>Integrated Development Server. I know this might be a big one, but sometimes URL&#8217;s break when testing on a local file system because of root pathing.. EX &#8220;/css/file.css&#8221;</li>
<li>jQuery (or other frameworks) and Javascript intellisense. Would be awesome.</li>
<li>CSS intellisense in EXTERNAL css files. Not just header style tags.</li>
<li>I miss my code collapse. and i would nice to have it intuitive to the closing tag of my current element.</li>
<li>I like how some IDE&#8217;s will bold or highlight the closing tag of your current tag.</li>
<li>Code bookmarks and maybe something like Region tags in VS.</li>
<li>The Tabbed interface in SharePoint Designer is nice. but you can&#8217;t reorder tabs. The are stuck in the order you opened them in.</li>
<li>Cascade your tabs to open side by side.</li>
</ul>
<div>That&#8217;s it. I better stop before I blow a gasket.</div>
<img src="http://feeds.feedburner.com/~r/StyledPoint/~4/TiBtdWoQ8vs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://styledpoint.com/blog/hand-coding-html-in-sharepoint-designer-2007-vs-dreamweaver-cs3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://styledpoint.com/blog/hand-coding-html-in-sharepoint-designer-2007-vs-dreamweaver-cs3/</feedburner:origLink></item>
		<item>
		<title>You call that a Website? More like a Shmedsite.</title>
		<link>http://feedproxy.google.com/~r/StyledPoint/~3/x9ew3_M1kNU/</link>
		<comments>http://styledpoint.com/blog/you-call-that-a-website-more-like-a-shmedsite/#comments</comments>
		<pubDate>Fri, 26 Sep 2008 19:20:03 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[SharePoint 2007]]></category>

		<guid isPermaLink="false">http://styledpoint.com/blog/?p=31</guid>
		<description><![CDATA[Well kids. Today I installed SharePoint Designer 2007. I also worked on a demo comp in Photoshop to try and build out in SharePoint.
Someone told me I should have pushed more and make it more different from the default SharePoint layout. Another colleague told me to make it look more web 2.0, but in the [...]]]></description>
			<content:encoded><![CDATA[<p>Well kids. Today I installed SharePoint Designer 2007. I also worked on a demo comp in Photoshop to try and build out in SharePoint.</p>
<p>Someone told me I should have pushed more and make it more different from the default SharePoint layout. Another colleague told me to make it look more web 2.0, but in the end. I just want a simple enough, yet very different template to try and code for my first go.</p>
<p>There is no &#8220;hardcoded&#8221; text in images. and the image at the top will hopefully be on rotation from some sort of library in SharePoint.</p>
<p><a href="http://styledpoint.com/blog/wp-content/uploads/2008/09/sharepointdemo-copy.jpg"><img class="alignnone size-medium wp-image-32" title="Tommy Demo Site" src="http://styledpoint.com/blog/wp-content/uploads/2008/09/sharepointdemo-copy-600x327.jpg" alt="" width="600" height="327" /></a></p>
<p>That&#8217;s it!</p>
<p>Happy weekend to everyone. I now must go finish my friday at work beer.</p>
<img src="http://feeds.feedburner.com/~r/StyledPoint/~4/x9ew3_M1kNU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://styledpoint.com/blog/you-call-that-a-website-more-like-a-shmedsite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://styledpoint.com/blog/you-call-that-a-website-more-like-a-shmedsite/</feedburner:origLink></item>
		<item>
		<title>SQL variable column and table names.. Oh my!</title>
		<link>http://feedproxy.google.com/~r/StyledPoint/~3/jpMlYiISYGU/</link>
		<comments>http://styledpoint.com/blog/sql-variable-column-and-table-names-oh-my/#comments</comments>
		<pubDate>Wed, 24 Sep 2008 18:10:41 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://styledpoint.com/blog/?p=25</guid>
		<description><![CDATA[Well today I was pulled off my SharePoint Adventure and thrown on some good old database maintenance. So my &#8220;day one&#8221; turned out to be a &#8220;day none&#8221;. The only thing I&#8217;ve managed to tackle for SharePoint.. getting a Virtual Machine set up and renaming it so it doesn&#8217;t conflict with other VMs on the [...]]]></description>
			<content:encoded><![CDATA[<p>Well today I was pulled off my SharePoint Adventure and thrown on some good old database maintenance. So my &#8220;day one&#8221; turned out to be a &#8220;day none&#8221;. The only thing I&#8217;ve managed to tackle for SharePoint.. getting a Virtual Machine set up and renaming it so it doesn&#8217;t conflict with other VMs on the same network. <em>*Tom sarcastically twirls his finger saying</em> <em>&#8220;wooo hoo&#8221;*</em></p>
<p>but I want to blog about something so&#8230;.</p>
<p>Have you ever found yourself trying to import / alter some data in SQL Server but you needed  your table names to be a variable? This always happens me. My first instinct is to fire up Visual studio and write a fast and dirty asp.Net app that queries the DB.  And then i can work all sorts of my hacky magic.</p>
<p>To be able to stay in SQL Server Management Heaven we need to use something called <strong>Dynamic SQL.</strong></p>
<p>Lets say the client gave you an excel that look something like this</p>
<p><img style="max-width: 800px;" src="http://styledpoint.com/blog/wp-content/uploads/2008/09/screenhunter-01-sep-24-1340.jpg" alt="" /></p>
<p>And imagine that the business and money repeat all the way to 50.<br />
You can see where the problem is now.</p>
<p>How would you import that into a table that looks like this?</p>
<p><img style="max-width: 800px;" src="http://styledpoint.com/blog/wp-content/uploads/2008/09/screenhunter-03-sep-24-1344.jpg" alt="" /></p>
<p>Well we could make some SQL that imports each column</p>
<pre class="brush: sql">
-- ## FIRST RECORD ###################################
-- Insert Into this table
INSERT     business (customer, business, amount)
-- From here
SELECT     customer, business1, money1
FROM     report

-- ## SECOND RECORD ##################################
-- Insert Into this table
INSERT business (customer,business,amount)
-- From here
SELECT 	customer,business2,money2

FROM 	report

-- ## THIRD RECORD ###################################
-- Ok.... You get the point.
</pre>
<p>That would take forever with a lot of copy and pasting!</p>
<p>Why not stick it all in a loop! Insert <strong>Dynamic SQL</strong></p>
<pre class="brush: sql">
-- ## LOOP FOR EACH CUSTOMER! ########################## --
-- Counter Variable
declare @counter int
set @counter = 0

-- The SQL Query Variable
DECLARE @sql nvarchar(4000)

-- THE LOOP!
-- *note, we put in the number of loops here!
while @counter &lt; 50
	begin
		-- Increment the counter
		set @counter = @counter + 1

		-- Here is our SQL
		SELECT @sql =
			&#039;
			INSERT	business(customer,business,amount)
			SELECT 	customer,
			business&#039; + cast(@counter as char) + &#039;,
			money&#039; + cast(@counter as char) + &#039;
			FROM 	report
			&#039;

		-- Execute the SQL
		EXEC sp_executesql @sql

		print &#039;The current column is business&#039; + cast(@counter as char)

	end
</pre>
<p>So as you can see. All we did here was &#8230;<br />
	- Take the SQL from before<br />
	- Wrap it in a loop with some variables.<br />
	- Build it dynamically as a string.<br />
	- Stick it in a Variable.<br />
	- Execute the string via the included SQL server stored procedure (wraps your code in some good, safe stuff)<br />
	- Tada! Awesome fun!</p>
<p>Dynamic SQL is neat, but it also has limitations, but for something like my import where I had no say in how the data arrived at my door. This all saved my day!</p>
<img src="http://feeds.feedburner.com/~r/StyledPoint/~4/jpMlYiISYGU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://styledpoint.com/blog/sql-variable-column-and-table-names-oh-my/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://styledpoint.com/blog/sql-variable-column-and-table-names-oh-my/</feedburner:origLink></item>
	</channel>
</rss>
