Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2008
»
SQL Server 2008 - General
»
Stored Procedure
15 posts, Page 1 of 2
1
2
»»
Stored Procedure
Rate Topic
Display Mode
Topic Options
Author
Message
edward_hall76
edward_hall76
Posted Tuesday, November 13, 2012 8:01 AM
Valued Member
Group: General Forum Members
Last Login: Friday, May 10, 2013 2:46 PM
Points: 53,
Visits: 190
I have a stored procedure and want to know after I run it is there away to get it to reopen with out having to right click on it and telling it to execute it.
USE [IT]
GO
/****** Object: StoredProcedure [IT].[Insert WorkRequest proc] Script Date: 11/13/2012 08:45:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER PROCEDURE [IT].[Insert WorkRequest proc]
-- Add the parameters for the stored procedure here
@DeptID int,
@ITDeptID int,
@Department nvarchar(25),
@problem nvarchar(50),
@completed nchar(4),
@notes nvarchar(255)
--@StartDate [datetime],
--@EndDate [datetime]
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
insert into IT.WorkRequest
(DeptID,
ITDeptID,
Department,
problem,
completed,
notes)
Values
(
@DeptID,
@ITDeptID,
@Department,
@problem,
@completed,
@notes
)
----select * from it.WorkRequest
end
Post #1384115
Eugene Elutin
Eugene Elutin
Posted Tuesday, November 13, 2012 8:08 AM
SSCrazy
Group: General Forum Members
Last Login: Today @ 9:48 AM
Points: 2,534,
Visits: 4,351
edward_hall76 (11/13/2012)
I have a stored procedure and want to know after I run it is there away to get it to reopen with out having to right click on it and telling it to execute it.
...
?????
What do you mean by "get it to reopen"? Do you want to see its code?
Right click on it and select Modify...
OR:
sp_helptext [stored proc name]
_____________________________________________
"The only true wisdom is in knowing you know nothing"
"O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!"
(So many miracle inventions provided by MS to us...)
How to post your question to get the best and quick help
Post #1384118
edward_hall76
edward_hall76
Posted Tuesday, November 13, 2012 8:14 AM
Valued Member
Group: General Forum Members
Last Login: Friday, May 10, 2013 2:46 PM
Points: 53,
Visits: 190
Is there away after it has ran get it to reopen so you can insert the information using the proc without having to right click on it and telling it to execute.
Post #1384120
anthony.green
anthony.green
Posted Tuesday, November 13, 2012 8:17 AM
SSCertifiable
Group: General Forum Members
Last Login: Friday, April 12, 2013 3:51 AM
Points: 5,075,
Visits: 4,831
If you know what data you want to insert via the proc, just call the proc using the exec / execute clause
EXEC [IT].[Insert WorkRequest proc] @.... = '' , @.... = '' ............
Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1
&
Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger
Post #1384123
edward_hall76
edward_hall76
Posted Tuesday, November 13, 2012 8:26 AM
Valued Member
Group: General Forum Members
Last Login: Friday, May 10, 2013 2:46 PM
Points: 53,
Visits: 190
sorry for not explaining very well. I have a proc
when I right click on it it brings up a execute proc I enter the information in it and hit ok it excutes. I want it to open the execute proc window again after I hit ok. is there some way to do this.
Post #1384126
GilaMonster
GilaMonster
Posted Tuesday, November 13, 2012 8:26 AM
SSC-Dedicated
Group: General Forum Members
Last Login: Today @ 3:07 PM
Points: 37,687,
Visits: 29,946
Could you explain your need in more detail please? 'reopen'???
Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild
: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter
We stand on the bridge and no one may pass
Post #1384127
edward_hall76
edward_hall76
Posted Tuesday, November 13, 2012 8:32 AM
Valued Member
Group: General Forum Members
Last Login: Friday, May 10, 2013 2:46 PM
Points: 53,
Visits: 190
I have a proc called IT.InsertWorkRequestProc I right click on it and tell it to execute and it brings up a execute proc window for me to enter the information and I hit ok and it execute it. Is there some way to put an exec statement in there that will reopen the execute proc after it has ran so you can just enter the information again with out having to right click on the proc and telling it to execute.
Post #1384128
anthony.green
anthony.green
Posted Tuesday, November 13, 2012 8:37 AM
SSCertifiable
Group: General Forum Members
Last Login: Friday, April 12, 2013 3:51 AM
Points: 5,075,
Visits: 4,831
The only way to bring the Execute Procedure screen back up is to right click the procedure and select the execute option.
Or as I have said above, you know what information you want to pass in via the parameters so just build an EXEC string up passing in the values you want
EXEC [IT].[Insert WorkRequest proc] @DeptID = '', @ITDeptID = '', @Department = '', @problem = '', @completed = '', @notes = ''
Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1
&
Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger
Post #1384129
Lowell
Lowell
Posted Tuesday, November 13, 2012 9:03 AM
SSChampion
Group: General Forum Members
Last Login: Today @ 5:28 PM
Points: 11,627,
Visits: 27,692
the issue here is GUI dependancy;
you've got to get used to using the TSQL window for your commands, instead of using the GUI tools.
if you right click on a procedure, you get a form where you can enter the values for the parameters for the given procedure;
it's much easier to simply use TSQL to do that instead.
here's an example, showing both methods at the same time.
note that after you populate the values for the parameters, if you click the "Script" icon in the upper left of the window, you can get a TSQL window built for you automatically.
Lowell
--
There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #1384141
edward_hall76
edward_hall76
Posted Tuesday, November 13, 2012 9:15 AM
Valued Member
Group: General Forum Members
Last Login: Friday, May 10, 2013 2:46 PM
Points: 53,
Visits: 190
ok. where I work not all people know how to write tsql code and if they mess up the tsql they do not know how to fix it is why using theymuse the proc GUI. I just though there might be away of getting the GUI to reopen after running it without having to right click on the proc
Post #1384149
« Prev Topic
|
Next Topic »
15 posts, Page 1 of 2
1
2
»»
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.