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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rename Column Header in SP Query

Status
Not open for further replies.

gharabed

Programmer
Joined
Sep 7, 2001
Messages
251
Location
US
I have a stored procedure that I run that basically performs a query. Is there a way to change the column headers so the column name shows up with a different name without changing the query in the stored procedure? In other words, I don't want to add the "as <column header>" in the actual query within the stored procedure. Is there some other way to set those column header names?
 
I want to have a trigger set a "last modified timestamp" column in a table only if any of the values in that table have actually changed. So for example, say we hava table as follows:

TAB1
====
col1 int
col2 int
lastModifiedDateTime datetime

If there are the following records in TAB1

col1 col2 lastModifiedDateTime
---- ---- --------------------
1 10 6/10/2006 11:10AM
2 20 6/10/2006 10:02AM

If I issue the following update statement which does NOT actually result in col2's value being changed but would fire the trigger:

update TAB1 set col2=20 where col1=2

Then the timestamp column should remain it's current value. If I issue:

update TAB1 set col2=30 where col1=2

Then the timestamp column should update to the current datetime (getdate())
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top