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


Stored Procedure


Stored Procedure

Author
Message
edward_hall76
edward_hall76
SSC-Enthusiastic
SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)

Group: General Forum Members
Points: 182 Visits: 249
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
Eugene Elutin
Eugene Elutin
SSChampion
SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)

Group: General Forum Members
Points: 12822 Visits: 5478
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!":-D
(So many miracle inventions provided by MS to us...)

How to post your question to get the best and quick help
edward_hall76
edward_hall76
SSC-Enthusiastic
SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)

Group: General Forum Members
Points: 182 Visits: 249
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.
anthony.green
anthony.green
One Orange Chip
One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)

Group: General Forum Members
Points: 25132 Visits: 6519
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
When a question, really isn't a question - Jeff Smith
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


edward_hall76
edward_hall76
SSC-Enthusiastic
SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)

Group: General Forum Members
Points: 182 Visits: 249
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.
GilaMonster
GilaMonster
SSC Guru
SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)SSC Guru (230K reputation)

Group: General Forum Members
Points: 230124 Visits: 46344
Could you explain your need in more detail please? 'reopen'???

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
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


edward_hall76
edward_hall76
SSC-Enthusiastic
SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)

Group: General Forum Members
Points: 182 Visits: 249
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.
anthony.green
anthony.green
One Orange Chip
One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)

Group: General Forum Members
Points: 25132 Visits: 6519
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
When a question, really isn't a question - Jeff Smith
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


Lowell
Lowell
SSC Guru
SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)SSC Guru (73K reputation)

Group: General Forum Members
Points: 73959 Visits: 40974
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
--help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!
edward_hall76
edward_hall76
SSC-Enthusiastic
SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)

Group: General Forum Members
Points: 182 Visits: 249
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
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