SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Microsoft SQL Server Management Studio Question


Microsoft SQL Server Management Studio Question

Author
Message
Xarzu
Xarzu
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 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.
subbu_e
subbu_e
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1411 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
Hardy21
Hardy21
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1562 Visits: 1399
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
Grant Fritchey
Grant Fritchey
SSC-Dedicated
SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)SSC-Dedicated (39K reputation)

Group: General Forum Members
Points: 39396 Visits: 32630
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 and SQL Server Execution Plans
Product Evangelist for Red Gate Software
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search