Question : How to filter stored procedures returned by Server Explorer

Sirs:
I'm trying mightily to learn/use LinqToSQL. It seems to have a lot of possibilities...

I work in the Microsoft Dynamics GP database most of the time, that db has 25000 stored procedures (not exaggerating...). When I open the 'store procedures' folder in the Visual Studio 2008 Server Explorer, it take about 10 minutes to open.

I only need to see about 500 of the procs. Any way to filter, so that it opens quicker?

Answer : How to filter stored procedures returned by Server Explorer

Hi sgray128;

The alternative is to use the command line tool sqlmetal which ships with Visual Studio. To create a data context class with this tool do the following.

  1. Click on Start | Programs | Microsoft Visual Studio 2008 | Visual Studio Tools | Visual Studio 2008 Command Prompt  -  Don't use the standard Command prompt. 
  2. Change to the directory you want to create the DataContext class in. 
  3. Execute the following command
       sqlmetal /server:ServerName /database:DatabaseName /namespace:NamespaceForTheClass /code:NameForSourceFileDotVbOrCs /pluralize /functions /sprocs /views 
  4. In your project - Add existing item and select the class just created in step 3. 
  5. Done

    And example of step 3 would look like this: 
sqlmetal /server:VIPER /database:Northwind /namespace:Nwind /code:Northwind.vb /pluralize /functions /sprocs /views

/code:Northwind.vb  = change vb to cs to get code in C# and not in Visual Basic
/functions  - include UDF from the database
/sprocs  - include SP from the database
/views  -  include Views from the database


Fernando


Random Solutions  
 
programming4us programming4us