|
-
Re: SQL Server Insert Question
that should only happen for char columns, not varchar, try:
set nocount on
create table #x
( charf char(10)
, varcharf varchar(10) )
go
insert #x select 'hello', 'hello'
go
select charf
, varcharf
, "*" + charf + "*"
, "*" + varcharf + "*"
from #x
go
drop table #x
go
set nocount off
--
HTH,
David Satz
Principal Web Engineer
Hyperion Solutions
{ SQL Server 2000 SP2/6.5 SP5a } { Cold Fusion 5 SP1 } { VSS }
(Please reply to group only - emails answered rarely)
-----------------------------------------------------------------
"Ben" <bshichman@yahoo.com> wrote in message news:3cdac960$1@10.1.10.29...
>
> I have a question - and I feel silly asking it !
>
> Im using SQL Server 2k with a CF 5.0 front end.
>
> Whenever I do inserts on char or varchar fields, it seems like I get a lot
> of blank characters after the text that fill up the rest of the size.
>
> For instance, if I am inserting a string into a char(10) field, say like
> "hello", it is tacking on 5 extra spaces at the end to fill it up, so it
> winds up "hello " instead.
>
> Help? What am I doing wrong here?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks