Billy
create table #tmp(c varchar(20))
insert into #tmp values ('0003')
insert into #tmp values ('0004')
insert into #tmp values ('0005')
--you can either update or format the column's data
select *, ''''+c from #tmp
--or
update #tmp set c=''''+c
select * from #tmp
[quoted text, click to view] "Billy" <Billy@discussions.microsoft.com> wrote in message
news:39D37D74-B7AE-4FAD-BE61-662A8AAC82AB@microsoft.com...
> The data is already in the table....so 0000345 is the order numbers as
> they
> are. Both the suggestions so far are about updating /inserting a leading
> single quote into the field. I don't want to change the data in the table,
> I
> simply want my query to return a single quote in front of the value
> exported...
>
> So I want
> Select ORNO from table to return '0000345, NOT 0000345 as it does at
> present.
>
> Thx
>
> "Krishnakumar S" wrote:
>
>> Just append another single quote as escape sequence. For example, to
>> insert
>> '0000345,
>> INSERT INTO Table1 VALUES ('''0000345'), i.e, ''0000345 enclosed in
>> quotes.
>> --
>> Krishnakumar S
>>
>>
>> "Billy" wrote:
>>
>> > I have a character field I am exporting from the database. This
>> > character
>> > field holds order numbers with leading 0s...so 0000345. I would like to
>> > know
>> > how I can export this field, but woith adding a single quote to the
>> > front of
>> > the field...so 0000345 is exported as '0000345.
>> >
>> > Many thx
>> >