Click here to Skip to main content
Licence CPOL
First Posted 3 Feb 2007
Views 16,391
Downloads 56
Bookmarked 18 times

Goto definition Add-In but for SQL Stored Procedures !!

By | 3 Feb 2007 | Article
This add-in lets you navigate to the specified SQL stored procedure if you refer to it in your code,
 
Part of The SQL Zone sponsored by
See Also
Sample image

Introduction

Using this Add in, you can find the SQL stored procedure and open it within the VS IDE. I found it very useful.

Step 1: Install the Add-in and activate it in your VS.NET from tools->addin manager.

Step 2: You must have a Database project for your solution which is the most popular case.

Step 3: Copy file (XMLFile.xml) to your C:\ drive and put in it the path for your Database application.

<Path>C:\FileNet_VSS\Passports\Development\FNDevFramework\FNSysDB</Path> 

Just highlight the name of the SP in your Middle-Tier and click SPViewer icon.

The Code

Every SP begins with the Create statement in the *.sql file:

CREATE Procedure dbo.SP_NationalityCodes_Get

Or without the dbo:

CREATE Procedure SP_NationalityCodes_Get

This is the main idea of the search.

This is the first method:

applicationObject.Find.Target = vsFindTarget.vsFindTargetSolution;
applicationObject.Find.FindWhat=string.Format("CREATE Procedure dbo.{0}",sp); 
applicationObject.Find.PatternSyntax=vsFindPatternSyntax.vsFindPatternSyntaxLiteral;
applicationObject.Find.Action = vsFindAction.vsFindActionFind;
applicationObject.Find.MatchCase=false;
applicationObject.Find.MatchWholeWord=true;
applicationObject.Find.SearchPath=path;
applicationObject.Find.ResultsLocation = 
vsFindResultsLocation.vsFindResults1;
applicationObject.Find.FilesOfType="*.sql";
applicationObject.Find.SearchSubfolders=true;
EnvDTE.vsFindResult res = applicationObject.Find.Execute();

If there is no result, an exception will be thrown. This is the second method:

catch( Exception s)
{
applicationObject.Find.Target = vsFindTarget.vsFindTargetSolution;
applicationObject.Find.FindWhat=string.Format("CREATE Procedure {0}",sp); 
applicationObject.Find.PatternSyntax=vsFindPatternSyntax.vsFindPatternSyntaxLiteral;
applicationObject.Find.Action = vsFindAction.vsFindActionFind;
applicationObject.Find.MatchCase=false;
applicationObject.Find.MatchWholeWord=true;
applicationObject.Find.SearchPath=path;
applicationObject.Find.ResultsLocation = 
vsFindResultsLocation.vsFindResults1;
applicationObject.Find.FilesOfType="*.sql";
applicationObject.Find.SearchSubfolders=true;
applicationObject.Find.Execute();
}

Special thanks to my brother mohammed barqawi.

Hope it will be helpful for you.

History

  • 3rd February, 2007: Initial post

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

alaac#

Web Developer

Jordan Jordan

Member

i am a software developer i have interests in .net remoting ,asp.net , software engineering,
visual studio.net 2005 ,
also FileNet P8 the platform that i am working on
 
i found that eclipse is amazing IDE i may change to a J2EE developer because of him and the FileNet Smile | :)
 
i have started my programming trip since 2001
i hope it will be good with codeproject


Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
QuestionVS 2005 compatible ? Pinmemberianhorowitz0:54 15 May '08  
GeneralCREATE Procedure or CREATE Proc PinmvpMark Nischalke9:40 3 Feb '07  
AnswerRe: CREATE Procedure or CREATE Proc Pinmemberalaac#19:29 3 Feb '07  
GeneralDon't use sp_ PinmvpMark Nischalke9:37 3 Feb '07  
AnswerRe: Don't use sp_ Pinmemberalaac#19:34 3 Feb '07  
GeneralRe: Don't use sp_ PinmemberKing_kLAx2:09 4 Feb '07  
GeneralRe: Don't use sp_ PinmvpMark Nischalke4:52 4 Feb '07  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120517.1 | Last Updated 3 Feb 2007
Article Copyright 2007 by alaac#
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid