473,513 Members | 2,537 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

To filter store procedures that only do select operation in a particular Database

1 New Member
Hi,
Do you know is there any procedure that we can find store procedures in a database that only do select operation rather than alter,update are delete operation and can use a cursor from the results to grant exec permissions to a particular login group on those selected stored procedures.

Thanks,
Harish.
Jan 23 '08 #1
2 1211
ck9663
2,878 Recognized Expert Specialist
Hi,
Do you know is there any procedure that we can find store procedures in a database that only do select operation rather than alter,update are delete operation and can use a cursor from the results to grant exec permissions to a particular login group on those selected stored procedures.

Thanks,
Harish.
what about trigger on tables?

-- ck
Jan 24 '08 #2
Delerna
1,134 Recognized Expert Top Contributor
Do you mean something like this

Expand|Select|Wrap|Line Numbers
  1. SELECT ListProcs.[Name]
  2. from
  3. (select b.name
  4. from syscomments a
  5. join sysobjects b on a.ID=b.ID
  6. where text like '%Create Proc%') ListProcs
  7. join
  8. (select b.name
  9. from syscomments a
  10. join sysobjects b on a.ID=b.ID
  11. where text like '%SELECT%') ListSelects on ListProcs.[Name]=ListSelects.[Name]
  12. left join
  13. (select b.name
  14. from syscomments a
  15. join sysobjects b on a.ID=b.ID
  16. where text like '%INSERT%') ListInserts  on ListProcs.[Name]=ListInserts.[Name]
  17. where ListInserts.[Name] is null
  18.  
this query will list all stored procedures that contain the string 'SELECT' and also does not contain the string 'INSERT'

Run it in query analyser and adjust it to suit your needs
Jan 24 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
7779
by: A.M. de Jong | last post by:
How does MicroSoft store the stored procedures in seperate files. What tools are used. Cause that's what I like to do too. Arno de Jong, The Netherlands. (SCPTFXR does not have the option to store the stored procedures in different files I think)
4
7958
by: TJ Olaes | last post by:
Hello all, this is my second post to this newsgroup. It's a question about stored procedures and permissions and how these behave between databases. Here's the scenario. I have a database that stores information for a system "A", and I have a different database on the same SQL server that stores the login and other info "LOGIN". I write a...
11
2607
by: Bă§TăRĐ | last post by:
I have been working on this particular project for a little over 2 weeks now. This product contains between 700-900 stored procedures to handle just about all you can imagine within the product. I just personally rewrote/reformatted close to 150 of them myself. Nothing too fancy, mostly a lot of formatting. We have a little down time between Q/A...
7
2252
by: BlueDragon | last post by:
The place where I work is moving to MS SQL Server from Lotus Notes. I have done a lot of coding in Lotus Notes, and have, I suppose, intermediate skills in basic SQL -- queries, insert, updates, table design, etc. I have a couple of questions, however. First, stored procedures vs. functions. In my world, a function is a body of code that...
11
11970
by: Matt | last post by:
Hi everyone, still pretty new to MySQL. I was wondering if there is a way to automatically filter records based on a mysql userlogin name?? I have serveral databases that I want to combine in order to manage the databases more efficiently. - I'm currently using MySQL 4.1.12 and I'm currently testing 5.0.14 - I have a databases for each...
1
2323
by: Rhino | last post by:
I am trying to get a sense of requirements and best practices for Java stored procedures in DB2 V7.2 for Windows. 1. Is it required or recommended that any of the following be closed before leaving the stored procedure: open Statement and PreparedStatement objects; open ResultSet objects; open JDBC connections? Although the stored procedure...
4
1894
by: Mike L. Bell | last post by:
As the DBA for a development project a couple of years ago, I was in charge of migrating/promoting stored procedures from the development environment to the QA and production environments once they had been proven. I automated the process with a script that sucked the source code from source database, removed proc if exsists in target...
0
346
by: bcreighton | last post by:
I have created a bound subform on an unbound masterform linked together with a common field (A store's identification number) using an unbound combobox on the masterform and an invisible field on the subquery, which filters for a particular store. The subform is in continuous mode. So, what you see when you select a store is a list of all...
5
4051
by: jc | last post by:
Hi. I am in a situation with an engineering application involving monitoring of press operations. This involves storage of numbers for both an X and Y arrays. The number of element within the arrays varies slightly but should be identical for a singular press operation. One approach is to store an element in a row. This would be 6000...
0
7270
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7178
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7397
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7563
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7543
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5102
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3252
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
813
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
470
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.