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 12»»

Stored Procedure Expand / Collapse
Author
Message
Posted Tuesday, November 13, 2012 8:01 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, November 5, 2014 6:30 AM
Points: 60, Visits: 240
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
Posted Tuesday, November 13, 2012 8:08 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Friday, December 12, 2014 10:09 AM
Points: 2,876, Visits: 5,201
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
Posted Tuesday, November 13, 2012 8:14 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, November 5, 2014 6:30 AM
Points: 60, Visits: 240
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
Posted Tuesday, November 13, 2012 8:17 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Monday, December 8, 2014 1:45 AM
Points: 5,221, Visits: 5,120
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
Posted Tuesday, November 13, 2012 8:26 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, November 5, 2014 6:30 AM
Points: 60, Visits: 240
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
Posted Tuesday, November 13, 2012 8:26 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 6:44 AM
Points: 40,614, Visits: 37,079
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
Posted Tuesday, November 13, 2012 8:32 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, November 5, 2014 6:30 AM
Points: 60, Visits: 240
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
Posted Tuesday, November 13, 2012 8:37 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Monday, December 8, 2014 1:45 AM
Points: 5,221, Visits: 5,120
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
Posted Tuesday, November 13, 2012 9:03 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 7:14 AM
Points: 12,955, Visits: 32,487
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
Posted Tuesday, November 13, 2012 9:15 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, November 5, 2014 6:30 AM
Points: 60, Visits: 240
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 »

Add to briefcase 12»»

Permissions Expand / Collapse