Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Field Definition Constantly Changing

Status
Not open for further replies.

Alibaba2003

Programmer
Mar 31, 2003
67
US
I am constantly changing the field definition in my database. An Example would be a chargre number for an employee. The charge field combines: Timsheet id + Job Id + job title + Sub Contract Number + title + Contract Number and title. I change this definition across all views most of the the time. I need a way to make this change easy. Functions are not a good solution because they are very slow with select statements. I am not sure about stored procedures that return a single value and if its possible to call them from within a query. Thank you for your help

It's Nice to Be Important But It's more Important to BE Nice
 
Why do you persist the result of that concatenation rather than calculate it on the fly. BTW, views can be slow too.
-Karl

[red] Cursors, triggers, user-defined functions and dynamic SQL are an axis of evil![/red]
[green]Life's uncertain...eat dessert first...www.deerfieldbakery.com[/green]
 
Donut Dude,
The reason is my boss he cannot make up his mind about a field definition. This is not the only calculation or concatenation example. I am talking about tens of fields across hundreds of queries. That may have a number of variations depending on certain cases. I am trying to minimize the overhead from modifying those definitions over and over again.

Functions are sure an axis of evil in this case.
Thanks
Hope I will get an answer now ..

It's Nice to Be Important But It's more Important to BE Nice
 
Try creating an Alter View query in QA, then saving it to your desktop. You can edit this view in Word with a find & replace. There probably is a way to do a replace in QA, but I don't know what it is.

Then run QA, open up your saved SQL query and it should change things all at once.

Just remember to put a GO statement between each Alter View statement and some spaces between each for readability. Entering it in the first time will be a pain, but then you can do your replace fairly quickly afterwards.



Catadmin - MCDBA, MCSA
Remember, "Work" is a four letter word. And you know what your mother told you about using four letter words!
 
I agree overall. Script relevant objects with EM, do search&replace thing, run it in QA, keep last version for later purpose.

And good luck with ol' school boss [3eyes].

------
Math problems? Call 0800-[(10x)(13i)^2]-[sin(xy)/2.362x]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top