SQL Server
  Home arrow SQL Server arrow SQL Sever: Storing Code in Binary or Text ...
Moblin
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Actuate Whitepapers 
Moblin 
JMSL Numerical Library 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
SQL SERVER

SQL Sever: Storing Code in Binary or Text Files Rather than Stored Procedures
By: Raghavendra Narayana
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 21
    2003-10-21

    Table of Contents:
  • SQL Sever: Storing Code in Binary or Text Files Rather than Stored Procedures
  • Case 1: .INI File
  • Case 2: SQL Query
  • Case 3: Complete Stored Procedure in a Binary File
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!

    SQL Sever: Storing Code in Binary or Text Files Rather than Stored Procedures


    (Page 1 of 5 )

    Learn how to extend SQL Server's capabilities by making use of binary and text files, to execute SQL queries, in place of Stored Procedures.

    The base idea of this article is to extend the boundary of SQL Server.  The code of a Stored Procedure or User Defined Function need not to reside only in SP/UDF; you can have the code or a part of the code in ASCII/Binary/Other file format and stored under a specific server/folder.  This concept is useful while introducing .INI file concept in SQL Server.  Plus, you can avoid re-compilation of Stored Procedures on every minor change.  To some extent this concept also introduces code security and non-sharing of business logics.

    Advantages

    • For security purposes:
      • Store the “Query/Part of query/Stored Procedure” in a Text/Binary/other file format.  Read it through “Bulk Insert” command or through any other feature of SQL SERVER for execution.
      • Include an encryption/decryption algorithm to store/retrieve the complete/part of code for execution from a Text or other file format.
    • Reduce the creation/usage of GUIs if the input data is minimal. You can even come out with some innovative approaches by making use of “Replaceable Parameter in batch files” ( a DOS concept).
    • Access/Leverage can be given to users who have SQL Query knowledge.
    • Reduce the Developer/DBA work/involvement in certain specific tasks where business ideas cannot be shared with the Development team.

    Let us explore the cases where we can make use of this concept.  Case 1 and 2 explained here are expectable project requirements.  However, case 3 can be thought about in terms of security.

    More SQL Server Articles
    More By Raghavendra Narayana


     

    SQL SERVER ARTICLES

    - Executing SQL Server Stored Procedure from P...
    - How to Search for Date and Time Values Using...
    - Replication: SQL Server 2000 - Part 2
    - Replication: SQL Server 2000 - Part 1
    - SQL Sever: Storing Code in Binary or Text Fi...
    - Execute SQL on Multiple Tables/Columns - New...
    - How to Connect to a SQL Server from Visual F...
    - SQL Server Hardware Tuning and Performance M...
    - Primary Key on Multiple Tables – New RDBMS C...
    - Migrating from Sybase to SQL Server
    - What's Best for DBAs? GUI or T-SQL Comma...
    - How to Perform a SQL Server Performance Audit
    - An Introduction To The Bulk Copy Utility
    - SQL Server Stored Procedures 101
    - Building Your First SQL Server 2000 Database


    Iron Speed





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway