Click here to Skip to main content
15,914,500 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
SQL
select convert(varchar,tournamentID='STT') from tblTournaments


whatever is TournamentID column values, in it i want to replace them with 'STT' name...!
please do right my queary...!

Note:- don't want to use REPLACE Keyword..! want to add only run time values.
if i write
select tournamentID='STT' from tblTournaments
its run but upper queary not working!
i want to like this output..!
VB
TournamentID
STT
STT
STT
STT
STT
STT


Regards
Dnyanesh Wahiley
Posted
Updated 22-Feb-12 18:46pm
v3
Comments
CRDave1988 23-Feb-12 0:37am    
Not Getting what is ur problem can u explain more or can u provide a sample output?
Dnyanesh Wahiley 23-Feb-12 0:41am    
see for example if i write select tounamentID from tablename its shows me '1' as a an output..! now what i want insted of '1' i want 'STT'
Om Prakash Pant 23-Feb-12 0:49am    
then in that case you only need this
select 'STT' from tblTournaments
Dnyanesh Wahiley 23-Feb-12 0:52am    
and what about column name..!
Om Prakash Pant 23-Feb-12 1:12am    
select 'STT' as tournamentID from tblTournaments

1 solution

select 'STT' as 'TounamentID' from tblTournaments
this will be queary...!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900