Ask a Question related to ASP Database, Design and Development.
-
johnston #1
Is there way to do global changes to SQL in ASP pages
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
johnston Guest
-
Master Pages won't apply to certain document pages
Hello. I'm working on a book and using a couple of simple master pages. On certain live pages the master pages objects don't show up, but they do on... -
Global changes to all Master Pages in a Book
#15 I guess the simple answer is it depends on your hardware. Also, there is the matter of file corruption. It's always good to put your eggs in... -
How to print 3 small pages wide by 5 pages tall in one spread?
Hi Vincent, I'm having a similar problem. My dilemma is that I've created a raffle ticket design and to save paper have tiled them 5 to an A4... -
Global Error handling in Applicatio_Error() of Global.asax
Hi all, For a web application if we are using web farm, and if i want to do Global Error handling can i use Applicatio_Error() method in... -
Help Please: 'Warning 5001 global variable "iF_timer" already defined in global scope
Hi there, I have just started to get this error: 'Warning 5001 global variable "iF_timer" already defined in global scope The variable name... -
johnston #2
Is there way to do global changes to SQL in ASP pages
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
johnston Guest
-
johnston #3
Is there way to do global changes to SQL in ASP pages
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
johnston Guest
-
Elliot Rodriguez #4
Re: Is there way to do global changes to SQL in ASP pages
I assume you didnt have the ability to write stored procs when you first
started out...
How do you know it appears 531 times? If you use VS.Net, or any other text
editor that has an MDI interface, you can do a find replace throughout your
pages to determine where the table name is, then add it.
A texteditor that has an MDI, in case you dont have one, is available at
[url]www.notetab.com[/url].
--
Elliot M. Rodriguez, MCSD
*** It would take 227 cans of Mountain Dew to kill me***
"johnston" <johnston@thot.com> wrote in message
news:3f154ff3$0$68854$45beb828@newscene.com...(distribution_components).> We have over 100 asp pages that reference a tablemodify> We added a new column and primary key to that table, so now we have toto a> the where clause to include that column (we have to make the new column =that> session variable in the page)
>
> The table appears 531 times in our code. Is there some util or method> allows us to change it globally, other than going to each occurrance, and
> adding the new column to the where clause
Elliot Rodriguez Guest
-
Randy R #5
Re: Is there way to do global changes to SQL in ASP pages
> The table appears 531 times in our code. Is there some util or method
thatIf the sql statements are exactly the same, you could do a global search and> allows us to change it globally, other than going to each occurrance, and
> adding the new column to the where clause
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.
Randy R Guest
-
Aaron Bertrand - MVP #6
Re: Is there way to do global changes to SQL in ASP pages
This might be a good time to switch to using stored procedures.
"johnston" <johnston@thot.com> wrote in message
news:3f154fcc$0$68854$45beb828@newscene.com...(distribution_components).> We have over 100 asp pages that reference a tablemodify> We added a new column and primary key to that table, so now we have toto a> the where clause to include that column (we have to make the new column =that> session variable in the page)
>
> The table appears 531 times in our code. Is there some util or method> allows us to change it globally, other than going to each occurrance, and
> adding the new column to the where clause
Aaron Bertrand - MVP Guest
-
Aaron Bertrand - MVP #7
Re: Is there way to do global changes to SQL in ASP pages
There is some useful information here: [url]http://www.aspfaq.com/5003[/url]
"johnston" <johnston@thot.com> wrote in message
news:3f155013$0$68854$45beb828@newscene.com...(distribution_components).>
>
> We have over 100 asp pages that reference a tablemodify> We added a new column and primary key to that table, so now we have toto a> the where clause to include that column (we have to make the new column =that> session variable in the page)
>
> The table appears 531 times in our code. Is there some util or method> allows us to change it globally, other than going to each occurrance, and
> adding the new column to the where clause
Aaron Bertrand - MVP Guest
-
Aaron Bertrand - MVP #8
Re: Is there way to do global changes to SQL in ASP pages
[url]http://www.aspfaq.com/2201[/url]
[url]http://www.aspfaq.com/2423[/url]
"johnston" <johnston@thot.com> wrote in message
news:3f155973$0$68854$45beb828@newscene.com...<aaron@TRASHaspfaq.com> wrote:> In article <OTpGV55SDHA.1576@TK2MSFTNGP12.phx.gbl>, "Aaron Bertrand - MVP"=> >This might be a good time to switch to using stored procedures.
> >
> >
> >
> >"johnston" <johnston@thot.com> wrote in message
> >news:3f154fcc$0$68854$45beb828@newscene.com...> >(distribution_components).> >> We have over 100 asp pages that reference a table> >modify> >> We added a new column and primary key to that table, so now we have to> >> the where clause to include that column (we have to make the new columnand> >to a> >that> >> session variable in the page)
> >>
> >> The table appears 531 times in our code. Is there some util or method> >> allows us to change it globally, other than going to each occurrance,sugguest> do you have a good web page or article on doing that? Lots of people> >> >> adding the new column to the where clause
> >> it but i have yet to see a good expalnation with example
Aaron Bertrand - MVP Guest
-
johnston #9
Re: Is there way to do global changes to SQL in ASP pages
In article <#mIY5H6SDHA.940@TK2MSFTNGP11.phx.gbl>, "Aaron Bertrand - MVP" <aaron@TRASHaspfaq.com> wrote:
didn't know you were a comedian in addition to an MVP!>There is some useful information here: [url]http://www.aspfaq.com/5003[/url]
>
>
>
>"johnston" <johnston@thot.com> wrote in message
>news:3f155013$0$68854$45beb828@newscene.com...>(distribution_components).>>
>>
>> We have over 100 asp pages that reference a table>modify>> We added a new column and primary key to that table, so now we have to>to a>> the where clause to include that column (we have to make the new column =>that>> session variable in the page)
>>
>> The table appears 531 times in our code. Is there some util or method>>> allows us to change it globally, other than going to each occurrance, and
>> adding the new column to the where clause
>
johnston Guest
-
Ray at #10
Re: Is there way to do global changes to SQL in ASP pages
Or at least use a function to return an array of your data every place you
need it 531 times. Good lord. I don't mean this to sound rude johnston,
really, but let this be a lesson to you.
Ray at work
"TomB" <shuckle@hotmail.com> wrote in message
news:OaV71a7SDHA.3636@tk2msftngp13.phx.gbl...column> I disagree.
>
> A good time to switch to using stored procedures is before you've written
> 531 sql statements in your code.
>
>
> "Aaron Bertrand - MVP" <aaron@TRASHaspfaq.com> wrote in message
> news:OTpGV55SDHA.1576@TK2MSFTNGP12.phx.gbl...> > This might be a good time to switch to using stored procedures.
> >
> >
> >
> > "johnston" <johnston@thot.com> wrote in message
> > news:3f154fcc$0$68854$45beb828@newscene.com...> > (distribution_components).> > > We have over 100 asp pages that reference a table> > modify> > > We added a new column and primary key to that table, so now we have to> > > the where clause to include that column (we have to make the newmethod> => > to a> > > session variable in the page)
> > >
> > > The table appears 531 times in our code. Is there some util or> and> > that> > > allows us to change it globally, other than going to each occurrance,>> >> > > adding the new column to the where clause
> >
>
Ray at Guest
-
Aaron Bertrand - MVP #11
Re: Is there way to do global changes to SQL in ASP pages
> I disagree.
Well, given the lack of a time machine, this is probably the best time>
> A good time to switch to using stored procedures is before you've written
> 531 sql statements in your code.
*possible*. :-)
Aaron Bertrand - MVP Guest
-
jason kennedy #12
Re: Is there way to do global changes to SQL in ASP pages
you can do a search and replace in dreamweaver through the current doc, a
particular folder, or your whole site.
or you could read in your ASP docs using fso and use a regular expression to
append to your SQL. you don't mention whether the 531 statements are exactly
the same
i'm not knocking you, but why are there 100 pages featuring an instance of
the same table? are you not passing values to it to return the required
results? if the table is identical, you could just supply that table as a
SSI, and then you'd only have had to update the SQL once.
for the future, maybe you should just stick with a SELECT * in your SQL till
you get your database design stabilised
good luck
Jason
"Ray at <%=sLocation%>" <ask@me.forit> wrote in message
news:u9ep$e7SDHA.2256@TK2MSFTNGP11.phx.gbl...written> Or at least use a function to return an array of your data every place you
> need it 531 times. Good lord. I don't mean this to sound rude johnston,
> really, but let this be a lesson to you.
>
> Ray at work
>
> "TomB" <shuckle@hotmail.com> wrote in message
> news:OaV71a7SDHA.3636@tk2msftngp13.phx.gbl...> > I disagree.
> >
> > A good time to switch to using stored procedures is before you'veto> > 531 sql statements in your code.
> >
> >
> > "Aaron Bertrand - MVP" <aaron@TRASHaspfaq.com> wrote in message
> > news:OTpGV55SDHA.1576@TK2MSFTNGP12.phx.gbl...> > > This might be a good time to switch to using stored procedures.
> > >
> > >
> > >
> > > "johnston" <johnston@thot.com> wrote in message
> > > news:3f154fcc$0$68854$45beb828@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 haveoccurrance,> column> > > modify
> > > > the where clause to include that column (we have to make the new> method> > => > > to a
> > > > session variable in the page)
> > > >
> > > > The table appears 531 times in our code. Is there some util or> > > that
> > > > allows us to change it globally, other than going to each>> > and> >> > > > adding the new column to the where clause
> > >
> > >
> >
>
jason kennedy Guest
-
Jeff Cochran #13
Re: Is there way to do global changes to SQL in ASP pages
On 16 Jul 2003 08:17:11 -0500, [email]johnston@thot.com[/email] (johnston) wrote:
Global search and replace in your favorite code editor...>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
Jeff
===================================
Jeff Cochran (IIS MVP)
[email]jcochran.nospam@naplesgov.com[/email] - Munged of Course
I don't get much time to respond to direct email,
so posts here will have a better chance of getting
an answer. Besides, everyone benefits here.
Suggested resources:
[url]http://www.iisfaq.com/[/url]
[url]http://www.iisanswers.com/[/url]
[url]http://www.iistoolshed.com/[/url]
[url]http://securityadmin.info/[/url]
[url]http://www.aspfaq.com/[/url]
[url]http://support.microsoft.com/[/url]
====================================
Jeff Cochran Guest
-
johnston #14
Re: Is there way to do global changes to SQL in ASP pages
In article <u9ep$e7SDHA.2256@TK2MSFTNGP11.phx.gbl>, "Ray at <%=sLocation%>" <ask@me.forit> wrote:
i have an oracle background and came to the group that does asp programming.>Or at least use a function to return an array of your data every place you
>need it 531 times. Good lord. I don't mean this to sound rude johnston,
>really, but let this be a lesson to you.
>
>Ray at work
>
>"TomB" <shuckle@hotmail.com> wrote in message
>news:OaV71a7SDHA.3636@tk2msftngp13.phx.gbl...>column>> I disagree.
>>
>> A good time to switch to using stored procedures is before you've written
>> 531 sql statements in your code.
>>
>>
>> "Aaron Bertrand - MVP" <aaron@TRASHaspfaq.com> wrote in message
>> news:OTpGV55SDHA.1576@TK2MSFTNGP12.phx.gbl...>> > This might be a good time to switch to using stored procedures.
>> >
>> >
>> >
>> > "johnston" <johnston@thot.com> wrote in message
>> > news:3f154fcc$0$68854$45beb828@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>> =>> > to a
I have been telling anybody that will listen that we should not use naked sql
in our asp pages, it should be done via a stored procedure.
It is either
stored procedures are for backend stuff not frontend
or
great idea, but this project is too small or deadline is too close, too much
time to develop them, we will surely use it next project, which of course is
also too small or deadline is too close
>method>> > > session variable in the page)
>> > >
>> > > The table appears 531 times in our code. Is there some util or>>> and>> > that
>> > > allows us to change it globally, other than going to each occurrance,>>>> > > adding the new column to the where clause
>> >
>> >
>>
>johnston Guest
-
johnston #15
Re: Is there way to do global changes to SQL in ASP pages
In article <Ox6OuT8SDHA.940@TK2MSFTNGP11.phx.gbl>, "Kevin Spencer" <kevin@takempis.com> wrote:
>Are you telling us that you duplicated the same SQL query string 531 times
>in your code?
>
No, it is different most of time. The table is referenced multiple times to
get different pieces of info, sometimes by istelf other times in a join.
johnston Guest
-
Chris Hohmann #16
Re: Is there way to do global changes to SQL in ASP pages
"johnston" <johnston@thot.com> wrote in message
news:3f154fcc$0$68854$45beb828@newscene.com...(distribution_components).> We have over 100 asp pages that reference a tablemodify> We added a new column and primary key to that table, so now we have tocolumn = to a> the where clause to include that column (we have to make the newmethod that> session variable in the page)
>
> The table appears 531 times in our code. Is there some util orand> allows us to change it globally, other than going to each occurrance,WARNING: The following is only suggested for this particular> adding the new column to the where clause
circumstance. As you have heard from others, a stored procedure would
have been the preferred way to handle this.
That being said, another option available to you is to the following:
1. Call the new table distribution_components_new
2. Create a view/saved query called distribution_table based on the new
table which reproduces the old table with the appropriate where clause
applied.
I don't know what the session variable is but I suspect it's something
available from the database. Could you provide some more details?
Chris Hohmann Guest
-
johnston #17
Re: Is there way to do global changes to SQL in ASP pages
In article <eu9Ive#SDHA.1036@TK2MSFTNGP10.phx.gbl>, "Chris Hohmann" <hohmannATyahooDOTcom> wrote:
the session variable is from the web page, its not in the database.>
>That being said, another option available to you is to the following:
>
>1. Call the new table distribution_components_new
>2. Create a view/saved query called distribution_table based on the new
>table which reproduces the old table with the appropriate where clause
>applied.
>
>I don't know what the session variable is but I suspect it's something
>available from the database. Could you provide some more details?
>
>
johnston Guest
-
Kevin Spencer #18
Re: Is there way to do global changes to SQL in ASP pages
Well, I think you're just going to have to bite the bullet here. This is one
case that brilliantly illustrates the necessity of having good program
architecture! ASP.Net pages are user interfaces, and as such, in a large
application, shouldn't have any direct database calls in them. It would have
been helpful to put your database calls into a class library, and your SQL
in Stored Procedures.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
[url]http://www.takempis.com[/url]
Big things are made up of
lots of little things.
"johnston" <johnston@thot.com> wrote in message
news:3f15cd14$0$68854$45beb828@newscene.com...<kevin@takempis.com> wrote:> In article <Ox6OuT8SDHA.940@TK2MSFTNGP11.phx.gbl>, "Kevin Spencer"times> >Are you telling us that you duplicated the same SQL query string 531to>> >in your code?
> >
>
> No, it is different most of time. The table is referenced multiple times> get different pieces of info, sometimes by istelf other times in a join.
>
Kevin Spencer Guest
-
Chris Hohmann #19
Re: Is there way to do global changes to SQL in ASP pages
"johnston" <johnston@thot.com> wrote in message
news:3f168fa3$0$68854$45beb828@newscene.com...<hohmannATyahooDOTcom> wrote:> In article <eu9Ive#SDHA.1036@TK2MSFTNGP10.phx.gbl>, "Chris Hohmann"What is it? When is it created? Can it be stored in the database?> the session variable is from the web page, its not in the database.> >
> >That being said, another option available to you is to the following:
> >
> >1. Call the new table distribution_components_new
> >2. Create a view/saved query called distribution_table based on the new
> >table which reproduces the old table with the appropriate where clause
> >applied.
> >
> >I don't know what the session variable is but I suspect it's something
> >available from the database. Could you provide some more details?
> >
> >
Chris Hohmann Guest



Reply With Quote

