Click here to Skip to main content
Click here to Skip to main content

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

, 3 Feb 2007 CPOL
Rate this:
Please Sign up or sign in to vote.
This add-in lets you navigate to the specified SQL stored procedure if you refer to it in your code,
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)

Share

About the Author

alaac#
Web Developer
Jordan Jordan
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

Comments and Discussions

 
QuestionVS 2005 compatible ? Pinmemberianhorowitz15-May-08 1:54 
GeneralCREATE Procedure or CREATE Proc PinmvpMark Nischalke3-Feb-07 10:40 
AnswerRe: CREATE Procedure or CREATE Proc Pinmemberalaac#3-Feb-07 20:29 
GeneralDon't use sp_ PinmvpMark Nischalke3-Feb-07 10:37 
AnswerRe: Don't use sp_ Pinmemberalaac#3-Feb-07 20:34 
GeneralRe: Don't use sp_ PinmemberKing_kLAx4-Feb-07 3:09 
GeneralRe: Don't use sp_ PinmvpMark Nischalke4-Feb-07 5:52 

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.

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