有没有办法在ASP页面中对SQL进行全局更改 [英] Is there way to do global changes to SQL in ASP pages

查看:65
本文介绍了有没有办法在ASP页面中对SQL进行全局更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有超过100个asp页面引用一个表(distribution_components)。

我们在该表中添加了一个新列和主键,所以现在我们必须修改

包含该列的where子句(我们必须在页面中将新列=设为

会话变量)


该表出现531次在我们的代码中。是否有一些工具或方法

允许我们在全局范围内更改它,而不是每次出现,并且

将新列添加到where子句

解决方案

>该表在我们的代码中出现531次。是否有一些实用工具或方法

允许我们全局更改它,而不是去每次出现,并且
将新列添加到where子句




如果sql语句完全相同,你可以使用Visual Studio或类似的东西进行全局搜索和

替换。如果你进行搜索并在sql语句的各种各样的实例上替换,你可能可以在

最少敲几下。


除此之外,我不确定其他任何方式...我认为你没有运气好。


< blockquote>这可能是切换到使用存储过程的好时机。


" johnston" <乔****** @ thot.com>在消息中写道

新闻:3f *********************** @ newscene.com ...

我们有超过100个asp页面引用表
(distribution_components)。我们为该表添加了一个新列和主键,所以现在我们必须修改where子句以包含该列(我们必须将新列=
设置为页面中的会话变量)

该表在我们的代码中出现531次。是否有一些util或方法
允许我们全局更改它,而不是去每次出现,并且
将新列添加到where子句



http://www.aspfaq.com/2201
http://www.aspfaq.com/2423


" johnston" <乔****** @ thot.com>在消息中写道

新闻:3f *********************** @ newscene.com ...

在文章< OT ************** @ TK2MSFTNGP12.phx.gbl> ;,Aaron Bertrand - MVP"
< aa *** @ TRASHaspfaq.com>写道:

这可能是切换到使用存储过程的好时机。

" johnston" <乔****** @ thot.com>在消息中写道
新闻:3f *********************** @ newscene.com ...

我们有引用

(distribution_components)。我们增加了一个新的列和主键到该表,所以现在我们必须
<表100 ASP页BR />修改 where子句为包括柱(我们必须使新的列
=

页面中的会话变量)

该表在我们的代码中出现531次。是有一些util的或方法

允许我们全局更改它,除了要每个occurrance,


并将新列添加到where子句



你有一个很好的网页或文章吗?很多人



建议但是我还没有看到一个很好的例子



We have over 100 asp pages that reference a table (distribution_components).
We added a new column and primary key to that table, so now we have to modify
the where clause to include that column (we have to make the new column = to a
session variable in the page)

The table appears 531 times in our code. Is there some util or method that
allows us to change it globally, other than going to each occurrance, and
adding the new column to the where clause

解决方案

> The table appears 531 times in our code. Is there some util or method
that

allows us to change it globally, other than going to each occurrance, and
adding the new column to the where clause



If the sql statements are exactly the same, you could do a global search and
replace using Visual Studio, or something similar. You could probably at
least knock a few off if you do a search and replace on various instances of
the sql statements.

Other than that, I''m not sure of any other way... I think you''re out of
luck.


This might be a good time to switch to using stored procedures.

"johnston" <jo******@thot.com> wrote in message
news:3f***********************@newscene.com...

We have over 100 asp pages that reference a table (distribution_components). We added a new column and primary key to that table, so now we have to modify the where clause to include that column (we have to make the new column = to a session variable in the page)

The table appears 531 times in our code. Is there some util or method that allows us to change it globally, other than going to each occurrance, and
adding the new column to the where clause



http://www.aspfaq.com/2201
http://www.aspfaq.com/2423


"johnston" <jo******@thot.com> wrote in message
news:3f***********************@newscene.com...

In article <OT**************@TK2MSFTNGP12.phx.gbl>, "Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote:

This might be a good time to switch to using stored procedures.

"johnston" <jo******@thot.com> wrote in message
news:3f***********************@newscene.com...

We have over 100 asp pages that reference a table


(distribution_components).

We added a new column and primary key to that table, so now we have to


modify

the where clause to include that column (we have to make the new column =

to a

session variable in the page)

The table appears 531 times in our code. Is there some util or method


that

allows us to change it globally, other than going to each occurrance,


and adding the new column to the where clause



do you have a good web page or article on doing that? Lots of people


sugguest it but i have yet to see a good expalnation with example



这篇关于有没有办法在ASP页面中对SQL进行全局更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆