<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>youdidwhatwithtsql.com &#187; .Net</title>
	<atom:link href="http://www.youdidwhatwithtsql.com/tag/net/feed" rel="self" type="application/rss+xml" />
	<link>http://www.youdidwhatwithtsql.com</link>
	<description>making DBAs everywhere curse!</description>
	<lastBuildDate>Tue, 31 Jan 2012 12:21:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Using .Net libraries in Powershell</title>
		<link>http://www.youdidwhatwithtsql.com/using-net-libraries-in-powershell/538</link>
		<comments>http://www.youdidwhatwithtsql.com/using-net-libraries-in-powershell/538#comments</comments>
		<pubDate>Sat, 16 Jan 2010 16:50:44 +0000</pubDate>
		<dc:creator>Rhys</dc:creator>
				<category><![CDATA[Powershell]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[Powershell Scripting]]></category>

		<guid isPermaLink="false">http://www.youdidwhatwithtsql.com/using-net-libraries-in-powershell/538</guid>
		<description><![CDATA[One of the great things about Powershell is its ability to take advantage of the .Net platform. If Powershell can&#8217;t do it you bet there&#8217;s a .Net library that can. Not only is this great for extending your scripts but I also like to use Powershell to test some of my classes. Rather than fire [...]<p>Post from: <a href="http://www.youdidwhatwithtsql.com">youdidwhatwithtsql.com</a><br/><br/><a href="http://www.youdidwhatwithtsql.com/using-net-libraries-in-powershell/538">Using .Net libraries in Powershell</a></p>
]]></description>
			<content:encoded><![CDATA[<p>One of the great things about <a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx" target="_blank">Powershell</a> is its ability to take advantage of the <a href="http://www.microsoft.com/NET/" target="_blank">.Net platform</a>. If Powershell can&#8217;t do it you bet there&#8217;s a .Net library that can. Not only is this great for extending your scripts but I also like to use Powershell to test some of my classes. Rather than fire up RAM hungry Visual Studio I can just script out a few tests in <a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx" target="_blank">Powershell</a>.</p>
<p>Here&#8217;s quick script you can modify to compile a .cs file to produce a library for Powershell to load. This gives me the flexibility to quickly test individual classes from a project. The class I was testing here is just a wrapper around the functions of <a href="http://www.codeplex.com/DotNetZip" target="_blank">DotNetZip</a>. A reference is included, just remove this if your class doesn&#8217;t need it. At the end of the script the .dll file will be loaded and its methods will be listed by a call to <a href="http://technet.microsoft.com/en-us/library/ee176854.aspx" target="_blank">Get-Member</a>.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p538code3'); return false;">View Code</a> POWERSHELL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p5383"><td class="code" id="p538code3"><pre class="powershell" style="font-family:monospace;"><span style="color: #008000;"># Your c# class we want to compile as a library to test</span>
<span style="color: #800080;">$csharp_file</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;<span style="color: #008080; font-weight: bold;">`&quot;</span>C:\Users\Rhys\Documents\Visual Studio 2008\Projects\ETLBuddy\ETLBuddy\Zipper.cs<span style="color: #008080; font-weight: bold;">`&quot;</span>&quot;</span>;
<span style="color: #008000;"># Path to csc compiler</span>
<span style="color: #800080;">$compiler</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;$env:windir\Microsoft.NET\Framework\v3.5\csc.exe&quot;</span>;
<span style="color: #800080;">$cmd</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;$compiler /target:library $csharp_file &quot;</span>
<span style="color: #008000;"># Add any external library you're referencing, empty string if none</span>
<span style="color: #800080;">$reference</span><span style="color: pink;">=</span><span style="color: #800000;">&quot;C:\Users\Rhys\Desktop\Ionic.Zip.dll&quot;</span>;
&nbsp;
<span style="color: #008000;"># Add reference if needed</span>
<span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$reference</span> <span style="color: #FF0000;">-ne</span> <span style="color: #800000;">&quot;&quot;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #800080;">$cmd</span> <span style="color: pink;">+=</span> <span style="color: #800000;">&quot; /r:<span style="color: #008080; font-weight: bold;">`&quot;</span>$reference<span style="color: #008080; font-weight: bold;">`&quot;</span>&quot;</span>;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #008000;"># Invoke-Expression tells ps to evaluate the string as a command</span>
<span style="color: #008000;"># otherwise it would just print it out</span>
<span style="color: #008080; font-weight: bold;">Invoke-Expression</span> <span style="color: #800080;">$cmd</span>;
&nbsp;
<span style="color: #008000;"># Now load the dll</span>
<span style="color: #800080;">$dll</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">Get-Location</span>;
<span style="color: #800080;">$dll</span> <span style="color: pink;">=</span> <span style="color: #800080;">$dll</span>.ToString<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #800080;">$dll</span> <span style="color: pink;">=</span> <span style="color: #800080;">$dll</span> <span style="color: pink;">+</span> <span style="color: #800000;">&quot;\&quot;</span> <span style="color: pink;">+</span> <span style="color: #800080;">$csharp_file</span>.Substring<span style="color: #000000;">&#40;</span><span style="color: #800080;">$csharp_file</span>.LastIndexOf<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;\&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: pink;">+</span> <span style="color: #804000;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #FF0000;">-replace</span><span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;.cs&quot;</span><span style="color: pink;">,</span> <span style="color: #800000;">&quot;.dll&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #FF0000;">-replace</span><span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;<span style="color: #008080; font-weight: bold;">`&quot;</span>&quot;</span><span style="color: pink;">,</span> <span style="color: #800000;">&quot;&quot;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #000000;">&#91;</span>Reflection.Assembly<span style="color: #000000;">&#93;</span>::<span style="color: #800000;">LoadFile</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$dll</span> <span style="color: #FF0000;">-replace</span><span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;.cs&quot;</span><span style="color: pink;">,</span> <span style="color: #800000;">&quot;.dll&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #008000;"># Create a new object from the loaded dll</span>
<span style="color: #800080;">$obj</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> <span style="color: #800000;">&quot;com.etlbuddy.ETLBuddy.Zipper&quot;</span>;
<span style="color: #800080;">$obj</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Get-Member</span>;</pre></td></tr></table></div>

<p>From the output here you can see there are two methods called <strong>Zip</strong> and <strong>Unzip</strong>.</p>
<p><a href="http://www.youdidwhatwithtsql.com/wp-content/uploads/2010/01/powershell_net_library.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="powershell .net library methods" border="0" alt="powershell net library thumb Using .Net libraries in Powershell" src="http://www.youdidwhatwithtsql.com/wp-content/uploads/2010/01/powershell_net_library_thumb.png" width="644" height="350" /></a> </p>
<p>Now I have a dll I can put to work in my Powershell Scripts! Once this is done it&#8217;s really quite simple to get started.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p538code4'); return false;">View Code</a> POWERSHELL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p5384"><td class="code" id="p538code4"><pre class="powershell" style="font-family:monospace;"><span style="color: #008000;"># Load the Zipper dll</span>
<span style="color: #008000;"># Needed to run gacutil /i &quot;C:\Users\Rhys\Desktop\Ionic.Zip.dll&quot; so this would work</span>
<span style="color: #000000;">&#91;</span>Reflection.Assembly<span style="color: #000000;">&#93;</span>::<span style="color: #800000;">LoadFile</span><span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;C:\Users\Rhys\Documents\powershell\Zipper.dll&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Out-Null</span>;
&nbsp;
<span style="color: #008000;"># Create a new zip object</span>
<span style="color: #800080;">$obj</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> <span style="color: #800000;">&quot;com.etlbuddy.ETLBuddy.Zipper&quot;</span>;
&nbsp;
<span style="color: #008000;"># Zip a copy of a library</span>
<span style="color: #800080;">$obj</span>.Zip<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;C:\Users\Rhys\Documents\powershell\Zipper.dll&quot;</span><span style="color: #000000;">&#41;</span>;</pre></td></tr></table></div>

<p>After execution I have a new zip file in my Powershell working directory.</p>
<p><a href="http://www.youdidwhatwithtsql.com/wp-content/uploads/2010/01/file_zipped_by_powershell.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="file zipped by powershell" border="0" alt="file zipped by powershell thumb Using .Net libraries in Powershell" src="http://www.youdidwhatwithtsql.com/wp-content/uploads/2010/01/file_zipped_by_powershell_thumb.png" width="644" height="185" /></a> </p>
<p>That&#8217;s really all there is to begin using an external library in your Powershell scripts. For further info checkout <a href="http://blogs.msdn.com/powershell/archive/2009/03/11/how-to-create-an-object-in-powershell.aspx" target="_blank">How to create an object in Powershell</a>.</p>
<p><map name='google_ad_map_538_a45beff5d2e172f6'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/538?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_538_a45beff5d2e172f6' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=538&amp;url=http%3A%2F%2Fwww.youdidwhatwithtsql.com%2Fusing-net-libraries-in-powershell%2F538' title="Using .Net libraries in Powershell" alt=" Using .Net libraries in Powershell" /></p><p>Post from: <a href="http://www.youdidwhatwithtsql.com">youdidwhatwithtsql.com</a><br/><br/><a href="http://www.youdidwhatwithtsql.com/using-net-libraries-in-powershell/538">Using .Net libraries in Powershell</a></p>
<div class="none"><div class="g-plusone" data-href="http://www.youdidwhatwithtsql.com/using-net-libraries-in-powershell/538" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.youdidwhatwithtsql.com/using-net-libraries-in-powershell/538/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ping-SQL Sneak Peek</title>
		<link>http://www.youdidwhatwithtsql.com/ping-sql-sneak-peek/38</link>
		<comments>http://www.youdidwhatwithtsql.com/ping-sql-sneak-peek/38#comments</comments>
		<pubDate>Fri, 13 Mar 2009 19:16:20 +0000</pubDate>
		<dc:creator>Rhys</dc:creator>
				<category><![CDATA[Ping-SQL]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[CLR]]></category>
		<category><![CDATA[ping.fm]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[sql server 2005]]></category>

		<guid isPermaLink="false">http://www.youdidwhatwithtsql.com/ping-sql-sneak-peek/38</guid>
		<description><![CDATA[Ping-SQL allows you to play with the Ping.fm&#160;API with standard T-SQL in Microsoft SQL Server 2005 and above. Ping-SQL includes procedures to programmatically adjust configuration, replicate data to local tables and, of course, interact directly with the ping.fm API. Here’s a quick summary of the procedures currently in the suite… Procedure Classification Comment ping_cfg_debug Configuration [...]<p>Post from: <a href="http://www.youdidwhatwithtsql.com">youdidwhatwithtsql.com</a><br/><br/><a href="http://www.youdidwhatwithtsql.com/ping-sql-sneak-peek/38">Ping-SQL Sneak Peek</a></p>
]]></description>
			<content:encoded><![CDATA[<p><a href="http://ping-sql.com/" target="_blank">Ping-SQL</a> allows you to play with the <a href="http://ping.fm" target="_blank">Ping.fm</a>&#160;<a href="http://groups.google.com/group/pingfm-developers/web/api-documentation" target="_blank">API</a> with standard T-SQL in Microsoft SQL Server 2005 and above. <a href="http://www.ping-sql.com" target="_blank">Ping-SQL</a> includes procedures to programmatically adjust configuration, replicate data to local tables and, of course, interact directly with the ping.fm API. Here’s a quick summary of the procedures currently in the suite…</p>
<table cellspacing="0" cellpadding="0" border="1">
<tbody>
<tr>
<td valign="top" width="200">
<p><b>Procedure</b></p>
</td>
<td valign="top" width="119">
<p><b>Classification</b></p>
</td>
<td valign="top" width="297">
<p><b>Comment</b></p>
</td>
</tr>
<tr>
<td valign="top" width="200">
<p>ping_cfg_debug</p>
</td>
<td valign="top" width="119">
<p>Configuration</p>
</td>
<td valign="top" width="297">
<p>Allows you to avoid posting test data to the ping.fm API when set to On / 1.</p>
</td>
</tr>
<tr>
<td valign="top" width="200">
<p>ping_cfg_license_key</p>
</td>
<td valign="top" width="119">
<p>Configuration</p>
</td>
<td valign="top" width="297">
<p>Change the Ping-SQL License key.</p>
</td>
</tr>
<tr>
<td valign="top" width="200">
<p>ping_cfg_no_rsp</p>
</td>
<td valign="top" width="119">
<p>Configuration</p>
</td>
<td valign="top" width="297">
<p>Removes any data table called “rsp” from resultsets.</p>
</td>
</tr>
<tr>
<td valign="top" width="200">
<p>ping_cfg_no_services</p>
</td>
<td valign="top" width="119">
<p>Configuration</p>
</td>
<td valign="top" width="297">
<p>Removes any data tables called “services” from resultsets.</p>
</td>
</tr>
<tr>
<td valign="top" width="200">
<p>ping_cfg_resultset_send</p>
</td>
<td valign="top" width="119">
<p>Configuration</p>
</td>
<td valign="top" width="297">
<p>Changes the way resultsets are presented.</p>
</td>
</tr>
<tr>
<td valign="top" width="200">
<p>ping_cfg_sys_debug</p>
</td>
<td valign="top" width="119">
<p>Configuration</p>
</td>
<td valign="top" width="297">
<p>Enables Ping-SQL application debugging.</p>
</td>
</tr>
<tr>
<td valign="top" width="200">
<p>ping_cfg_user_key</p>
</td>
<td valign="top" width="119">
<p>Configuration</p>
</td>
<td valign="top" width="297">
<p>Allows the user key used to authenticate with ping.fm to be changed.</p>
</td>
</tr>
<tr>
<td valign="top" width="200">
<p>ping_sys_systemServicesTable</p>
</td>
<td valign="top" width="119">
<p>Data Replication</p>
</td>
<td valign="top" width="297">
<p>Creates a local table containing the data returned from the system.services API method. This table is called ping_systemServicesTable. Any existing table with this name is dropped first.</p>
</td>
</tr>
<tr>
<td valign="top" width="200">
<p>ping_sys_userServicesTable</p>
</td>
<td valign="top" width="119">
<p>Data Replication</p>
</td>
<td valign="top" width="297">
<p>Creates a local table containing the data returned from the user.services API method. The table is called ping_userServicesTable. Any existing table with this name is dropped first.</p>
</td>
</tr>
<tr>
<td valign="top" width="200">
<p>ping_systemServices</p>
</td>
<td valign="top" width="119">
<p>Ping.fm API</p>
</td>
<td valign="top" width="297">
<p>Retuns a complete list of services supported by ping.fm.</p>
</td>
</tr>
<tr>
<td valign="top" width="200">
<p>ping_userKey</p>
</td>
<td valign="top" width="119">
<p>Ping.fm API</p>
</td>
<td valign="top" width="297">&#160;</td>
</tr>
<tr>
<td valign="top" width="200">
<p>ping_userLatest</p>
</td>
<td valign="top" width="119">
<p>Ping.fm API</p>
</td>
<td valign="top" width="297">
<p>Returns the last 25 messages a user has posted through Ping.fm.</p>
</td>
</tr>
<tr>
<td valign="top" width="200">
<p>ping_userPost</p>
</td>
<td valign="top" width="119">
<p>Ping.fm API</p>
</td>
<td valign="top" width="297">
<p>Post a message to the users ping.fm services.</p>
</td>
</tr>
<tr>
<td valign="top" width="200">
<p>ping_userServices</p>
</td>
<td valign="top" width="119">
<p>Ping.fm API</p>
</td>
<td valign="top" width="297">
<p>Returns a list of services the user has configured in their ping.fm account.</p>
</td>
</tr>
<tr>
<td valign="top" width="200">
<p>ping_userTriggers</p>
</td>
<td valign="top" width="119">
<p>Ping.fm API</p>
</td>
<td valign="top" width="297">
<p>Returns a list of custom triggers.</p>
</td>
</tr>
<tr>
<td valign="top" width="200">
<p>ping_userValidate</p>
</td>
<td valign="top" width="119">
<p>Ping.fm API</p>
</td>
<td valign="top" width="297">
<p>Validates the configured user key.</p>
</td>
</tr>
</tbody>
</table>
<p>So what can you do with <a href="http://www.ping-sql.com" target="_blank">Ping-SQL</a>?</p>
<p><strong>Update your Facebook status with Ping-SQL</strong></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p38code9'); return false;">View Code</a> T-SQL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p389"><td class="code" id="p38code9"><pre class="t-sql" style="font-family:monospace;">-- Update your facebook status with Ping-SQL
DECLARE @status VARCHAR(140),
		@optional VARCHAR(100);
&nbsp;
-- Status message to post
SET @status = 'is posting my status to facebook';
-- Specify the service to post to here
SET @optional = 'service=facebook'
&nbsp;
EXEC dbo.ping_userPost null, @status, @optional, null, null;</pre></td></tr></table></div>

<p><strong>Post to Twitter with Ping-SQL</strong></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p38code10'); return false;">View Code</a> T-SQL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3810"><td class="code" id="p38code10"><pre class="t-sql" style="font-family:monospace;">-- Twitter microblogging with Ping-SQL
DECLARE @microblog VARCHAR(140),
		@optional VARCHAR(100);
&nbsp;
-- Status message to post
SET @microblog = 'Drinking Coffee at home';
-- Specify the service to post to here
SET @optional = 'service=twitter'
&nbsp;
EXEC dbo.ping_userPost null, @microblog, @optional, null, null;</pre></td></tr></table></div>

<p><strong>Post to Blogger with Ping-SQL</strong></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p38code11'); return false;">View Code</a> T-SQL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3811"><td class="code" id="p38code11"><pre class="t-sql" style="font-family:monospace;">-- Post to Blogger with Ping-SQL
DECLARE @title VARCHAR(100),
		@blog VARCHAR(MAX),
		@optional VARCHAR(100);
&nbsp;
-- Set the title of your blog
SET @title= 'Test Blog Title';
-- The blog text
SET @blog = 'Lorem ipsum dolor sit amet, consectetur 
adipisicing elit, sed do eiusmod tempor incididunt ut 
labore et dolore magna aliqua. Ut enim ad minim veniam, 
quis nostrud exercitation ullamco laboris nisi ut aliquip 
ex ea commodo consequat. Duis aute irure dolor in 
reprehenderit in voluptate velit esse cillum dolore eu 
fugiat nulla pariatur. Excepteur sint occaecat cupidatat 
non proident, sunt in culpa qui officia deserunt mollit 
anim id est laborum.';
&nbsp;
-- Specify the service to post to here
-- and set the title tag
SET @optional = 'service=blogger&amp;amp;title=' + @title;
&nbsp;
-- Important @post_method must be set to blog!
EXEC dbo.ping_userPost 'blog', @blog, @optional, null, null;</pre></td></tr></table></div>

<p><strong>Upload Photos to Flickr with Ping-SQL</strong></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p38code12'); return false;">View Code</a> T-SQL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3812"><td class="code" id="p38code12"><pre class="t-sql" style="font-family:monospace;">-- Upload a photo to Flickr!
DECLARE @title VARCHAR(140),
		@optional VARCHAR(100),
		@media_path VARCHAR(100);
&nbsp;
-- Title of the Photo
SET @title = 'Pink Floyd Album Covers';
-- Specify the service to post to here
SET @optional = 'service=flickr';
-- Set the image path 
SET @media_path = 'C:\Users\Rhys\Pictures\pink_floyd_001.jpg';
&nbsp;
EXEC dbo.ping_userPost null, @title, @optional, @media_path, null;</pre></td></tr></table></div>

<p><a href="http://www.ping-sql.com" target="_blank">Ping-SQL</a> is also capable of calling <a href="http://ping.fm/triggers/" target="_blank">triggers</a> that you have setup on your <a href="http://ping.fm" target="_blank">ping.fm</a> account. In fact <a href="http://www.ping-sql.com" target="_blank">Ping-SQL</a> should be capable of calling any of the services supported by ping.fm. Write T-SQL to play with Bebo, Blogger, BrightKite, Facebook, FriendFeed, MySpace, Plurk, Twitter, WordPress.com, Yahoo 360, Yammer and many more.</p>
<p><map name='google_ad_map_38_a45beff5d2e172f6'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/38?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_38_a45beff5d2e172f6' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=38&amp;url=http%3A%2F%2Fwww.youdidwhatwithtsql.com%2Fping-sql-sneak-peek%2F38' title="Ping SQL Sneak Peek" alt=" Ping SQL Sneak Peek" /></p><p>Post from: <a href="http://www.youdidwhatwithtsql.com">youdidwhatwithtsql.com</a><br/><br/><a href="http://www.youdidwhatwithtsql.com/ping-sql-sneak-peek/38">Ping-SQL Sneak Peek</a></p>
<div class="none"><div class="g-plusone" data-href="http://www.youdidwhatwithtsql.com/ping-sql-sneak-peek/38" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.youdidwhatwithtsql.com/ping-sql-sneak-peek/38/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

