October 19, 2007 at 10:06 am
I have a query where I am doing a select on three columns that have a DB defined varchar(50). I want to put the results in a text file. I totally forgot how to reformat the columns so I can get the lengths to varchar(10).
I know I can do a "select blahblah as blah" How can I make blah a varchar(10)? Blahblah is the name from the table(in my mind only).
Thanks,
Dave
October 19, 2007 at 10:34 am
select cast(yourcolumn as char(10)) as yourchar10
from ...
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
October 19, 2007 at 10:34 am
select left(col1, 10) as col1,
left(col2, 10) as col2,
left(col3, 10) as col3
October 19, 2007 at 10:38 am
Thanks!! Those will work. I'm glad it's Friday. I need a beer or three after this week.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply