<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: Jharakesh's Code Snippets</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Sun, 18 May 2008 09:04:41 GMT</pubDate>
    <description>DZone Snippets: Jharakesh's Code Snippets</description>
    <item>
      <title>Find Exact Directory name of Variable Directory Name</title>
      <link>http://snippets.dzone.com/posts/show/4964</link>
      <description>This sql server procedure help you, if you have remmember some string of your directory and path name then you will get the exact directory name of that path.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;create proc usp_srchDir&lt;br /&gt;(&lt;br /&gt;	@pathName nvarchar(100),&lt;br /&gt;	@strDirName nvarchar(50),&lt;br /&gt;	@ExactName nvarchar(20) OUTPUT&lt;br /&gt;)&lt;br /&gt;AS&lt;br /&gt;BEGIN&lt;br /&gt;	SET NOCOUNT ON&lt;br /&gt;	DECLARE @strCMD nvarchar(500)&lt;br /&gt;	SET @strCMD='dir  "'+ @pathName +'" /ad/o | find /I "'+@strDirName+'"'&lt;br /&gt;	create table tblFindDIR(SearchDIRName nvarchar(200))&lt;br /&gt;	insert into tblFindDIR(SearchDIRName)	&lt;br /&gt;	exec master.dbo.xp_cmdshell @strCMD&lt;br /&gt;	delete from tblFindDIR where isnull(SearchDIRName,'')=''&lt;br /&gt;	select @ExactName=ltrim(rtrim(right(SearchDIRName,20))) from tblFindDIR where SearchDIRName like '%'+@strDirName+'%' &lt;br /&gt;	drop table tblFindDIR&lt;br /&gt;	SET NOCOUNT OFF&lt;br /&gt;END&lt;br /&gt;&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 09 Jan 2008 08:29:43 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4964</guid>
      <author>JhaRakesh (Rakesh Jha)</author>
    </item>
  </channel>
</rss>
