BCP.exe Datatime conversion issue

Hi,
I'm dumping data into MS-SQL server Database but strange that datatime column values are with milliseconds say 2014-03-18 23:57:41.626 in this case bcp.exe
is rounding the millisecond value. In my table Datetime is a primary key column so. this is throwing Primary Key violation since BCP is rounding the last digit of the millisecond value to the nearer one ( 0, 3, 7).
I don't need this conversion I need to store the exact datetime value with the millisecond. Is there any command to stop that implicit conversion of datetime?
Regards
Raamesh Keerthi N J

That's the maximum precision up to which date time stores values. So if you want greater precision cast it to datetime2 in bcp query
is like below
bcp "select cast(datefield as datetime2) as datefield,... from table..." queryout ....
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Similar Messages

  • Strange issue creating a BCP xml format file with double dagger '‡' (alt + 0135) as column terminator with bcp.exe

    Hi,
    I'm having issues generating a BCP XML format file using a fairly unusual column terminator, a double dagger symbol
    ‡ (alt + 0135) which I need to support.
    I'm experiencing this problem with bcp.exe for SQL2008 R2 and SQL2012.
    If I run the following command line:
    bcp MyDB.TMP.Test_Extract format nul -c -x -f "C:\BCP\format_file_dagger_test.xml" -T -S localhost\SQL2012 -t‡
    I end up with a XML format file like so:
    <?xml version="1.0"?>
    <BCPFORMAT xmlns="http://schemas.microsoft.com/sqlserver/2004/bulkload/format" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
     <RECORD>
      <FIELD ID="1" xsi:type="CharTerm" TERMINATOR="ç" MAX_LENGTH="255" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
      <FIELD ID="2" xsi:type="CharTerm" TERMINATOR="ç" MAX_LENGTH="50" 
    .. and so on.
    You will notice that the TERMINATOR="ç" (Minuscule c-cedilla) is output instead of TERMINATOR="‡". The
    ç character, is strangely enough is alt + 135 (and not alt + 0135) so this might more than a coincidence! I know you can specify the codepage but this switch applies the data being imported or extracted and not for the format file
    itself (I tried it anyway). 
    In order to use the XML file to bulk import I manually did a text substitution of 'ç' character for '‡' and then BCP imports '‡' data fine. 
    This character swap doesn't occur if I generate a non XML format file (the '‡' character is output in the format file correctly) however, this file produces other import errors, which I don't encounter if I use a standard delimiter like a comma. So I have stuck
    with the working XML format file which I prefer.
    Does anyone know why this is happening? I'm planning to automate the generation the of the XML format file and would like to avoid the additional step of text substitution if possible.
    Thank you.

    Hi Ham09,
    According to your description , we do a test and find that the character of the terminator is changed due to the code page of Operation System. When you choose the different time zone in Data and Time bar, and do the same bcp test, you will find it will
    export the different TERMINATOR in your XML format file. For example, you can import the character "ç" (alt + 135) in (UTC-12:00)International Date Line West time zone and (UTC+09:00)Osaka, Sapporo, Tokyo time zone, and check if the terminators are different.
    By default, the field terminator is the tab character (represented as \t). To represent a paragraph mark, use \r\n.
    For more information, there is detail about code page(Windows), you can review the following article.
    http://msdn.microsoft.com/en-us/library/windows/desktop/dd317752(v=vs.85).aspx
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • Conversion issue in encoding in PI

    Hi,
      I am having a problem in conversion issue for encoding. Let's have a detailed look into the scenario first.
    Scenario: SNC->PI (through Proxy)->MQ (through Receiver JMS adapter)->SeeBeyond (It's a middleware system).
                   Here from SNC, data are coming into PI as in UTF-8 encoding, whereas all the systems shown in the above flow are of ISO 8859_1 format. Hence UTF-8 needs to be converted into ISO 8859_1. PI does this conversion in Receiver JMS adapter. CCSID has been set to 00819 which is for ISO 8859_1 encoding. But the beginning of the xml, it remains still UTF-8, like below:-
      <?xml version="1.0" encoding="utf-8" ?>
    Whereas the content of the xml has already been converted into ISO 8859_1 by Receiver JMS adapter. Now let's see the problem now.
    Problem: After the data been passed in SeeBeyond, the mapping fails in SeeBeyond, since SeeBeyond tries to look at the XML tag from the beginning and it found it's in UTF-8 as per he tag above. Then it tries to map it in UTF-8 format whereas the content is in ISO 8859_1, so mapping fails in SeeBeyond. Please note, here allthe systems except SeeBeyond are just bypassing the data, no mapping been introduced in anywhere in the systems except SeeBeyond.
    Workaround: Is there any other chance where we can change the tag header from UTF-8 to ISO 8859_1 in Receiver JMS adapter itself in PI like this:-
    <?xml version="1.0" encoding="iso 8859_1" ?>
    This might resolve our problem I think. Any suggestions would be appreciated.
    Thanks and Regards
    Soumya

    Hi Stefan,
                Thanks for your reply. I have gone through the link you have specified. Ya, that's the other way to resolve that issue in that case. But here we have asked the receiver system (SeeBeyond) to change the encoding part in their mapping. Because changing the coding part in SeeBeyond is less time consuming than adding a new Bean in JMS adapter. Our problem got resolved by changing the mapping in Receiver end. Thanks anyway for your valuable reply.
    Thanks
    Soumya

  • Umlaut Conversion issue in Sender communication channel SAP PI

    Hi Gurus,
    We are facing issue while conversion.
    umlaut Conversion issue in Sender communication channel that is reason channel not able to pic the file from the path.
    Sender CC error:
    Value of incoming field is too large. Segment:'IMD', Field:'7008', MaxLength:'35', value:'Plssvvkbecher Lübzer 0,4 (1280Stk p' DESCRIPTION: The length of the field value is too big !
    Actually field contains 35 Chars only the value is  : 'Plssvvkbecher Lübzer 0,4 (1280Stk p'
    We tried with “ISO-8859-1” if the field value is less than 35 characters it is able to converting.
    Please help me out from this issue.
    Thank you.
    Regards,
    Jittu.

    Hi Jittu,
    Have you tried using the codepageconversion bean in the modules under the sender?  It would be like:
    AF_Modules/TextCodepageConversionBean with a parameter of Conversion.charset and a value of utf-8.
    Regards,
    Ryan Crosby

  • Language conversion issue in PI7.1

    Hi,
    My sceanrio is file to Idoc. Am facing language conversion issues.
    For example one of the field in the source file is having the value "Différence sur net". And in the IDOC field the value is appearing as "Différence sur net".
    With the same data I have done file to file scenario with and without content conversion and the output is coming correctly as "Différence sur net".
    I have enabled Unicode check box in RFC destination also in XI server. But still its coming "Différence sur net" . Please advice how can I get the target field value same as that of the source field vale.
    Can anyone help me to sort out this issue?
    Thanks.
    Dinesh

    Hi,
    In Channel try with using the File type: text and encoding : UTF-8.
    I think this will solve your issue.
    Thank you,
    Siva

  • Call to bcp.exe returns -1073741819

    The same snippet of code that calls bcp.exe to create a dat file from a table query works correctly in a simple vb.Net test app but returns error
    -1073741819 when the same code is executed in a more complex vb.Net program on the same Win7 Ultimate VMWare session. Making build options the same for both projects has had no effect.
    I have been unable to determine why the same call to bcp.exe is successful from the simple test application but not from the more complex application
    Windows 7 Ultimate 64 bit
    Service Pack 1
    Microsoft Visual Studio Ultimate 2012
    Version 11.0.60610.01 Update 3
    .Net Framework 4.5
    Bcp
    SQLSvr\SQL_SMO\BCP\x86\SqlCmdLnUtils.msi 
    code snippet: 
    Public Class Form1
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            Dim p As Process = New Process
            Dim info As ProcessStartInfo
            Dim exit_code As Integer
            Dim WorkingDirectory As String
            Dim FileName As String
            Dim Output As String
            Dim Argument As String
            exit_code = 0
            WorkingDirectory = "C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn"
            FileName = "bcp.exe"
            Argument = "OFS.AmtOFBase.SystemSettings out C:\ProgramData\WebBrix\Archive\SystemSettings.dat -n -Uuser -Ppassword -SServerInstance"
            info = New ProcessStartInfo()
            info.FileName = WorkingDirectory + "\" + FileName
            info.WorkingDirectory = WorkingDirectory
            info.Arguments = Argument
            info.RedirectStandardOutput = True
            info.RedirectStandardError = True
            info.UseShellExecute = False
            info.CreateNoWindow = True
            'info.CreateNoWindow = False
            p.StartInfo = info
            p.Start()
            Output = p.StandardOutput.ReadToEnd() 
            p.WaitForExit()
            If (p.HasExited()) Then
                exit_code = p.ExitCode
            End If
            MessageBox.Show("FileName: " & info.FileName, "ExecuteCommandLine", MessageBoxButtons.OK)
            MessageBox.Show("WorkingDirectory: " & info.WorkingDirectory, "ExecuteCommandLine", MessageBoxButtons.OK)
            MessageBox.Show("Arguments: " & info.Arguments, "ExecuteCommandLine", MessageBoxButtons.OK)
            MessageBox.Show("Output: " & Output, "ExecuteCommandLine", MessageBoxButtons.OK)
            MessageBox.Show("Exit code: " & exit_code.ToString())
            p.Close()
        End Sub
    End Class

    Hello,
    Did you receive any message when run the application in debug mode?
    The exit code -1073741819 is Windows code for Access Violation Error( 0xC0000005).You can refer to the following article about AccessViolationException:
    http://msdn.microsoft.com/en-us/library/system.accessviolationexception(v=vs.110).aspx
    Regards,
    Fanny Liu
    If you have any feedback on our support, please click here.
    Fanny Liu
    TechNet Community Support

  • Currency conversion issue in SPM. We are getting incorrect results with SPM conversion function from one of the document currency to USD.

    Currently we are using SPM 2.0 version and we have been facing currency conversion issues.
    Please help me in following aspects.
    1) Where actually currency conversion happens in SPM. Is it the global program which does the conversion or other way.
    2) We have conversion issue for one of the currency where conversion function is giving incorrect results when converting from one of the document currency to USD. here The respective document currency is considering the 1:1 ratio with Dollar which is actually incorrect.
    3) We have verified in both BI side(currency tables) and even ECC side.
    Please help me in understanding this issue and let me know if you need more information on this.
    Its an production issue and appreciated your immediate inputs.
    Thanks
    Kiran

    Hi Arun,
    The following information may be helpful to you.The SSA_HELPER_PROGRAM has options regarding currency settings.
    EXCH_RATE_TYPE: This flag governs the exchange rate type which will be used for currency conversion in data management. For example if RSXAADMIN contains an entry EXCH_RATE_TYPE = „ZSPM‟ then the conversion type used for currency conversion is ZSPM. The default value for the exchange rate type is „M‟. More details can be found in the note 1278988.
    CURRENCYCONVERSION: By default data management converts all the measures in transaction currency to reporting currency and copies over to the corresponding measure in reporting currency. If the measure in reporting currency is already available in source it might be desirable to disable the currency conversion. To disable the conversion you can make an entry CURRENCYCONVERSION = „ „ in the table RSXAADMIN. This can also be achieved by running the program SSA_HELPER_PROGRAM with the option DEACTIVATE_CURRENCYCONVERSION. The conversion can be reactivated by running the same program with option ACTIVATE_CURRENCYCONVERSION.
    UNITCONVERSION: Similar to above. To deactivate unit conversion you can use the program with option and DEACTIVATE_UNITCONVERSION and to reactivate ACTIVATE_UNITCONVERSION. By default both the conversions are switched on
    EXTERNAL_CURRENCIES: Normally most of the international currencies are stored with two decimal places however certain currencies do have 0 and 1 decimal place too. For example JPY has 0 decimal places. SAP internal format stores even these currencies with 2 decimal places and at the time of display it changes the value to right decimal places. In case a file from external source is loaded to SPM it might have the format with 0 decimal places in the file. To convert it to SAP standard format post processing needs to be done on this value. If that is the case you can set the flat EXTERNAL_CURRENCIES = „X‟ in the table which will enable the post processing for these values. This flag can also be set and reset using the helper program using the option TURNON_EXT_CURRENCY_FORMAT and TURNOFF_EXT_CURRENCY_FORMAT.
    Kind Regards,
    John Harris
    Senior Support Engineer, SAP Active Global Support

  • CS6 dyamiclinkmanager.exe and QuickTime issues

    First, I'm on a Windows 7 service pack 1 machine, i7-4930k 3.4 GHz with 32 GB RAM. Motherboard is an ASUS P9X79LE. GPU is an Nvidia GTX 770. I just installed QuickTime 7.7.5.
    I've recently installed Production Premium CS6. Previously, I was successfully using Production Premium CS5 on the same machine but with a different motherboard and processor: ASUS P6T and i7-960.
    Anyway, I installed CS6. Tried to open Premiere, but the program would always hang up when it reached "export quicktime host."
    AE would hang up on "Initializing Media Core."
    Encore would hang up on "loading importer quicktime."
    1. To address the Premiere issue, here's what I tried:
    a) As per directions from an Adobe support page, I allowed connections in my firewall for:
    AfterFX.exe
    Adobe QT32 Server.exe
    dynamiclinkmanager.exe
    PProHeadless.exe
    This had no effect.
    b) I then moved the Adobe QT32 Server.exe file from the "32" folder into another folder. Premiere then loaded correctly.
    2. Since (b) worked for Premiere, I tried the same technique with the QT32 Server.exe files in the "32" folders in AE and Encore.
    Encore now loads properly. BUT after AE loads I get a message saying that QuickTime is not installed on the system. QT is proving problematic. Not only is it not recognized by AE, but I can't open QT. For some reason it seems incompatible with my Windows 7 Professional Service Pack 1. I changed the compatibility settings for QT to XP Service Pack 2 and the software opened when I clicked on the icon. However, QT is still not recognized by AE.
    Note: I found earlier in my investigations that when I ended the dynamiclinkmanager.exe *32 process, each of the programs would open.
    So:
    Any suggestions as to how to get AE to recognize QT?
    Is ending the dynamiclinkmanager.exe process a good idea? Will this disable dynamic link for Premiere and AE?
    I'm beginning to pine for my old CS5 days, when everything worked fine. Thanks.

    Hi FLV,
    FamilyLegacyVideo wrote:
    Any suggestions as to how to get AE to recognize QT?
    Is ending the dynamiclinkmanager.exe process a good idea? Will this disable dynamic link for Premiere and AE?
    I'm beginning to pine for my old CS5 days, when everything worked fine. Thanks.
    Can you repost this query in the After Effects forum?
    Thanks,
    Kevin

  • Conversion Issues

    I am upgrading software.  I used to use MS Office Pro 2003--> now 2007.  In converting documents from 2007 into Acrobat Pro 8.x, I was having a problem with the page numbers not getting converted properly.  For example, I use Page x of y at bottom of docs and the conversion was giving Page x of x.
    SO, I figured it could be time to upgrade to 9.0 pro.  I am currently using the trial version.  Well, I no longer have the problem above but I have another bigger problem.  The conversion is changing the fonts of most text that is centered.  I could live with that some of the time, however, certain documents must retain the specific font I use.  This is pretty much a deal breaker if I cannot fix this.
    Any thoughts?
    Many thanks and Happy Halloween.

    Ok, I figured out the CAUSE of the issue.  If a font is regular and not bolded in the font box, it converts correctly when bolded by the "B".  However, if it is bolded through the bold box, it converts to another font.  SO, is it word or adobe that is the culprit??  Therefore, what is the SOLUTION?

  • Currency conversion issue while creating PO from Shopping cart

    Hello Experts,
    I'm facing an issue in SRM during Limit purchase order creation from Limit shopping cart.
    Scenario:
    Shopping cart was created on 1st of June and Approved on 20th June & Po was created on the same day. But the currency conversion is no ware matching and couldn't able to trace out the same. I have tried several times to replicate the issue it never done in test environments.
    But the PO is creating with refer to Vendor currency. For example if SC was created in USD and vendor order currency in EUR then PO is created in EUR.
    the relevant notes were already updated in the system and it is working fine when the SC is created and approved on the same day.
    Please give me some idea how to fix this issue.
    Is there any way to make SC currency is priority than Vendor Order Currency while creating PO?
    Regards
    Pratap J

    Hello,
    Read information available in KBA 1862453.
    It mentions this issue.
    Regards,
    Ricardo

  • Crystal Data Conversion Issue (Error converting data type varchar to datetime)

    Hi,
    I can run stored procedure without error in SQL Server using my personal credentials as well as database credentials.
    I can also run Crystal Report after connecting to Stored procedure without error on my desktop using my personal credentials as well as database credentials.
    But when I upload the crystal report in BOBJDEV and when I run using database credentials report fails saying that "Error in File ~tmp1d1480b8e70fd90.rpt: Unable to connect: incorrect log on parameters. Details: [Database Vendor Code: 18456 ]" but I can run the crystal report successfully on BOBJDEV using my personal credentials.
    I googled (Data Conversion Error Message) about this issue & lot of people asked to do "Verify Database" in Crystal Report. So I did that, but when I do it I am getting a error message like this:
    Error converting data type varchar to datetime.
    Where do you think the error might be occurring? Did anyone faced this kind of issue before? If so, how to resolve it?
    (FYI, I am using Crystal Reports 2008, & for stored procedure I have used SSMS 2012 )
    Please help me with this issue.
    Thanks & Regards.
    Naveen.

    hello Naveen,
    since the report works fine in the cr designer / desktop, we need to figure out where you should post this question.
    by bobjdev do you mean businessobjects enterprise or crystal reports server? if so please post this question to the bi platform space.
    -jamie

  • PSE 8 upgrade album conversion issue

    I upgraded my system to Windows 7 and since I was going to have to reload everything anyway, I upgraded to PSE 8 at the same time.
    Before the upgrade I saved my catalog files to my external drive and then moved them back to the C:\Program Files\Adobe folder  I put it there because I didn't see a catalog folder under the Elements Organizer folder
    Anyway, I then converted my catalog - renamed it "My Catalog 7.0" to differentiate
    The conversion says it was good and upon inspection all meta tags and albums seem okay.  The issue is that it didn't bring in the images from May 2009 onward.  I know those were in the catalog in 7.0 and had tags on them.
    Any sggestions on how to get those images (with their metadata) into PSE 8.0?
    Susan

    Thanks John
    You were right, I pulled the wrong file to convert (the one I used to convert 6 to 7)
    Thankfully I had a back up and was able to restore my correct 7 catalog.  All is good now.

  • Non English characters conversion issue in LSMW BAPI Inbound IDOCs

    Hi Experts,
    We have some fields in customer master LSMW data load program which can
    contain non-English characters. We are facing issues in LSMW BAPI
    method with non-English characters Conversion. LMSW steps read and
    conversion are showing the non-English characters properly with out any
    issue. While creating inbound IDOCs most of the non-English characters
    replaced with '#' and its causing issues in creating customer master data in
    system. In our scenario customer data with non-English characters in
    the first name, last name and address details. Any specific setting
    needs to be done from our side? Please suggest me to resolve this issue.
    Thanks
    Rajesh Yadla

    If your language is a unicode tehn you need to change the options  like IN SAP you need to change it to unicode  in the initial screen Customize local layout(ALT F12) options 118  --> Encoding ....

  • Currency Conversion Issue

    HI experts,
    i have an issue with my currency report,
    where user want see the sales volume data converting from CAD to US $.
    when i checked the query the conversion type is Avg rate M source to CAD and the Target currency is CAD only.
    but when he execute the report he want to see the volume data in USD $.
    and when i execute the report i can see below error.
    Could not find any data to display. This might be due to the current selection of variable or filter values.
    can some please help me out this issue.
    thanks
    Raj

    Hi venu
    thanks for the post,
    there's no selection criteria being used by the user, has web link, once he click on link, he directly checking the report.
    so there's no section screen available.
    and there's no variable created for the  currency conversion type .
    here my requirement is to display currency in USD $ from CAD $.
    target currency maintained as CAD in RSCUR tcode.
    how would i do this,
    and again the same report is being used by CAD user also, so view shouldn't be change for the both users.
    what im thinking is
    is there any possibility to create variable on currency to select the required currency dynamically by user in selection screen
    please let us know possible solutions like without changing the view for CAD users
    please let me know for more info
    regards
    raj

  • Unicode MDMP conversion issue with document management table.

    Hi,
    We are in a process of doing a unicode conversion for our ECC 6.0 MDMP non-unicode system. We have completed the scans and we found close to 14 million words not assigned to the codepages.
    Then we checked at the table level which table has the highest number of words. There is one custom table ZQMDOCS which is used to store documents (MS-word) documents those are test procedures for our labs.
    If we see the MS-word document in non-unicode we are able to get to the document and just did some dummy assignment and completed the import and on our unicode system if we try to open the document it is opening in a readable format.
    So the issue is the data what is being stored in the document is in english but the formating which is done is read as a special character in a unicode system and in SAP it stores raw data.
    Please suggest ways to resolve this issue or any possible workarounds for this. This is a very critical table ( 43,000 documents & close to 14 million words not assign to the code page)
    Thanks
    Junaid.

    Hi Venkat,
    Thanks a lot for your immediate response.
    The InfoObject 0DOC_TYPE was without conversion exit by default. but when data coming from R/3 it is converting and sending to BW So that's why i am planning to use conversion exit "AUART" in the info Object.
    I checked data in R/3 using RSA3 it is showing sales document type as "OR" and for the same transaction data when i checked in PSA it is showing as "TA".
    Could you please let me know if there any other options.
    Thanks in advance,
    Dara.

Maybe you are looking for

  • Can/how do i make an iTunes library using data (songs, apps, e.t.c.) to my computer.

    Not all my music is on my old computer, and no apps are. This is as I exported the library to my D: drive, added more stuff, while syncing to it, then re-imported it. My iPod is on iOS 4 and want to upgrade to 5, but if I do, then I will lose all my

  • How do i get my white screen back? somehow i got a black screen and have tried to uninstall but it wont. please help!

    iawhile back i tried the breast cancer awareness persona. when i got rid of it, i ended up with a black screen except for the toolbars. i have tried everything to get rid of it but everything i try doesnt seem to work. any ideas?

  • ALV grid with 2 headers

    Hi Gurus, I need to display ALV  GRID  as below.        Header1                                  Header2         col1col2                                     col3 col4 Here header1 and header2 are top headers. Both Header1(col1 , col2) and Header2 (c

  • Why can't i change imac lion desktop icons

    following the proper directions with get info etc. icons from websites will not change on  imac desktop with downloaded icons with either png or jpg extensions

  • Static in tracks from a new artist

    artist: Margot & The Nuclear So and So's album: The Dust of Retreat A number of tracks from this album have static in them -- like they were encoded poorly. I have tried them on: - my ibook - through my airport - on my ipod - burned to an audio cd it