Space and nvarchar column  
Author Message
rcsharon





PostPosted: Wed Nov 02 09:19:20 CST 2005 Top

SQL Server Developer >> Space and nvarchar column

Hi all!
I have to insert a "space" in a column with nvarchar datatype, when I do it,
I don't find the single space, but..nothing.
Any idea?

thanks!
milly

SQL Server9  
 
 
Uri





PostPosted: Wed Nov 02 09:19:20 CST 2005 Top

SQL Server Developer >> Space and nvarchar column Milly

CREATE TABLE #Test (col NVARCHAR(50))
INSERT INTO #Test VALUES (N' A')

SELECT LEN(col),DATALENGTH(col) FROM #Test






> Hi all!
> I have to insert a "space" in a column with nvarchar datatype, when I do
> it,
> I don't find the single space, but..nothing.
> Any idea?
>
> thanks!
> milly


 
 
milly





PostPosted: Wed Nov 02 09:32:06 CST 2005 Top

SQL Server Developer >> Space and nvarchar column I have to do this:
INSERT INTO ...values (' '), and also N' ' doesn't work..

thanks



> Milly
>
> CREATE TABLE #Test (col NVARCHAR(50))
> INSERT INTO #Test VALUES (N' A')
>
> SELECT LEN(col),DATALENGTH(col) FROM #Test
>
>
>
>


> > Hi all!
> > I have to insert a "space" in a column with nvarchar datatype, when I do
> > it,
> > I don't find the single space, but..nothing.
> > Any idea?
> >
> > thanks!
> > milly
>
>
>
 
 
Raymond





PostPosted: Wed Nov 02 13:24:17 CST 2005 Top

SQL Server Developer >> Space and nvarchar column What can a single space as a value possible mean?
Why are you trying to insert a space?



>I have to do this:
> INSERT INTO ...values (' '), and also N' ' doesn't work..
>
> thanks
>

>
>> Milly
>>
>> CREATE TABLE #Test (col NVARCHAR(50))
>> INSERT INTO #Test VALUES (N' A')
>>
>> SELECT LEN(col),DATALENGTH(col) FROM #Test
>>
>>
>>
>>


>> > Hi all!
>> > I have to insert a "space" in a column with nvarchar datatype, when I
>> > do
>> > it,
>> > I don't find the single space, but..nothing.
>> > Any idea?
>> >
>> > thanks!
>> > milly
>>
>>
>>


 
 
Kalen





PostPosted: Wed Nov 02 14:00:42 CST 2005 Top

SQL Server Developer >> Space and nvarchar column Hi Milly

What do you mean that is "doesn't work"? How are you looking at the value to
see that it is 'nothing'?
Did you try Uri's example?

What about this one:

CREATE TABLE #Test (col NVARCHAR(50))
INSERT INTO #Test VALUES (N' ')
SELECT LEN(col),DATALENGTH(col) FROM #Test
SELECT 'x' + col + 'y' FROM #Test

--
HTH
Kalen Delaney, SQL Server MVP
www.solidqualitylearning.com




>I have to do this:
> INSERT INTO ...values (' '), and also N' ' doesn't work..
>
> thanks
>

>
>> Milly
>>
>> CREATE TABLE #Test (col NVARCHAR(50))
>> INSERT INTO #Test VALUES (N' A')
>>
>> SELECT LEN(col),DATALENGTH(col) FROM #Test
>>
>>
>>
>>


>> > Hi all!
>> > I have to insert a "space" in a column with nvarchar datatype, when I
>> > do
>> > it,
>> > I don't find the single space, but..nothing.
>> > Any idea?
>> >
>> > thanks!
>> > milly
>>
>>
>>
>