Activity overview
Latest activity by ksrangsy
I left out one thing from the example code, so I will post it again.
if (object_id('dbo.prTmp) is not null) drop proc dbo.prTmp
go
create proc dbo.prTmp @intEmployeeID int=Null
, @intReturnCode int=NULL output
, @chvErrorMessage varchar(255)=NULL output
/**********************************************************
Object: dbo.prTmp
Description: ...
Usage: dbo.prTmp @intReturnCode output = 0 for success, otherwise there is an error, @chvErrorMessage output = error message if any
Returns: lastName, firstName
$Workfile: prTmp.sql $
$Author: ... $. Email: ...
$Revision: x.y $
Example: exec dbo.prTmp;
Created: .... $Modtime: ... $.
**********************************************************/
as
set nocount on
if (@intEmployeeID Is Null) Goto Help
select lastName, firstName from employee (NoLock) where employeeID = @intEmployeeID @error
Help:
Exec sp_usage @objectName = 'dbo.prTmp'
, @desc = '...'
, @parameters='@intEmployeeID, ...'
, @example='exec dbo.prTmp ;'
, @returns='lastName, firstName'
, @author='...'
, @workfile='prTmp.sql'
, @email='...'
, @version='x', @revision='y'
, @datecreated='...', @datelastchanged='...'
return -1
go
grant execute on dbo.prTmp to execprocs
go
when executing just the stored procedure name, the message returned is what's in the comments directly after the parameters in the stored procedure, copy & paste. But if I copy one line at a time and create the newline characters myself, then SQL Prompt works perfectly. So I think it has something to do with the newline character when mass copying comments from the "Messages" result set.
So I guess I'm going to have to change my commenting style, commenting style develope by my predicessor, or is there something else I can do ... / comments
I left out one thing from the example code, so I will post it again.
if (object_id('dbo.prTmp) is not null) drop proc dbo.prTmp
go
create proc dbo.prTmp@intEmployeeID int=Null
, @intReturnCode int=...
Thanks for both replies. I tried opening up a stored procedure from a solution-project on my machine w/ SQL Studio 2005 and comment out the header and footer and SQL Prompt still doesn't kick in.
Here some example code that I use for all the stored procedures:
if (object_id('dbo.prTmp) is not null) drop proc dbo.prTmp
go
create proc dbo.prTmp @intEmployeeID int=Null
, @intReturnCode int=NULL output
, @chvErrorMessage varchar(255)=NULL output
as
set nocount on
if (@intEmployeeID Is Null) Goto Help
select lastName, firstName from employee (NoLock) where employeeID = @intEmployeeID @error
Help:
Exec sp_usage @objectName = 'dbo.prTmp'
, @desc = '...'
, @parameters='@intEmployeeID, ...'
, @example='exec dbo.prTmp ;'
, @returns='lastName, firstName'
, @author='...'
, @workfile='prTmp.sql'
, @email='...'
, @version='x', @revision='y'
, @datecreated='...', @datelastchanged='...'
return -1
go
grant execute on dbo.prTmp to execprocs
go
Also, when I copy a stored procedure into a new query analyzer and type select * from <ctl>+<space> "in the body" of the stored procedure, like in the example above, I get @intReturnCode (stored procedure parameter) instead of table names. But if I do it before I drop the procedure at the very beginning (example code above), SQL Prompt works perfectly from a stored procedure in a solution or new query.
Again, thanks for everyones help. / comments
Thanks for both replies. I tried opening up a stored procedure from a solution-project on my machine w/ SQL Studio 2005 and comment out the header and footer and SQL Prompt still doesn't kick in.
...
Client: (SQL Prompt installed)
OS - Windows XP Prof. SP2
Microsoft SQL Server Management Studio 2005 Standard
Region OS Setting - English
Platform - Dell Latitude D800 Intel M 1.7GHz, 1Gb memory
Framework - 1.1 & Hotfix, 2.0 & 2.0 SDK(ENU)
Server: (SQL Prompt not installed)
OS - Windows 2k SP2
Microsoft SQL Enterprise Manager 2000
Region OS Setting - English
Platform - Dell PowerEdge [image] Intel Xeo 2.8GHz, 2Gb memory
Framework - 1.1 & Hotfix, 2.0
Yes, I just started working with SQL Prompt and have only used it in query analyzer. Also the "Auto-Insert" doesn't work when I open a stored procedure from a solution-project and rarely when we type <ctl> + <space_bar> after key word "from " does a list of tables show in a stored procedure. These problems are also happening for a co-worker and we both have the same set-up. But when we open a new query analyzer, everthing works beautifully.
Thanks in advance. / comments
Client: (SQL Prompt installed)
OS - Windows XP Prof. SP2
Microsoft SQL Server Management Studio 2005 Standard
Region OS Setting - English
Platform - Dell Latitude D800 Intel M 1.7GHz, 1Gb memory
Fr...
SQL Prompt - Stored Procedures/Functions/Views
Hi, I was just wondering if anyone else is experiencing difficulties using SQL Prompt in existing Stored Procedure/Functions/Views. Because I get returned variable names that I locally declared wi...