dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Database problem

  1. #1
    Raja Guest

    Database problem


    Hi all,

    I am using SQL in my ASP code . But when the columns in my database change
    i may have to go to every ASP code and change the SQL statement.
    Can some one tell me how to avoid this (A little example would help)

    Thanks,
    Raja

  2. #2
    JS Guest

    Re: Database problem


    Use Stored Procedures and alias every column...that way you only need to change
    the stored proc, not wade through code...

    create procedure[dbo].[myproc]
    as
    select column1 as column1 from table1


    in your asp you would just call the proc and reference the alias in your
    code....

    if a column name changes, just change your proc...

    create procedure[dbo].[myproc]
    as
    select NEWColumn as column1 from table1

    and you wont need to touch your ASP at all






    "Raja" <arch_and@yahoo.co.uk> wrote:
    >
    >Hi all,
    >
    >I am using SQL in my ASP code . But when the columns in my database change
    > i may have to go to every ASP code and change the SQL statement.
    >Can some one tell me how to avoid this (A little example would help)
    >
    >Thanks,
    >Raja



  3. #3
    chida Guest

    Re: Database problem


    "Raja" <arch_and@yahoo.co.uk> wrote:
    >
    >Hi all,
    >
    >I am using SQL in my ASP code . But when the columns in my database change
    > i may have to go to every ASP code and change the SQL statement.
    >Can some one tell me how to avoid this (A little example would help)
    >
    >Thanks,
    >Raja


    For this kind situation the best posssible solution I could think would be
    writing stored procedure.

    This may help!

    Chida

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center