2

With microsoft sql server manager i know how to get this problem solved, but on the hosting where i am trying to update a old ASP Vbscript website i dont have access to this manager. and my question is: Is possible from ASP VBscript environement to access a stored procedure sql script ? and to see what sql queries were used for this stored procedure ? I know how to show their names but also i am interested in their content to know what tables do not touch with my modifications.

2 Answers 2

2

Here's a nice little tutorial example

First, show all the stored procedures in the database:

SELECT * FROM sysobjects WHERE type = 'P' AND category = 0 ORDER BY name

Next, retrieve a stored procedure's contents :

SELECT text 
FROM syscomments 
WHERE id = (SELECT id FROM sysobjects WHERE name = '{0}') 
ORDER BY colid
Sign up to request clarification or add additional context in comments.

Comments

0

You could run a query like this:

SELECT definition 
    FROM sys.sql_modules 
    WHERE object_id = OBJECT_ID('YourProcedureName')

3 Comments

Joe thanks for your response but in my DB i dont have this table sys.sql_modules.
@Constantine: I should have asked what version of SQL Server. You must be using 2000 or earlier?
i am not sure, it should be close to SQL Server 2000, because website was built before 2005

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.