SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Replace the field column name
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

knockyo
Yak Posting Veteran

83 Posts

Posted - 06/03/2007 :  14:05:27  Show Profile  Reply with Quote
Below is my TableA, but i dont want show the P001, P002, ...... for the my datagrid header



because i need to link below TableB,


so, finally my datagrid header, P001 with replace with Vlow, P002 --> VHigh........

is that possible?

Edited by - knockyo on 06/03/2007 14:07:00

pootle_flump
Flowing Fount of Yak Knowledge

United Kingdom
1064 Posts

Posted - 06/03/2007 :  16:35:45  Show Profile  Reply with Quote
quote:
Originally posted by knockyo

so, finally my datagrid header, P001 with replace with Vlow, P002 --> VHigh........


SELECT P001 AS Vlow, P002 AS VHigh
FROM MyTable
????
Go to Top of Page

knockyo
Yak Posting Veteran

83 Posts

Posted - 06/04/2007 :  00:51:56  Show Profile  Reply with Quote
Hi,

Thanks your reply.

At your statement, i notice that it is Hard Code at my program to generate the field name i want.

But in my situation, I need to use SQL or coding to link between above 2 tables TableA and TableB. This is because each of the data is different.
Eg:
(1) will happen P008, P009, P010........
(2) sometimes P001 will represent another value, Eg: "Contact"

So I cannot hard code it.

Thanks
Go to Top of Page

pbguy
Constraint Violating Yak Guru

India
319 Posts

Posted - 06/04/2007 :  01:13:53  Show Profile  Reply with Quote
Please do it in the front end which is better..

--------------------------------------------------
S.Ahamed
Go to Top of Page

knockyo
Yak Posting Veteran

83 Posts

Posted - 06/04/2007 :  02:04:15  Show Profile  Reply with Quote
Meaning that is?
Go to Top of Page

pbguy
Constraint Violating Yak Guru

India
319 Posts

Posted - 06/04/2007 :  02:14:02  Show Profile  Reply with Quote
I do not know what is your front end...take the column name of tableA(P001,P002..) in the front end and get the corresponding description of that column from the tableB and replace it.

--------------------------------------------------
S.Ahamed
Go to Top of Page

pootle_flump
Flowing Fount of Yak Knowledge

United Kingdom
1064 Posts

Posted - 06/04/2007 :  04:25:10  Show Profile  Reply with Quote
Just stepping back a pace or two - why name your fields P001 -> P007 in the first place? Why not name them as you want to display them in the first place?
Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22760 Posts

Posted - 06/04/2007 :  06:36:26  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
In addition to the above, you need either
http://www.datamodel.org/NormalizationRules.html
or
http://vyaskn.tripod.com/object_naming.htm


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.11 seconds. Powered By: Snitz Forums 2000