Nvarchar trailling spaces

Hello together,
I have made a table:
/****** Object: Table [dbo].[testTable] Script Date: 30.04.2015 12:22:11 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[testTable](
[Id] [int] NOT NULL,
[text] [nvarchar](255) NOT NULL
) ON [PRIMARY]
GO
now i have inserted two rows
one row Id = 1 and text='hallo'
second row Id = 2 and text='hallo '     (trailling space)
after this i have made an update:
update testTable set id=4 where Text=N'hallo'
after this i get the message: (2 row(s) affected)
and both rows hat the Id=4
I'm not happy with this behavior.
What can I do?
thanks for your reply

Reason: This is because SQL Server ignores trailing spaces while making comparison through "=". Ex. "Text" is similar to "Text  " in SQL in comparison.
To avoid that use DATALENGTH to calculate the actual length of the column.. not LEN()
Sample
CREATE TABLE [dbo].[testTable](
[Id] [int] NOT NULL,
[text] [nvarchar](255) NOT NULL
) ON [PRIMARY]
Insert into [dbo].[testTable] VALUES
(1,'hallo'),
(2,'hallo ')
DECLARE @SearchText nvarchar(255) = 'hallo'
update testTable set id=4 where Text=@SearchText
AND DATALENGTH(text) = DATALENGTH(@SearchText);
SELECT *, ASCII(text),DATALENGTH(text) FROM [dbo].[testTable]
SQL Fiddler code
Hope this will help
Edit:
I was bit too late, please consider Olaf
Helper & Erland
Sommarskog answers. +1 for quick response. 
Glad to help! Please remember to accept the answer if you found it helpful. It will be useful for future readers having same issue.
My Profile on Microsoft ASP.NET forum

Similar Messages

  • Lossing Trailling Space

    When I run a query report from the database the result returns a value(a key)which contains a trailling space at the end of the value.
    When I look at the HTML produced the space is missing thus when the value is used to query the database no results are returned as the value is incorrect (missing trailling space)
    Could someone help me out on how to get the correct value to pass to the database.
    Thanks

    re your first issue, my test case works fine. i have a report based on a query like this...
    select replace ('string ',' ','%20') str, 'dummy' col2 from dual
    ...and i've set my column link up on the column attributes page as this...
    f?p=&APP_ID.:3:#APP_SESSION#::::P3_JOB:#STR#
    ...and when i check the length(:P3_JOB) from page 2, i see that it's correctly 7. are you doing something differently, by any chance?
    re your second issue, you'd have to replace each of your spaces with  an ampersand followed by nbsp; to retain them if you're displaying them values in html. otherwise they'll just shorten down to a single space. if you check the length of the item in session state, i bet you'll find it has the correct number of spaces.
    regards,
    raj

  • Interactive Report "in" filters do not maintain trailling spaces

    I recently came across an interesting situation regarding interactive reports and "in" filters. When building the in list through the filter wizard, any trailing spaces in the column data is trimmed, which leads to inaccurate report results. This doesn't happen on a "=" filter, it seems limited to "in" filters.
    I have an example here: http://apex.oracle.com/pls/apex/f?p=39226:1
    If you click on the "=" filter you'll see the one record with the trailing space is properly displayed. Clicking on the "in" filter and no records are displayed.
    In my particular case, the trailing space shouldn't have been in the data, so I was able to update the table and the filters worked, but if the trailing space was important then the "in" behavior would be troublesome.
    Tony

    Well, considering the fact that there is a space in the data, and NOT in your in clause I bet, then what is the problem??
    Thank you,
    Tony Miller
    Webster, TX
    You know, I used to think that it was awful that life was so unfair. Then I thought, wouldn't it be much worse if life were fair, and all the terrible things that happen to us come because we actually deserve them? So, now I take great comfort in the general hostility and unfairness of the universe.
    If this question is answered, please mark the thread as closed and assign points where earned..

  • How to compare 2 NVARCHAR(MAX) columns in same table ?

    I have 2 strings i am trying to compare them ,If user changes some data then insert should happen to change log table .
    here is the condition i am using it
    If dbo.RemoveMultipleSpacesItr(@ProgBusSolPrev) <> dbo.RemoveMultipleSpacesItr(@ProgBusSol)
    begin
    Insert into ptt_pmt_import_ch(ProgramID,ColumnName,Prev_Value,New_Value,UpdatedBy) values(@Programid,'Solution to Problem',@ProgBusSolPrev,@ProgBusSol,@UpdatedBy)
    end
    My Scalar Function to compare 2 strings and replace spaces in strings.
    CREATE FUNCTION dbo.RemoveMultipleSpacesItr(@str NVARCHAR(MAX))
    RETURNS NVARCHAR(MAX)
    AS
    BEGIN
    WHILE CHARINDEX(' ', @str) > 0
    SET @str = REPLACE(@str, ' ', '');
    RETURN @str;
    END
    If my Input values for
    @ProgDescriptionPrev='These issues are creating missed appointments and unnecessary scheduling techs on appt that are not needed. This impacts areas that are in an overbooking situation. Potentially overbooks appts during specific time of day, and increases Appt misses. Potentially decreasing Appts met by .3%, which has potential customer services impacts of 10K per year. This impacts Load Supervisors as they have to manually calculate worksteam percentage allocations. Estimating 20 users a day * 30mins= 50hrs week =1.1 Supervisor HC= 90K year. IT HelpDesk Tickets (sometimes duplicate) are also opened by front-line agents and are unable to be resolved. So this is a total of about 100k+ a year in cost savings/avoidance.'
    @ProgDescription='These issues are creating missed appointments and unnecessary scheduling techs on appt that are not needed. This impacts areas that are in an overbooking situation. Potentially overbooks appts during specific time of day, and increases Appt misses. Potentially decreasing Appts met by .3%, which has potential customer services impacts of 10K per year. This impacts Load Supervisors as they have to manually calculate worksteam percentage allocations. Estimating 20 users a day * 30mins= 50hrs week =1.1 Supervisor HC= 90K year. IT HelpDesk Tickets (sometimes duplicate) are also opened by front-line agents and are unable to be resolved. So this is a total of about 100k+ a year in cost savings/avoidance.'
    Only difference in strings is space(' ')
    if there is no difference in strings avoiding spaces in strings, i need to insert into change log. But using above query even there is no change in string values it inserts in to change log table.Please help on this,i need solution for this
    sonali malla

    Hi,,,
    Are you lecturing my dynamic script? Thither is a solution for this problem - we can convert all column values to nvarchar(max) first - most common types can be converted to nvarchar(max) and only some exotic types cannot be converted.
    Here is the script using nvarchar(max):
    CREATE TABLE Test1(id INT,col2 INT,col3 INT, col4 int, col5 varchar(10), col6 date)
    CREATE TABLE Test2(id INT,col2 INT,col3 INT, col4 int, col5 varchar(10), col6 date)
    INSERT INTO Test1 VALUES (1,2,3,9,'q', '20120101'),(4,5,6,10,'z','20120404')
    INSERT INTO Test2 VALUES (1,2,7,8, 'm','19990101'),(4,8,6,12, 'dd','20110505')
    declare @sql nvarchar(max), @Cols nvarchar(max)
    select @Cols = stuff((select ',(cast(' + QUOTENAME(column_name) + ' as nvarchar(max)),' +
    QUOTENAME(column_name,'''') + ')' from Information_schema.columns C
    where C.TABLE_SCHEMA = 'dbo' and c.TABLE_NAME = 'Test1' and c.COLUMN_NAME <> 'id'
    order by c.COLUMN_NAME for XML path('')),1,1,'')
    set @sql = 'SELECT t1.c as [Column Name] , t1.col as [Expected Value], t2.col as [Actual Value]
    FROM (select id, c, col from Test1 cross apply (values' + @Cols + ' ) d(col, c) ) t1
    INNER JOIN
    (select id, c, col from Test2 cross apply (values' + @Cols+ ' ) d(col, c) ) t2
    ON t1.id=t2.id AND t1.c=t2.c
    WHERE t1.col<>t2.col
    Order by t1.c'
    print @sql
    execute (@sql)
    If Any other Concern, let me know.
    Thanks :-)

  • How to update\insert data into a NVARCHAR column using ODBC API

    I am trying to update a Sybase table via Microsofts ODBC API. The following is the basics of the C++ I am trying to execute. In table, TableNameXXX, ColumnNameXXX has a type of  NVARCHAR( 200 ).
    SQLWCHAR updateStatement[ 1024 ] = L"UPDATE TableNameXXX SET ColumnNameXXX = N 'Executive Chair эюя' WHERE PKEYXXX = 'VALUE'";
    if( ret = SQLExecDirect( hstmt, ( SQLWCHAR* ) updateStatement, SQL_NTS ) != SQL_SUCCESS )
    // Handle Error
    The Sybase database has a CatalogCollation of 1252LATIN1, CharSet of windows-1252,  Collation of 1252LATIN1, NcharCharSet of UTF-8 and an NcharCollation of UCA.
    Once this works for the Sybase ODBC connection I need to get it to work in various other ODBC drivers for other databases.
    The error i get is "[Sybase][ODBC Driver][SQL Anywhere]Syntax error near 'Executive Chair ' on line 1"
    If i take out the Unicode characters and remove the N it will update. 
    Does anyone know how to get this to work? What am I missing?
    I wrote a C# .net project using an ODBCConnection to a SQL Server database and am getting "sort of" the same error. I means sort of as this error contains the Unicode Text in the message whereas the Sybase ODBC error has "lost" the unicode.
    static void Main(string[] args)
    using (OdbcConnection odbc = new OdbcConnection("Dsn=UnicodeTest;UID=sa;PWD=password")) // ;stmt=SET NAMES 'utf8';CharSet=utf16"
    //using (OdbcConnection odbc = new OdbcConnection("Dsn=Conversion;CharSet=utf8")) // ;stmt=SET NAMES 'utf8';CharSet=utf8
    try
    odbc.Open();
    string queryString = "UPDATE TableNameXXX SET ColumnNameXXX = N 'Executive Chair эюя' WHERE PKEYXXX = 'AS000008'";
    System.Console.Out.WriteLine(queryString);
    OdbcCommand command = new OdbcCommand(queryString);
    command.Connection = odbc;
    int result = command.ExecuteNonQuery();
    if( result == 1)
    System.Diagnostics.Debug.WriteLine("Success");
    catch(Exception ex)
    System.Diagnostics.Debug.WriteLine(ex.StackTrace);
    System.Diagnostics.Debug.WriteLine(ex.Message);
    "ERROR [42000] [Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near 'Executive Chair эюя'."

    Your error comes from Sybase, so I suggest you post your question to a Sybase forum.  And be aware that Sybase does not use the same tsql dialect as sql server, so you must use their dialect (if, indeed, there is any difference in this particular situation). 
    One note - there should be no space between "N" and the Unicode string literal to which it applies in tsql.  E.g.,
    = N'Executive Chair эюя'
    not
    = N 'Executive Chair эюя'

  • B1 create User Defined Field as nvarchar(max) in SQL 2005 database

    Hi everyone,
    I just created a UDF in B1 as alphanumeric(12), and noticed that B1 created a field in SQL 2005 as nvarchar(max) instead of nvarchar(12). I tested with both 2005A SP01 patch 14 and patch 20. It always creates UDF as nvarchar(max). Is this a bug? It will cause db file use more disk space and also reduce the query performance. Also, B1 won't create the index on the UDF even if you select the option.
    Thanks for help,
    David

    Hi David,
    I was running on patch 19 when I wrote my earlier posts. I'm now running patch 20 without any issues. I also have a range of clients who are running SBO 2005A SP1 on various patch levels above 10 (though not all are on SQL 2005) and I've yet to come across this issue.
    Did you log this with SAP Support? Have they come up with any suggestions?
    Maybe this will work:
    1) Start SBO. When you get to the login screen, click on Choose Company.
    2) Change the Current Server field from SQL 2005 to SQL 2000. Reenter your server settings if prompted
    3) Login as normal and try and create your field.
    4) Log out and go back in to change back to SQL 2005
    Kind Regards,
    Owen

  • Converting Nvarchar to date/datetime

    Hi guys
    I have a date fields say like this: [Letters Delivery Date]  stored as nvarchar, i would like to select
    some date part from the fields in format [mm][yyyy] (space betwwen) and [ww][yyyy] (space between) week starting Monday
    the string is currently stored as mm/dd/yyyy.
    I have tried every conversion I can still not getting any result
    any help would be appreciated.
    Thanks

    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. Temporal data should
    use ISO-8601 formats (you did not; in fact, nothing is right!). Code should be in Standard SQL as much as possible and not local dialect. 
    This is minimal polite behavior on SQL forums. 
    >> I have a date fields [sic] say like this: [Letters Delivery Date]  stored as NVARCHAR(N), I would like to select some date part from the fields [sic] in format [mm][yyyy] (space between) and [ww][yyyy] (space between) week starting Monday.  the
    string is currently stored as mm/dd/yyyy. I have tried every conversion I can still not getting any result <<
    Columns are not fields. You want to use Chinese Unicode instead of a DATE data type. The display format you invented will not sort as a string! There is an ISO standard for week dates. This format is 'yyyyWww-d' where yyyy is the year, W is a separator token,
    ww is (01-53) week number and d is (1-7) day of the week.
    You input any calendar date, find the week-within-year column and return the dates that match on a LIKE predicate.
    WHERE sale_day LIKE '2012W26-[67]'
    There are several websites with calendars you can cut & paste, but you can start your search with: http://www.calendar-365.com/week-number.html 
    >> any help would be appreciated. <<
    Fire the moron that did this to you and re-write all of his code. 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • SQL AGENT JOB FOR DISK SPACE USAGE ALERT

    Hello Experts
    what is the best way to set up a disk space usage alert for my sql server 2008r2 databases. i want to get a notification or alert whenever the disk usage is >80%, thank you as usual.

    Hi
    You can use sql server job for same. I am using below procedure configured with sql job running every 15 mins
    Example: EXEC [DBA_DiskSpaceMntr]
    @mailto = 'team mail',
    @CDrivethreshold = 1024,
    @OtherDrivethreshold = 10240
    CREATE PROCEDURE [dbo].[DBA_DiskSpaceMntr]
    @mailto nvarchar(4000),
    @CDrivethreshold INT,
    @DDrivethreshold INT,
    @YDrivethreshold INT,
    @OtherDrivethreshold INT
    AS
    BEGIN
    declare @count int;
    declare @DiskFreeSpace int;
    declare @tempfspace int;
    declare @tempdrive char(1);
    declare @mailbody nvarchar(4000);
    declare @MailSubject nvarchar(1000);
    declare @AlertMessage nvarchar(4000);
    declare @altflag bit;
    declare @sub nvarchar(4000);
    declare @cmd nvarchar(4000);
    set @count = 0;
    SET @mailbody = '';
    SET @cmd = '';
    set nocount on
    IF EXISTS(select * from sys.sysobjects where id = object_id('#driveinfo'))
    drop table #driveinfo
    create table #driveinfo(id int identity(1,1),drive char(1), fspace int)
    insert into #driveinfo EXEC master..xp_fixeddrives
    SELECT @DiskFreeSpace = fspace FROM #driveinfo where drive in ('C')
    IF @DiskFreeSpace < @CDrivethreshold
    Begin
    SET @MailSubject = 'Drive C: free space is low on ' + cast(Serverproperty('Machinename') as nVarchar)
    SET @mailbody = 'Drive C: on ' + cast(Serverproperty('Machinename') as nVarchar) + ' has only ' + CAST(@DiskFreeSpace AS VARCHAR) + ' MB left. Please free up space on this drive. '
    --select * FROM #driveinfo where drive in ('L')
    EXEC msdb.dbo.sp_send_dbmail
    @profile_name = 'SQLDBA_Support',
    @recipients= @mailto,
    @subject = @MailSubject,
    @body = @mailbody,
    --@file_attachments = @logfile,
    @body_format = 'HTML'
    End
    SELECT @DiskFreeSpace = fspace FROM #driveinfo where drive in ('D')
    IF @DiskFreeSpace < @DDrivethreshold
    Begin
    SET @MailSubject = 'Drive D: free space is low on ' + cast(Serverproperty('Machinename') as nVarchar)
    SET @mailbody = 'Drive D: on ' + cast(Serverproperty('Machinename') as nVarchar) + ' has only ' + CAST(@DiskFreeSpace AS VARCHAR) + ' MB left. Please free up space on this drive. '
    EXEC msdb.dbo.sp_send_dbmail
    @profile_name = 'SQLDBA_Support',
    @recipients= @mailto,
    @subject = @MailSubject,
    @body = @mailbody,
    --@file_attachments = @logfile,
    @body_format = 'HTML'
    End
    SELECT @DiskFreeSpace = fspace FROM #driveinfo where drive in ('Y')
    IF @DiskFreeSpace < @YDrivethreshold
    Begin
    SET @MailSubject = 'Drive Y: free space is low on ' + cast(Serverproperty('Machinename') as nVarchar)
    SET @mailbody = 'Drive Y: on ' + cast(Serverproperty('Machinename') as nVarchar) + ' has only ' + CAST(@DiskFreeSpace AS VARCHAR) + ' MB left. Please free up space on this drive. '
    EXEC msdb.dbo.sp_send_dbmail
    @profile_name = 'profile_name',
    @recipients= @mailto,
    @subject = @MailSubject,
    @body = @mailbody,
    --@file_attachments = @logfile,
    @body_format = 'HTML'
    End
    set @mailbody='';
    while (select count(*) from #driveinfo ) >= @count
    begin
    set @tempfspace = (select fspace from #driveinfo where id = @count and drive not in ('C','Q','D','Y'))
    set @tempdrive = (select drive from #driveinfo where id = @count and drive not in ('C','Q','D','Y'))
    if @tempfspace < @OtherDrivethreshold
    BEGIN
    SET @altflag = 1;
    SET @mailbody = @mailbody + '<p>Drive ' + CAST(@tempdrive AS NVARCHAR(10)) + ' has ' + CAST(@tempfspace AS NVARCHAR(10)) + ' MB free</br>'
    --SET @cmd = 'dir /s /-c ' + @tempdrive + ':\ > ' + @logfile
    --EXEC xp_cmdshell @cmd
    END
    set @count = @count + 1
    end
    IF (@altflag = 1)
    BEGIN
    SET @sub = 'Monitor Space on ' + cast(Serverproperty('Machinename') as nVarchar)
    set @mailbody = 'The below drives on ' + cast(Serverproperty('Machinename') as nVarchar) + ' have low disk space then threshold limit ' + CAST(@OtherDrivethreshold as VARCHAR(10)) +' Please free up the space in below specified drives <p>' + @mailbody
    --print 'Space on ' + @tempdrive + ': is very low: ' + str(@tempfspace)+ 'MB'
    EXEC msdb.dbo.sp_send_dbmail
    @profile_name = 'Profile name',
    @recipients= @mailto,
    @subject = @sub,
    @body = @mailbody,
    --@file_attachments = @logfile,
    @body_format = 'HTML'
    END
    drop table #driveinfo
    set nocount off
    END
    Thanks Saurabh Sinha
    http://saurabhsinhainblogs.blogspot.in/
    Please click the Mark as answer button and vote as helpful
    if this reply solves your problem

  • Cant Reduce the Size of Temp DB in production , though the free space is 95%

    Hi,
    In my production environment , the TempDb is consuming around 30 GB, where i can see the free space is around 95%.
    I tried to shrink and end up with no results. I Canot go with Restarting the services, since its production server. So i have to ignore the same.
    I even tried to clear cache, buffer by using below Queries.  but again didnt work out. 
    DBCC FREEPROCCACHE -- clean cache
    DBCC DROPCLEANBUFFERS -- clean buffers
    DBCC FREESYSTEMCACHE ('ALL') -- clean system cache
    DBCC FREESESSIONCACHE -- clean session cache
    DBCC SHRINKDATABASE(tempdb, 10); -- shrink tempdb
    dbcc shrinkfile ('tempdev') -- shrink db file
    dbcc shrinkfile ('templog') -- shrink log file
    I can see around few TempTables alive in tempdb, but those are very very small in size. I am not sure why this is not coming down. Can you please help me to suggest on the same. 
    Thank you 
    hemadri

    Hi 
    You need to identify what objects/data/plans consume disk space
    -- Queries causing the most (de)allocations in tempDB
    SELECT TOP 10
    tsu.session_id, tsu.request_id, tsu.task_alloc, tsu.task_dealloc,
    erq.command, erq.database_id, DB_NAME(erq.database_id) AS [database_name],
    (SELECT SUBSTRING([text], statement_start_offset/2 + 1,
    (CASE WHEN statement_end_offset = -1
    THEN LEN(CONVERT(nvarchar(max), [text])) * 2
    ELSE statement_end_offset
    END - statement_start_offset) / 2
    FROM sys.dm_exec_sql_text(erq.[sql_handle])) AS query_text,
    qp.query_plan
    FROM
    (SELECT session_id, request_id, 
    SUM(internal_objects_alloc_page_count + user_objects_alloc_page_count) as task_alloc,
    SUM(internal_objects_dealloc_page_count + user_objects_dealloc_page_count) as task_dealloc
    FROM sys.dm_db_task_space_usage
    GROUP BY session_id, request_id) AS tsu
    INNER JOIN sys.dm_exec_requests AS erq ON tsu.session_id = erq.session_id AND tsu.request_id = erq.request_id
    OUTER APPLY sys.dm_exec_query_plan(erq.[plan_handle]) AS qp
    WHERE tsu.session_id > 50 AND database_id >= 5
    ORDER BY tsu.task_alloc DESC
    GO
     ---to determine the space used by objects in TempDB:
    SELECT
     SPID = s.session_id,
     s.[host_name],
     s.[program_name],
     s.status,
     r.granted_query_memory,
     t.text,
     sourcedb = DB_NAME(r.database_id),
     workdb = DB_NAME(dt.database_id),
     mg.*
    FROM sys.dm_exec_sessions s
    INNER JOIN sys.dm_exec_connections c
    ON s.session_id = c.most_recent_session_id
    LEFT OUTER JOIN sys.dm_exec_requests r
    ON r.session_id = s.session_id
    LEFT OUTER JOIN
      SELECT
       session_id,
       database_id
      FROM
       sys.dm_tran_session_transactions t WITH (NOLOCK)
      INNER JOIN
       sys.dm_tran_database_transactions dt WITH (NOLOCK)
      ON
       t.transaction_id = dt.transaction_id
     WHERE dt.database_id = DB_ID('tempdb')
    GROUP BY
     session_id,
     database_id
    ) dt
    ON s.session_id = dt.session_id
    CROSS APPLY sys.dm_exec_sql_text(COALESCE(r.sql_handle, 
    c.most_recent_sql_handle)) t
    LEFT OUTER JOIN sys.dm_exec_query_memory_grants mg
    ON s.session_id = mg.session_id
    WHERE r.database_id = DB_ID('tempdb') OR dt.database_id = DB_ID('tempdb')
    AND R.status = 'running';
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Trailing spaces problem with OracleDataAdapter

    Hi,
    I have a char(60) column in the database which i cant change to nvarchar. I am using a ref cursor with the ODP.NET dataadapter to populate the dataset. The dataset has defined this column as a string. When I fill the dataset, the data for this column contains trailing spaces (to make it 60 characters).
    Situation: Stored Procedure returns a ref cursor that is used to fill the dataset using a dataadapter
    Problem: Trailing spaces in all char columns
    Attempts:
    1) Returning Trim(column_name) from the SP. This time the dataset column gets null values. Doesn't the trim work with the dataadapter.
    2) Tried returning length(trim(column_name)) from the SP. The dataset got all 0 values
    3) Tried returning length(column_name) from the SP. Returns 60 because the column is char(60)
    Any idea what is going on? Is this a bug? Is there a solution ?
    Thanks
    Nishith

    Got it !!! :D
    My query in the SP was SELECT TRIM(column_name) ... so it was trying to populate it into the "TRIM(column_name)" column of the dataset which is not there ... no have changed it to SELECT TRIM(column_name) as column_name ... works :)
    But is there an easier way ?
    Nishith

  • In order to create space on my MBA I just bumped iTunes media to G drive linked through Time Capsule.  Now pointed iTunes at new iTunes libary on G drive and, even though all music files are there, iTunes can only 'see' 10 albums. Any help appreciated.

    Bit more detail...
    Mac Book Air has been struggling for space for a while so I bough at time capsule a) for back up and b) to host my itunes folder remotely.  This didnt' work.  I took it into the Genius bar and the genius there told me that time capsule is not designed for anything other than back up.  Instead I have to connect a G drive through the time capsule's wireless router to my MBA. 
    I followed his instructions - moved my files from the Time Capsule and MBA directly onto the G Drive - which took a heartening 2 hrs so something must have been happening - and the held down 'Alt' when starting iTunes and selected the new itunes folder as the location of my itunes libarary which I wanted iTunes to 'point at'.  When I opened iTunes only 10 albums are visible now.
    In ITunes advanced preferences it says it is pointing at the correct folder.  The files are all cleary there when I open the G Drive folder to take a look.  But I cannot get iTunes to find them.
    Any suggestions? 
    Secondary challenge - in spite of deleting the original itunes folder on my MBA I still get messages pop up telling me my start up disk is out of space and I need to clear some - I expected to stop getting this message now I had done this exercise above.  I have emptied Trash.  Again - any pointers appreciated.  I am new to this world of 'intuitive' macbooks.
    Cheers

    After admittedly only a quick read the one thing you don't say is how you are trying to make this move.  Most people with moving library issues do it the wrong way.  Plenty of web sites tell you how to do it the wrong way.
    If the iTunes application is started before the drive with the library is fully mounted and awake iTunes will revert back to the internal drive.

  • NULL and Space value in ABAP

    Hi All,
           I like to know, is it NULL and Space value is same in ABAP, if it is not how to check null value.
    Thank you.
    Senthil

    everything is correct though some answers are not correct.
    A Database NULL value represents a field that has never been stored to database - this saving space, potentially.
    Usually all SAP tables are stored with all fields, empty fields are stored with their initial value.
    But: If a new table append is created and the newly-added fields do not have the 'initial value' marked in table definition, Oracle will just set NULL values for them.
    as mentioned: There is no NULL value to be stored in an ABAP field. The IS NULL comparison is valid only for WHERE clause in SELECT statement. WHERE field = space is different from WHERE field IS NULL. That's why you should check for both specially for appended table fields.
    If a record is selected (fulfilling another WHERE condition) into an internal table or work area, NULL values are convertted to their initial values anyway.
    Hope that sheds some light on the subject!
    regards,
    Clemens

  • NULL and SPACE

    Hello Gurus:
    I have had to use BOTH 'null' and 'space' (ofcourse I tried 'initial' too...) when selecting data from PRPS table, otherwise all the required records were not fetched. I had to do this on two different occassions. The first is a SAP provided field and the other is customer's enhancement. I have cut-paste the two code blocks. Any ideas why?
    Thanks in advance,
    Sard.
    ***********(1)**************
    select posid objnr func_area zzfunct from prps into
                    corresponding fields of table it_wbs
                              where func_area is null or
                                    func_area eq space.
    ************(2)**************
    select prps-pspnr prps-posid prps-post1
       into (wa_test1-pspnr, wa_test1-posid, wa_test1-post1,
       from prps
      where prps-posid in s_wbs and
            ...                 and
           ( prps-zzmlind is null or prps-zzmlind eq space ).
    append wa_test1 to it_test1.
    clear wa_test1.
    endselect.

    Hello Richard,
    the Requirement to check for NULL corresponds to the definition of the database (field) within the DDIC. Check the flag initialize (it has also some documentation).
    This flag is intended to be used if the definition of the db table is changed at SAP while the table already is used at customer side.
    After deploying the corresponding patch or upgrade such a changed definition may result into the need to convert all entries. For tables with many entries this would result into inacceptable downtime. So such changes are done without the initialiazation/conversion of existing entries.
    The tradeoff is the syntax you noticed.
    Kind regards
    Klaus

  • My itouch wont let me download apps says no more space but i have no videos or photos

    my itouch wont let me download apps says not enough disk space even after i have deleted old apps and have no photos or videos on it please help

    - How much free/available storage space do you have? Go to Setting>General>About..
    - The IPod need between two and three time the file download size to download and anstall an app.
    - Connect the iPod to your computer and click on the iPod under Devices in iTunes. What is the discribution of storage usage as shown i the colored bargraph? If the "othjer" category is > i GB then try restoring the iPod to reduce the "other"

  • Time machine won't back up since I have restored from time machine following hard drive replacement.  I am being told there is not enough space, however the back up is less than the hard drive size

    We recently had the hard drive replaced on our Mac as part of Apple's replacement programme.  Prior to sending it off for repair we did a final Time Machine back up, which was completed successfully.  SInce getting the computer back we restored everything from the backup disk using Time Machine, which all worked fine, however now we are having problems with it completing regular backups.  We receive a message each time telling up that the backup disk doesn't have enough space on it.  It is telling us that it needs in the region of 370gb and only has around 30gb available.  The computer hard drive is in the region of 350gb and the hard drive is a 400gb one.  It is almost as if it is not recognising that the data already on the disk is the back up of this computer and is trying to complete a completely separate back up as opposed to just updating the backup already on the disk.
    Has anyone else got any experience of this and therefore could give me some hints on what to do.  I am reluctant to wipe the backup drive and start again, however I would prefer not to have to buy another hard drive if I can avoid it as this one is technically big enough
    I look forward to getting some responses

    Hi, I never use TM myself.
    Have you looked through Pondini's extensive TM help site?
    http://Pondini.org/TM/FAQ.html
    http://pondini.org/TM/Troubleshooting.html
    Can't imaging something not being covered there.
    PS. It's generally recommended a TM drive be at least twice the size of your main drive.

Maybe you are looking for

  • How do I install movies, tv shows and music on my Mom's Apple ID without having to wait 90 days?

    My Mom even has Family Sharing on and I still can't download movies or tv shows from her account or I'll have to wait 90 days and I'm not waiting. how do I bypass the 90 day thing? It's very frustrating for me and I just want to watch my movies, than

  • How does try...endtry work if try fails?

    Hi Gurus, I have a question. Will the code inside try...endtry be executed if TRY statement fails. To be specific, see my scenario below. itab is an internal table with only one field 'line' of type c and length 100. cx_sy_conversion_codepage is used

  • Abap dev for new plant

    Dear all, We acquired new plant, and we are inegrating that new plant which is not in sap, into our sap system. and lots of customizations have to be done. I understand that on the mm front new plants creation, assignments to cocode, BA etc happen. I

  • Do transitions work if PIP is being used?

    I'm just starting to use iMovie '11 for the very first time. I've got a PIP situation where I want the main video timeline to cut using transitions while the PIP element sits bottom right, but the transitions I've placed into in the main timeline und

  • Compare Host Configurations via custom script

    I have a verification shell script that I have on my servers. The script goes off and responds with COTS versions, deployment versions, software bundles, and various other pedigree information about that server. It is beneficial to me, in that I can