Logo

Navigation
  • Home
  • Services
    • ERP Solutions
    • Implementation Solutions
    • Support and Maintenance Solutions
    • Custom Solutions
    • Upgrade Solutions
    • Training and Mentoring
    • Web Solutions
    • Production Support
    • Architecture Designing
    • Independent Validation and Testing Services
    • Infrastructure Management
  • Expertise
    • Microsoft Development Expertise
    • Mobile Development
    • SQL Server Database and BI
    • SAP BI, SAP Hana, SAP BO
    • Oracle and BI
    • Oracle RAC
  • Technical Training
    • Learn Data Management
      • Business Intelligence
      • Data Mining
      • Data Modeling
      • Data Warehousing
      • Disaster Recovery
    • Learn Concepts
      • Application Development
      • Client Server
      • Cloud Computing Tutorials
      • Cluster Computing
      • CRM Tutorial
      • EDI Tutorials
      • ERP Tutorials
      • NLP
      • OOPS
      • Concepts
      • SOA Tutorial
      • Supply Chain
      • Technology Trends
      • UML
      • Virtualization
      • Web 2.0
    • Learn Java
      • JavaScript Tutorial
      • JSP Tutorials
      • J2EE
    • Learn Microsoft
      • MSAS
      • ASP.NET
      • ASP.NET 2.0
      • C Sharp
      • MS Project Training
      • Silverlight
      • SQL Server 2005
      • VB.NET 2005
    • Learn Networking
      • Networking
      • Wireless
    • Learn Oracle
      • Oracle 10g
      • PL/SQL
      • Oracle 11g Tutorials
      • Oracle 9i
      • Oracle Apps
    • Learn Programming
      • Ajax Tutorial
      • C Language
      • C++ Tutorials
      • CSS Tutorial
      • CSS3 Tutorial
      • JavaScript Tutorial
      • jQuery Tutorial
      • MainFrame
      • PHP Tutorial
      • VBScript Tutorial
      • XML Tutorial
    • Learn Software Testing
      • Software Testing Types
      • SQA
      • Testing
  • Career Training
    • Career Improvement
      • Career Articles
      • Certification Articles
      • Conflict Management
      • Core Skills
      • Decision Making
      • Entrepreneurship
      • Goal Setting
      • Life Skills
      • Performance Development
      • Personal Excellence
      • Personality Development
      • Problem Solving
      • Relationship Management
      • Self Confidence
      • Self Supervision
      • Social Networking
      • Strategic Planning
      • Time Management
    • Education Help
      • Career Tracks
      • Essay Writing
      • Internship Tips
      • Online Education
      • Scholarships
      • Student Loans
    • Managerial Skills
      • Business Communication
      • Business Networking
      • Facilitator Skills
      • Managing Change
      • Marketing Management
      • Meeting Management
      • Process Management
      • Project Management
      • Project Management Life Cycle
      • Project Management Process
      • Project Risk Management
      • Relationship Management
      • Task Management
      • Team Building
      • Virtual Team Management
    • Essential Life Skills
      • Anger Management
      • Anxiety Management
      • Attitude Development
      • Coaching and Mentoring
      • Emotional Intelligence
      • Stress Management
      • Positive Thinking
    • Communication Skills
      • Conversation Skills
      • Cross Culture Competence
      • English Vocabulary
      • Listening Skills
      • Public Speaking Skills
      • Questioning Skills
    • Soft Skills
      • Assertive Skills
      • Influence Skills
      • Leadership Skills
      • Memory Skills
      • People Skills
      • Presentation Skills
    • Finding a Job
      • Etiquette Tips
      • Group Discussions
      • HR Interviews
      • Interview Notes
      • Job Search Tips
      • Resume Tips
      • Sample Resumes
 

SQL Server 2000: Using System and Extended Stored Procedures

By Exforsys | on March 13, 2005 |
SQL Server
This tutorial covers how to use System Stored Procedures which are stored in master and msdb databases and normally begin with ‘sp_’ and Extended Stored Procedures normally begin with ‘xp_’.

Using System Stored Procedures

Whenever you add a database, add a login, create a table or modify any object, the changes reflect in the system tables. System tables are used by the SQL server’s for its own reference but we can also view their contents. But the information stored in them is somewhat in binary or unreadable format, therefore Microsoft has given us System stored procedures (almost 650) to read or modify the data in them.
All system stored procedures are stored in master and msdb databases and normally begin with ‘sp_’

Some of the common System Stored Procedures are

Sp_tables: To show all tables for a particular database
Sp_stored_procedures: To show all stored procedures for a particular database
Sp_database: List the entire databases on the server
Sp_password: Used to change passwords for standard logins.

Using Extended Stored Procedures

The do just what their name implies: They extend the functionalities of SQL Server so that it can do things which normally a database server doesn’t expect to do. Fro example you will not expect a database server to check for file existence, show the files in a particular directory etc. Their name starts with “xp_”

I am giving you two examples of extended stored procedures.

xp_cmdshell: This stored procedure is used to run commands which are usually run from command prompt such as dir command.

The example below will display the directory of files in drive C:

USE Master
Exec xp_cmdshell ‘dir c:’




xp_fileexist: This stored procedure is used to test the existence of the specified file. It returns ‘1’ if file exists otherwise 0.

USE Master
Exec xp_fileexist ‘c:\temp.txt’

The above query check whether the file “temp.txt’ resides in C:. Here is the result,


I think the topic should now be concluded. Stored Procedures are very powerful tool in SQL server to enhance performance and security, make database management easier and for administrative tasks.

« « SQL Server 2000: Securing Your Stored Procedure
Oracle 9i Procedures and Functions » »

Author Description

Avatar

Editorial Team at Exforsys is a team of IT Consulting and Training team led by Chandra Vennapoosa.

Free Training

RSSSubscribe 394 Followers
  • Popular
  • Recent
  • SQL Server 2000:Creating and Using Stored Procedures

    March 12, 2005 - 0 Comment
  • SQL Server 2000: Creating Stored Procedure with Input and Output Parameters

    March 12, 2005 - 0 Comment
  • SQL Server 2000 Training Details

    March 11, 2005 - 0 Comment
  • SQL Server 2000: Securing Your Stored Procedure

    March 13, 2005 - 0 Comment
  • SQL Server 2000: Using Views in SQL Server

    March 17, 2005 - 0 Comment
  • SQL Server 2000: Using Views in SQL Server

    March 17, 2005 - 0 Comment
  • SQL Server 2000: Securing Your Stored Procedure

    March 13, 2005 - 0 Comment
  • SQL Server 2000: Creating Stored Procedure with Input and Output Parameters

    March 12, 2005 - 0 Comment
  • SQL Server 2000:Creating and Using Stored Procedures

    March 12, 2005 - 0 Comment
  • SQL Server 2000 Training Details

    March 11, 2005 - 0 Comment

Exforsys e-Newsletter

ebook
 

Related Articles

  • SQL Server 2000: Using Views in SQL Server
  • SQL Server 2000: Securing Your Stored Procedure
  • SQL Server 2000: Creating Stored Procedure with Input and Output Parameters
  • SQL Server 2000:Creating and Using Stored Procedures
  • SQL Server 2000 Training Details

Latest Articles

  • Project Management Techniques
  • Product Development Best Practices
  • Importance of Quality Data Management
  • How to Maximize Quality Assurance
  • Utilizing Effective Quality Assurance Strategies
  • Sitemap
  • Privacy Policy
  • DMCA
  • Trademark Information
  • Contact Us
© 2023. All Rights Reserved.IT Training and Consulting
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.AcceptReject Read More
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT