Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Microsoft SQL Server Management Studio Question Expand / Collapse
Author
Message
Posted Wednesday, October 13, 2010 10:57 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, October 13, 2010 10:56 PM
Points: 1, Visits: 0
I am new to writing stored procedures and this will be my first stored procedure written with Microsoft SQL Server Management Studio. I am familiar with working with VS 2010 and I have noticed that the IDE is very different. So, let's start with the basics. How do I go about adding a new stored procedure into the group of stores procedures that the project currently has. I already know that name and the T-SQL code I need. I just need to put it.
Post #1004123
Posted Thursday, October 14, 2010 1:07 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Sunday, November 25, 2012 6:31 PM
Points: 1,375, Visits: 173
if i understand correctly you need to create a Stored Procedure in your SQL 2005 or later Databases.

Steps :
1 . Open SQL Server management Studio
2. Select you SQL Server Name and login to your instance
3. You can see left hand side you server name tree will be build and expand the tree you can see the list of databases
4. Expand your Database Tree you can find folder called Stored Procedure , Right click on Stored procedure and Select NEw Query window. and paste you T-SQL (Create Store procedure Code)
5. Make sure that you have the error free T-SQL
6. Press F5 , your command will executed sucessflully and will create a new stored procedure and you can see them in the Stored procedure tree in the Step no 4.

In case you are looking for this let us know breifly about your query.


Regards,
Subbu
Click here to Get Speedy answer or solution
Post #1004155
Posted Thursday, October 14, 2010 1:51 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, October 14, 2014 4:43 AM
Points: 1,130, Visits: 1,391
Xarzu (10/13/2010)
I am new to writing stored procedures and this will be my first stored procedure written with Microsoft SQL Server Management Studio. I am familiar with working with VS 2010 and I have noticed that the IDE is very different. So, let's start with the basics. How do I go about adding a new stored procedure into the group of stores procedures that the project currently has. I already know that name and the T-SQL code I need. I just need to put it.

VS2010 contains Object Explorer. If you are using database project then go to schema editor/viewer and drip down to stored procedure folder. Right click -> add new stored procedure -> type stored proc name & add your code.


Thanks
Post #1004164
Posted Thursday, October 14, 2010 6:20 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 9:47 AM
Points: 13,872, Visits: 28,270
Another way to generate procedures, that many people don't take advantage of, is to use the Templates offered by SSMS. If you click on the View menu and then Template Explorer, or hit Ctl-Alt-T, you'll see a window open with a whole bunch of folders. Scroll down to Store Procedures and open it. You'll see several options for creating procedures, including the "Create Stored Procedure (New Menu)" option, which is what you get when you bring up the context menu by right clicking on the Procedures folder in a database. Opening any of these will show you a template for creating a procedure. Make sure that you're in the correct database before running this code. If you hit Ctl-Shift-M you'll get a window that will allow you to replace the embedded parameters so that you can name your procedure and all the rest. It's also possible to create your own templates, so you can put error handling routines & other internal standards into a template and then use it.

----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of: SQL Server Query Performance Tuning
SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1004282
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse