SQL Server Source and Flat File Target in OWB

Hello All,
I have a question, is it possible to have SQL Server as Source and Flat File as Target without using any intermediate Oracle table(s).
like
SQL Server --> ETL Operators --> Flat file?
as i m getting errors in data type conversions here. but if i replace flat file with Oracle table it works fine. (though i have used some conversion functions for data types as well in Flat file loading but it is giving me errors)
Thanks in advance.
Tayyeb

Yes this should be fine. Are you using the gateway to access SQLServer or code template mappings? You need to track which columns are throwing the data type conversion errors.
Cheers
David

Similar Messages

  • How to convert from SQL Server table to Flat file (txt file)

    I need To ask question how convert from SQL Server table to Flat file txt file

    Hi
    1. Import/Export wizened
    2. Bcp utility
    3. SSIS 
    1.Import/Export Wizard
    First and very manual technique is the import wizard.  This is great for ad-hoc and just to slam it in tasks.
    In SSMS right click the database you want to import into.  Scroll to Tasks and select Import Data…
    For the data source we want out zips.txt file.  Browse for it and select it.  You should notice the wizard tries to fill in the blanks for you.  One key thing here with this file I picked is there are “ “ qualifiers.  So we need to make
    sure we add “ into the text qualifier field.   The wizard will not do this for you.
    Go through the remaining pages to view everything.  No further changes should be needed though
    Hit next after checking the pages out and select your destination.  This in our case will be DBA.dbo.zips.
    Following the destination step, go into the edit mappings section to ensure we look good on the types and counts.
    Hit next and then finish.  Once completed you will see the count of rows transferred and the success or failure rate
    Import wizard completed and you have the data!
    bcp utility
    Method two is bcp with a format file http://msdn.microsoft.com/en-us/library/ms162802.aspx
    This is probably going to win for speed on most occasions but is limited to the formatting of the file being imported.  For this file it actually works well with a small format file to show the contents and mappings to SQL Server.
    To create a format file all we really need is the type and the count of columns for the most basic files.  In our case the qualifier makes it a bit difficult but there is a trick to ignoring them.  The trick is to basically throw a field into the
    format file that will reference it but basically ignore it in the import process.
    Given that our format file in this case would appear like this
    9.0
    9
    1 SQLCHAR 0 0 """ 0 dummy1 ""
    2 SQLCHAR 0 50 "","" 1 Field1 ""
    3 SQLCHAR 0 50 "","" 2 Field2 ""
    4 SQLCHAR 0 50 "","" 3 Field3 ""
    5 SQLCHAR 0 50 ""," 4 Field4 ""
    6 SQLCHAR 0 50 "," 5 Field5 ""
    7 SQLCHAR 0 50 "," 6 Field6 ""
    8 SQLCHAR 0 50 "," 7 Field7 ""
    9 SQLCHAR 0 50 "n" 8 Field8 ""
    The bcp call would be as follows
    C:Program FilesMicrosoft SQL Server90ToolsBinn>bcp DBA..zips in “C:zips.txt” -f “c:zip_format_file.txt” -S LKFW0133 -T
    Given a successful run you should see this in command prompt after executing the statement
    Starting copy...
    1000 rows sent to SQL Server. Total sent: 1000
    1000 rows sent to SQL Server. Total sent: 2000
    1000 rows sent to SQL Server. Total sent: 3000
    1000 rows sent to SQL Server. Total sent: 4000
    1000 rows sent to SQL Server. Total sent: 5000
    1000 rows sent to SQL Server. Total sent: 6000
    1000 rows sent to SQL Server. Total sent: 7000
    1000 rows sent to SQL Server. Total sent: 8000
    1000 rows sent to SQL Server. Total sent: 9000
    1000 rows sent to SQL Server. Total sent: 10000
    1000 rows sent to SQL Server. Total sent: 11000
    1000 rows sent to SQL Server. Total sent: 12000
    1000 rows sent to SQL Server. Total sent: 13000
    1000 rows sent to SQL Server. Total sent: 14000
    1000 rows sent to SQL Server. Total sent: 15000
    1000 rows sent to SQL Server. Total sent: 16000
    1000 rows sent to SQL Server. Total sent: 17000
    1000 rows sent to SQL Server. Total sent: 18000
    1000 rows sent to SQL Server. Total sent: 19000
    1000 rows sent to SQL Server. Total sent: 20000
    1000 rows sent to SQL Server. Total sent: 21000
    1000 rows sent to SQL Server. Total sent: 22000
    1000 rows sent to SQL Server. Total sent: 23000
    1000 rows sent to SQL Server. Total sent: 24000
    1000 rows sent to SQL Server. Total sent: 25000
    1000 rows sent to SQL Server. Total sent: 26000
    1000 rows sent to SQL Server. Total sent: 27000
    1000 rows sent to SQL Server. Total sent: 28000
    1000 rows sent to SQL Server. Total sent: 29000
    bcp import completed!
    BULK INSERT
    Next, we have BULK INSERT given the same format file from bcp
    CREATE TABLE zips (
    Col1 nvarchar(50),
    Col2 nvarchar(50),
    Col3 nvarchar(50),
    Col4 nvarchar(50),
    Col5 nvarchar(50),
    Col6 nvarchar(50),
    Col7 nvarchar(50),
    Col8 nvarchar(50)
    GO
    INSERT INTO zips
    SELECT *
    FROM OPENROWSET(BULK 'C:Documents and SettingstkruegerMy Documentsblogcenzuszipcodeszips.txt',
    FORMATFILE='C:Documents and SettingstkruegerMy Documentsblogzip_format_file.txt'
    ) as t1 ;
    GO
    That was simple enough given the work on the format file that we already did.  Bulk insert isn’t as fast as bcp but gives you some freedom from within TSQL and SSMS to add functionality to the import.
    SSIS
    Next is my favorite playground in SSIS
    We can do many methods in SSIS to get data from point A, to point B.  I’ll show you data flow task and the SSIS version of BULK INSERT
    First create a new integrated services project.
    Create a new flat file connection by right clicking the connection managers area.  This will be used in both methods
    Bulk insert
    You can use format file here as well which is beneficial to moving methods around.  This essentially is calling the same processes with format file usage.  Drag over a bulk insert task and double click it to go into the editor.
    Fill in the information starting with connection.  This will populate much as the wizard did.
    Example of format file usage
    Or specify your own details
    Execute this and again, we have some data
    Data Flow method
    Bring over a data flow task and double click it to go into the data flow tab.
    Bring over a flat file source and SQL Server destination.  Edit the flat file source to use the connection manager “The file” we already created.  Connect the two once they are there
    Double click the SQL Server Destination task to open the editor.  Enter in the connection manager information and select the table to import into.
    Go into the mappings and connect the dots per say
    Typical issue of type conversions is Unicode to non-unicode.
    We fix this with a Data conversion or explicit conversion in the editor.  Data conversion tasks are usually the route I take.  Drag over a data conversation task and place it between the connection from the flat file source to the SQL Server destination.
    New look in the mappings
    And after execution…
    SqlBulkCopy Method
    Sense we’re in the SSIS package we can use that awesome “script task” to show SlqBulkCopy.  Not only fast but also handy for those really “unique” file formats we receive so often
    Bring over a script task into the control flow
    Double click the task and go to the script page.  Click the Design script to open up the code behind
    Ref.
    Ahsan Kabir Please remember to click Mark as Answer and Vote as Helpful on posts that help you. This can be beneficial to other community members reading the thread. http://www.aktechforum.blogspot.com/

  • Urgent.. Characterset of flat file target in OWB

    OWB mapping reads from the database source and writes to flat file target in unix os but junk characters are displayed for non english characters in the target file . The database table contains french,spanish,german,arabic characters.The nls db parameter setting is AL32UTF8. The same setting has been applied to OWB target by editing flat file defintion also but still junk values are appearing for non english characterset.different charactersets like al32utf8,utf8,utf18,us7ascii have been tried at owb target setting but nothing is working out to remove junk characters. Please suggest

    Yes this should be fine. Are you using the gateway to access SQLServer or code template mappings? You need to track which columns are throwing the data type conversion errors.
    Cheers
    David

  • ODI - Delete Level0 through Microsoft SQL Server Source?

    Is it possible to use ODI to delete members through a Microsoft SQL Server Source and a Planning target? I can load the members with a MS SQL source but can't seem to get the process to work when i add an operator (no matter which one i choose Delete IDescendants or Delete level0). I am able to get it to work with a file but would rather use the table to run the delete as well.

    Using a relational table should be no different than using a flat file source.
    I take it no errors are being generated, have you checked the SQL that is being generated in the operator, you should be able to lift it out of the step in the operator and run against sql server to see if the correct records are being returned.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • OWB and MS SQL Server source (10.2)

    Hi all,
    After installing the Gateways for MS SQL Server, configuring and testing the Database Link sucessfully, I met some issues when trying to use this Database Link for location source.
    Suppose I have a Database Link named mssql. From OWB Design Center, creates a new project. Exploring this project and select to create a new Location Module. On the Location Module Wizard, select the mssql Database Link; dbo for the SCHEMA. Finally press the Test button. Unfortunately the result test informed that "tables or views are not existed ..."
    Does anyone have the same issues with me? Can you give me any solutions?
    Thanks much,
    Truong

    Have you seen this product?
    http://www.reqwireless.com/products-db.html

  • More Guru Winners for February 2015 in the SQL Server category and many others!

    It's been a busy week that also saw the
    TECHNET WIKI SUMMIT 2015
    Then we had the results for
    February's TechNet Guru competition ALSO posted!
    http://blogs.technet.com/b/wikininjas/archive/2015/03/19/technet-guru-february-2015.aspx
    Below is a summary of the medal winners for December. The last column being a few of the comments from the judges.
    Unfortunately, runners up and their judge feedback comments had to be trimmed from THIS post, to fit into the forum's 60,000 character limit, however the full version is available on TechNet Wiki in the link above.
    Some articles only just missed out, so we may be returning to discuss those too, in future blogs.
     BizTalk Technical Guru - February 2015  
    Steef-Jan Wiggers
    BizTalk Server 2013 R2 Instrumenting a custom pipeline component with ETW
    Mandi Ohlinger: "Always a fan of helping our custom pipeline users. Great addition to this group."
    Sandro Pereira: "Images, format, descriptions, code and topic are excellent once again good work Steef-Jan."
    Vignesh Sukumar
    BizTalk BAM (Business Activity Monitoring)
    Sandro Pereira: "Great job on this article! Well explained and nice pictures, however the article format need to be improved and some proofreading is need"
    Mandi Ohlinger: "Welcome to the 'I heart BAM' fan club. Nice job on this topic. A MUST read for new-to-BAM users. "
    Steef-Jan Wiggers
    BizTalk Server 2013 R2 Instrumenting BAM Activity Tracking with ETW
    Sandro Pereira: "Images, format, descriptions, code and topic are excellent once again good work Steef-Jan."
    Mandi Ohlinger: "ETW for BAM Activities - LOVE it. Nice use of the Framework. "
     Forefront Identity Manager Technical Guru - February 2015  
    Wim Beck
    FIM2010: Filter objects on export
    PG: "Simple, targeted but nice article, nice layout. "
    Søren Granfeldt: "Nice. Would be perfect with a complete code sample."
     Microsoft Azure Technical Guru - February 2015  
    saramgsilva
    Azure Mobile Services: How to see the log files in server
    JH: "Log files are one of the most important things in a production environment. This article shows hows you can do that for the Azure Mobile Services in a nice and easy way."
    Alan Carlos: "Great article!"
    Ed Price: "Very useful topic! These are a great set of articles!"
    saramgsilva
    Azure Mobile Services: How to see the WebConfig file published
    Ed Price: "Great detail and fantastic use of images! I love all the in-line links!"
    JH: "Sometimes it is hard to tell when working in a multi-environment what configuration was published to the Server. The article shows short and easy how to do that for the Azure Mobile Services."
     Miscellaneous Technical Guru - February 2015  
    Arleta Wanat
    Retrieve all site mailboxes in your Office 365 tenant
    Durval Ramos: "This article has a well content, images and code that help to understand the solution. It has References and was Translated into more two languages. Good job!"
    Richard Mueller: "Good links. A great tutorial."
    Andy ONeill
    Silverlight: No Need to BringIntoView
    Durval Ramos: "A well formatted article is easier and more pleasant to read. This script is useful"
    Richard Mueller: "Good demonstration of a new feature."
    Chen V
    PowerShell : Enable Auto Reply for Shared Mail Box
    Durval Ramos: " A good solution originated of TechNet Forum. The script and images make it easy to understand and ensure you get the best interest to reader."
    Richard Mueller: "Good documentation of this feature."
     SharePoint 2010 / 2013 Technical Guru - February 2015  
    Geetanjali Arora
    SharePoint Online : Performing Batch Operations using REST API
    KB: "Very well explained article on a new and much awaited feature. Although Andrew Connell already explained this topic in several posts, this article still contains added value."
    Ed Price: "I love the History section. The formatting is amazing. And the References and See Also sections at the bottom are great icing on the cake. This is an important topic that's done incredibly well!"
    Matthew Yarlett
    Using the SpellCheck Webservice with the TinyMCE Richtext Editor and
    AngularJS in Office 365
    KB: "I read this article with growing interest, it contains a lot of added value. Very well and in-depth explanation. "
    Ed Price: "Great scenario! Good use of images, code, detail, and References! Could possibly use a greater breakdown and explanation of the code. This article just gets more and more interesting and valuable as you read it! Great job!"
    Arleta Wanat
    SharePoint Online: Turn on support for multiple content types
    in a list or library using Powershell
    KB: "Really nice, interesting and detailed article!"
    Ed Price: "The Content Types section helps explain this a lot! I also love the downloads at the end. What a fantastic resource!"
     Small Basic Technical Guru - February 2015  
    Nonki Takahashi
    Small Basic: Key Input
    Michiel Van Hoorn: "Great improvement."
    RZ: "Very nice explanation and examples of key input handling"
    Ed Price - MSFT
    Small Basic: The History of the Logo Turtle
    RZ: "Turtle (Logo) was the first programming language for many, including perhaps some of the Small Basic prorammers. Nice article explaining the history."
    Michiel Van Hoorn: "A nice background article and hopefull inspiration for those who want to start in robotics"
    Nonki Takahashi
    Small Basic: TechNet Wiki Article List
    Michiel Van Hoorn: "This is great! Perfect as a local cache of the articles. "
    RZ: "A good example"
     SQL BI and Power BI Technical Guru - February 2015  
    Sylvain PONTOREAU
    PowerBI API in .Net
    RB: "Great walkthrough. Looking forward for the WP8 version of the app ;)"
    PT: "Sylvain, very nice job with this. This is a timely topic about an emerging product that has great potential. This is a very good example of a well-written post on an interesting subject with enough information to be valuable to a
    solution developer. I will personally take time to explore the Power BI API and use your examples. "
     SQL Server General and Database Engine Technical Guru - February 2015  
    Ronen Ariely
    SQL Server Books Online
    AM: "Thank you for sharing this with us. It is quite informative and let us get familiar with BOL after the change from previous versins."
    Ed Price: "Nice! A very helpful introduction to Books Online! It also tells my technical writer friends that their hard work is appreciated! =^)"
    Durval Ramos
    How to Collect Events and Errors on SQL Server
    Ed Price: "Fantastic solution! A great resource that's amazingly well written with formatting, clear parameters, images, References, and a See Also section! And it even comes in Portuguese! Great article!"
    AM: "Thank you for sharing this with us. A good source to learn about our SQL Server instances. "
     System Center Technical Guru - February 2015  
    MarkusEliasson
    Troubleshoot ID 32008: DPM cannot
    protect this SharePoint farm...
    Ed Price: "An important topic that's very clear with great formatting and a good use of an image!"
    t.c.rich
    Managing Priorities of Client Polices and A/V Policies in SCCM
    Ed Price: "I love the descriptions, breakdown of sections, and code formatting! Great article!" 
    Mr X
    How to copy SMSTS.log when a Task Sequence fails in SCCM
    Ed Price: "A very helpful table and a good contribution to the community! Mr X again thinks of important content gaps to fill!"
     Transact-SQL Technical Guru - February 2015  
    Saeid Hasani
    T-SQL: How the Order of Elements in the ORDER BY Clause Implemented in the Output Result
    Durval Ramos: "Very well structured and with examples that clarify how a T-SQL statement can change the data output order."
    Richard Mueller: "Good use of Wiki guidelines and great examples."
    Ronen Ariely
    Free E-Books about SQL and Transact-SQL languages
    Richard Mueller: "An excellent collection and a great idea."
    Durval Ramos: "A good initiative. Very useful !!!"
    Ricardo Lacerda
    Declare Cursor (Transact-SQL) versus Window with Over - Running Totals
    - Accumulated Earnings
    Durval Ramos: "The "Window function" sample was well presented, but it was unclear how the chart was generated."
    Richard Mueller: "A new idea that can be very useful. Grammar needs work"
     Visual Basic Technical Guru - February 2015  
    Emiliano Musso
    Genetic algorithm to solve 2D Mazes in Visual Basic
    MR: "Great article! Love to see an application for AI in a simple game"
    Durval Ramos: "This article is well documented with images and your code clarifying important details. It also has References, a very useful video and your project available for download in "MSDN Code" !"
    Richard Mueller: "Incredible concept and code. Grammar needs work."
    Paul Ishak
    MultiHeadedTrackBar Control
    Durval Ramos: "Very interesting article, with methods and properties well documented. Your project was available in "MSDN Code" which facilitates the understanding of solution."
    Richard Mueller: "Amazing work. Extensive code but with lots of comments. Needs a TOC"
    tommytwotrain
    Using Trigonometry to draw graphic curves in VB.NET part 2.
    MR: "Great continuation. Love the usage of the code for circle text"
    Durval Ramos: "The article is interesting, but It's need to work better commenting about assemblies referenced on project and also structure your content into sections."
    Richard Mueller: "Good tutorial and example code demonstrating basic concepts. Avoid first person."
     Visual C# Technical Guru - February 2015  
    Magnus (MM8)
    C#: Enumerating collections that change
    Jaliya Udagedara: "Great article. Has a thorough and to the point explanation of problem and the solution with code samples. Loved it!"
    Carmelo La Monica: "Very useful and exhaustive about errors at runtime in these circumstances. Congratulations"
    Andy ONeill
    c#: Practical Poly
    Carmelo La Monica: "Fantastic artcle. Very detailed and exhaustive, congratulations ."
    Jaliya Udagedara: "Definitely worth reading this. Explains somewhat advance topic along with a fundamental concept of programming. "
     Wiki and Portals Technical Guru - February 2015  
    Durval Ramos
    Wiki: Microsoft Short URLs Personalized by SXP
    PG: "Nice idea, lots of potential to grow, really needs some more community attention."
    Richard Mueller: "An excellent idea. Good use of Wiki guidelines."
     Windows Phone and Windows Store Apps Technical Guru - February 2015  
    Carmelo La Monica
    Windows Phone 8: control Nokia Maps (Part 3)
    JH: "Part 3 of the series how to work with the Nokia maps control. As the previous articles this one contains a lot of code snippets and some pictures. Good work!"
    Ed Price: "A great topic, a fantastic breakdown of sections with clear descriptions, and a nice mix of code formatting and helpful images! Another stellar article from Carmelo! Great job including the link back at the end to the portal
    article!"
     Windows PowerShell Technical Guru - February 2015  
    Richard Mueller
    Document Your Active Directory Organization
    Alan Carlos: "Wow! Great article, congratulations!!! Very detailed!"
    Chen V: "Excellent Article - I liked return to top as well."
    Ed Price: "Wow! It's like a professional whitepaper! It's a valuable topic that's done with intricate detail! I love the images, diagrams, code blocks, and it ends very well with more resources and Wiki articles! The article just keeps
    digging deeper and deeper! Awesome job on this!"
    DexterPOSH
    PowerShell + REST API : Invoke-RestMethod Gotcha
    Chen V: "Good Article. TOC might have made this more rich! "
    Ed Price: "This is a good topic with some great content. It could benefit from sections and a TOC, as well as a References and See Also sections at the end. The inline links are helpful. Could "
    DexterPOSH
    PowerShell Trick : Search & highlight text in MS Word
    Ed Price: "This is a great solution, with some helpful Q&A in the comments!"
     Windows Presentation Foundation (WPF) Technical Guru - February 2015  
    Andy ONeill
    Lookless Controls
    KJ: "WPF can definitely be confusing when devs first encounter it. Like the way you break it down."
    Ed Price: "Wow! Fantastic explanations that are very clear and deep! The images and code bring it to life!"
    Andy ONeill
    Only One Parent
    KJ: "Same iwith this one, good 101 intro"
    Ed Price: "Another great tip! I love the detail here as well! Those snippets help a lot!"
    Andy ONeill
    Bind to Current Item of Collection
    KJ: "Feel like this topic has a lot of coverage out there, but it can't hurt to hammer on databinding yet one more time :) "
    Ed Price: "Fantastic topic with great execution! Although these could benefit from References and See Also wiki sections at the end, the Inline links help a lot!"
     Windows Server Technical Guru - February 2015  
    Mr X
    Ping for Beginners
    Mark Parris: "A good introduction with additional content."
    JM: "Great article idea and an excellent article that will be useful to many, thanks for your contribution."
    Philippe Levesque: "Good article that show a usefull utility for basic troubleshooting"
    Richard Mueller
    Active Directory: Get-ADFineGrainedPasswordPolicy Default and Extended Properties
    Mark Parris: "An Interesting insight on FGPP and their extended properties."
    JM: "This is a good piece of detailed information about this PowerShell cmdlet, thanks for sharing."
    Philippe Levesque: "Great article ! Illustrating some cmdlet's output when a user got assigned policy versus a user with the default domain policy could be a good idea."
    Richard Mueller
    Active Directory: Get-ADServiceAccount Default and Extended Properties
    Mark Parris: "A useful nugget of information."
    JM: "More very useful information about an AD cmdlet, thanks!"
    Philippe Levesque: "Good article !"
    As mentioned above, runners up and comments were removed from this post, to fit into the forum's 60,000 character limit.
    You will find the complete post, comments and feedback on the
    main announcement post.
    Please join the discussion, add a comment, or suggest future categories.
    If you have not yet contributed an article for this month, and you think you can write a more useful, clever, or better produced wiki article than the winners above,
    THERE'S STILL TIME! :D
    Best regards,
    Pete Laker
    More about the TechNet Guru Awards:
    TechNet Guru Competitions
    #PEJL
    Got any nice code? If you invest time in coding an elegant, novel or impressive answer on MSDN forums, why not copy it over to
    TechNet Wiki, for future generations to benefit from! You'll never get archived again, and
    you could win weekly awards!
    Have you got what it takes o become this month's
    TechNet Technical Guru? Join a long list of well known community big hitters, show your knowledge and prowess in your favoured technologies!

    Congrats to Ronen and Durval!
     SQL Server General and Database Engine Technical Guru - February 2015  
    Ronen Ariely
    SQL Server Books Online
    AM: "Thank you for sharing this with us. It is quite informative and let us get familiar with BOL after the change from previous versins."
    Ed Price: "Nice! A very helpful introduction to Books Online! It also tells my technical writer friends that their hard work is appreciated! =^)"
    Durval Ramos
    How to Collect Events and Errors on SQL Server
    Ed Price: "Fantastic solution! A great resource that's amazingly well written with formatting, clear parameters, images, References, and a See Also section! And it even comes in Portuguese! Great article!"
    AM: "Thank you for sharing this with us. A good source to learn about our SQL Server instances. "
    Ed Price, Azure & Power BI Customer Program Manager (Blog,
    Small Basic,
    Wiki Ninjas,
    Wiki)
    Answer an interesting question?
    Create a wiki article about it!

  • How to integrate from MS SQL SERVER 2005 and Flatfile to Oracle 10g.

    Hi
    I am new to ODI. I am trying to load sample data from MS SQL Server 2005 and Flatfile to Oracle 10g.
    1. I have created three models.
    1-1. SQL2005 (SRC_CUSTOMER table)
    1-2. Flatfile (SRC_AGE_GROUP.txt & SRC_SALES_PERSON.txt)
    1-3. Oracle 10g (TRG_CUSTOMER table)
    You may know I got those environments from the ODI DEMO environment.
    2. I could able to reverse the tables also.
    3. I have created an interface which contains source table (from MSSQL 2005), Flatfile and target table from ORACLE model.
    4. I have imported the knowledge modules. But I am confusing in selecting the knowledge modules to source and target tables.
    I've selected LKM File to SQL for flatfile model.
    I've also selected LKM SQL to SQL for MSSQL 2005 model and IKM Oracle Incremental Update for the target table (ORACLE).
    I've also implemented the interface that I created. It worked without errors. But there is no data in target table which is TRG_CUSTOMER.
    I really would like to know what happened and what the problems are.
    You can email me [email protected]
    Thanks in advance
    Jason Lee

    what did give for SRC_AGE_GROUP SRC_CUSTOMER join condition
    if it is
    (SRC_CUSTOMER.AGE=SRC_AGE_GROUP.AGE_MIN) AND SRC_CUSTOMER.AGE=SRC_AGE_GROUP.AGE_MAX
    give it as
    (SRC_CUSTOMER.AGE>SRC_AGE_GROUP.AGE_MIN) AND SRC_CUSTOMER.AGE<SRC_AGE_GROUP.AGE_MAX

  • CLR to get the SQL Server Data into .CSV File

    Hi,
    I transformed 10 columns 1000 rows from the source table to 1 column 1000 rows in the destination table by making the comma separated columns ( Just like ..
    Insert into DestinationTable
    SELECT col1+','+col2 ....
    FROM SourceTable
    Then I want to take this column into CSV file.
    I dont have the rights to command shell.
    I heard that we may use CLR procedure for this. Can someone throw light?

    using System;
    using System.IOM
    using System.Data;
    using System.Data.SqlClient;
    using System.Data.SqlTypes;
    using Microsoft.SqlServer.Server;
    public class ExportFileClass {
    [Microsoft.SqlServer.Server.SqlProcedure]
    public static void export_file()
    using (SqlConnection connection = new SqlConnection(
    "context connection=true"))
    connection.Open();
    // Operation to open file goes here.
    SqlCommand command = new SqlCommand("SELECT col FROM YourTable");
    // Consume result set and write rows.
    Build this from the command line:
    sn -k keypair.snk
    csc /target:library /keyfile:keypair.snk exportfile.cs
    Then run in SQL Server (assuming that the files are in C:\temp on the SQL
    Server machine:
    [sql]
    USE master
    go
    -- To be able to create an external-access assembly, we need to load
    -- the key, the assembly is signed with. The key needs a password, but we
    -- don't need to know the password.
    DECLARE @sql nvarchar(MAX),
            @password char(40)
    SELECT @password = convert(char(36), newid()) + 'Ab4?'
    SELECT @sql = 'CREATE ASYMMETRIC KEY slog_loopback FROM FILE = ' +
                  '''C:\temp\keypair.snk'' ' +
                  'ENCRYPTION BY PASSWORD = ''' + @password + ''''
    PRINT @sql
    EXEC(@sql)
    -- And then a login to carry the permission.
    CREATE LOGIN exportfile$asymkey FROM ASYMMETRIC KEY ExportFile
    GRANT EXTERNAL ACCESS ASSEMBLY TO exportfile$asymkey
    go
    -- Now we can go back to our regular database and create the assembly.
    USE youddatabase
    go
    CREATE ASSEMBLY ExportFile FROM 'C:\temp\exportfile.dll'
    WITH PERMISSION_SET = EXTERNAL_ACCESS
    go
    CREATE PROCEDURE ExportFile AS
    EXTERNAL NAME ExportFile.ExportFileClass.export_file
    [sql]
    It is likely that you will have to do ask your DBA to do things in the
    master database.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Update/Insert mode couldn't apply to SQL Server source via Transparent Gateway.

    Hi all,
    OWB version is 9.0.2.56,database version is 9i Release 2.
    When set load type to "Insert",mapping works fine from SQL Server to Oracle table,via Transparent Gateway 901.
    But "Update/Insert" always runs error with "Fatal error or maximum number of errors exceeded".while I define both source and destination table to oracle tables in mapping,"Update/Insert" works file.
    Any suggestion?

    Hi Ignor,
    Thanks for your reply!
    The SQL Server version is SQL Server 2000.
    I just want to ETL data from a SQL Server table via Transparent gateway into oracle table,the source table has a increment seq field,so I want to define mapping using update/insert loading method in OWB,according to this seq field,if there is the same seq in the target table,do update,if not,insert the row.I just find out that if I use a middle table in oracle to do truncate/insert mode from SQL Server source table,then do update/insert mode from the middle one to target table,it works.But can't do directly from source to target using update/insert mode.Does this means update/insert mode only apply to mapping from local table to local table?
    Regards,
    Robbin

  • Connect SQL server source from OWB

    Hi,
    I have to connect to SQL Server source from OWB.
    I am using OWB 10.2 version and Owb is installed on UNIX platform.
    I have created system DSN, made respective entries in hs/admin and edited listener.ora file.
    In OWB Non-Oracle sorces trying to connect with ODBC connection to SQL server source.
    It is throwing erorr 'ORA-28545:error diagonised by Net8 agent when connecting to an agent Unable to retrieve text of NETWORK/NCR message 65535
    ORA-02063: preceding 2 lines from OWB-2339'
    How to check System DSN is setup properly on UNIX or not.
    Could anyone help out on this.

    Hi David,
    I have created db link and queried with select statement.
    It has thrown following error.
    " ORA-12537: TNS:connection closed".
    And, I don't know how to use "trace level gateway service configuration property in the service .ora file".
    I want to start from the first.
    Could you please give me the guidelines on, how to connect to a Sql server source(Which is on Remote Server) from OWB.
    What are the prerequisites and steps.
    Thanks for your help,
    Shaik.

  • Issue with characterset setting in OWB flat file target

    an OWB mapping reads from the database source and writes to flat file target in unix os but junk characters are displayed for non english characters in the target file . The database table contains french,spanish,german,arabic characters.The nls db parameter setting is AL32UTF8. The same setting has been applied to OWB target also but still junk values are appearing for non english characterset.different charactersets like al32utf8,utf8,utf18,us7ascii have been tried at owb target setting but nothing is wroking out to remove junk characters. Please suggest
    Edited by: 943807 on 30 Jun, 2012 10:43 PM

    Please provide some input on the issue

  • SQL Server Agent and OpenDataSource failing

    I have a stored procedure that is using an OpenDataSource query to export data from SQL Server into a excel file for download. I’ve installed the “Microsoft Access database engine 2010”, and can see it listed in SQL Server Management Studio under Server
    Objects > Linked Servers > Providers > Microsoft.ACE.OLEDB.12.0.
    If I manually run the stored procedure (when logged in as the OS’s administrator), the stored procedure runs fine, and the export is completed successfully.
    The stored procedure is set up to be run periodically by a SQL Server Agent job.
    However, if I start the SQL Server Agent job (when logged in as the OS’s administrator), the job fails with the following error message:
    Executed as user: NT SERVICE\SQLSERVERAGENT. Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)". [SQLSTATE 42000] (Error 7303) OLE DB provider "Microsoft.ACE.OLEDB.12.0"
    for linked server "(null)" returned message "Unspecified error". [SQLSTATE 01000] (Error 7412). The step failed.
    I have given the “NT SERVICE\SQLSERVERAGENT” user full control permissions on the destination directory where the export file resides (note that it starts out as an empty file just with the column headers defined).
    I’ve applied the following configuration settings to SQL Server:
    sp_configure 'show advanced options', 1;
    RECONFIGURE;
    GO
    sp_configure 'Ad Hoc Distributed Queries', 1;
    RECONFIGURE;
    GO
    EXEC master.dbo.sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'AllowInProcess', 1
    GO
    EXEC master.dbo.sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'DynamicParameters', 1
    GO
    What am I missing? Can anyone shed any light on what might be causing the failure?
    This is running on SQL Server Web Edition 2012 on Windows Server 2012 Standard.
    Thanks!

    Hi JonathanT1,
    First, I want to inform that, if SQL Server Agent log on account is “NT SERVICE\SQLSERVERAGENT”, we need to grant read and write permission to the destination folder to this account (you have done). From the following message:
    Executed as user: NT SERVICE\SQLSERVERAGENT
    It seems that you filled “NT SERVICE\SQLSERVERAGENT” in job step properties, “Run as user” option. I suggest changing it to another account who is in SQLAgentUserRole, SQLAgentReaderRole or SQLAgentOperatorRole. For more detail information, you can refer
    to the following link:
    Create a Transact-SQL Job Step
    http://technet.microsoft.com/en-us/library/ms187910.aspx
    SQL Server Agent Fixed Database Roles
    http://technet.microsoft.com/en-us/library/ms188283.aspx
    Allen Li
    TechNet Community Support

  • Connect to SQL Server 2005 Express MDF file

    Post Author: ims_user
    CA Forum: Data Connectivity and SQL
    Is it possible to connect directly to a SQL Server 2005 Express MDF file? Every time I select SQL Native Client it expects me to put in a server name etc, but there is no where to put in a file name or connection string. My application connects to this file directly using this in the connection string
    Data Source=.\SQLEXPRESS;AttachDbFilename=
    I now need to report on the data it contains.
    Many thanks.

    Post Author: ims_user
    CA Forum: Data Connectivity and SQL
    Is it possible to connect directly to a SQL Server 2005 Express MDF file? Every time I select SQL Native Client it expects me to put in a server name etc, but there is no where to put in a file name or connection string. My application connects to this file directly using this in the connection string
    Data Source=.\SQLEXPRESS;AttachDbFilename=
    I now need to report on the data it contains.
    Many thanks.

  • SQL Server Express and Visual Studio 2013

    In February I installed Visual Studio 2013 Professional. Looking in the Control Panel at all my installed programs, I see that I have a bunch of SQL server-related programs loaded, from the 2013 install and also from installs of previous Visual Studio versions.
    I've never done a thing with SQL server express, and am completely clueless about using it. I've already wanted to take a crack at it but it always seemed too daunting, so I backed off. It seems, however, that over the years the integration of SQL Server Express
    with Visual Studio is getting more and more seamless. Here is a list of all the SQL Server-related programs on my computer, with the ones installed automatically from the Visual Studio 2013 install bolded so they'll stand out. What I'm wondering is if I have
    everything I need to use SQL Server Express with Visual Studio 2013:
    Microsoft SQL Server 2005                                                  
    Microsoft Corporation   11/4/2013
    Microsoft SQL Server 2005 Mobile [ENU] De...                     
    Microsoft Corporation   4/29/2007
    Microsoft SQL Server 2008 R2 Data-Tier App...                    
    Microsoft Corporation   1217/2011
    Microsoft SQL Server 2008 R2 Data-Tier App...                    
    Microsoft Corporation   1217/2011
    Microsoft SQL Se1Ver 2008 R2 Management ...                   
    Microsoft Corporation   1217/2011
    Microsoft SQL Server 2008 R2 Transact-SQL ...                    
    Microsoft Corporation   12/7/2011
    Microsoft SQL Server 2012 Command Line ...                 
    Microsoft Corporation  2/10/2014
    Microsoft SQL Server 2012 Data-Tier App Fr...              
    Microsoft Corporation  2/10/2014
    Microsoft SQL Server 2012 Express LocalDB                 
    Microsoft Corporation  2/10/2014
    Microsoft SQL Server 2012 Management Ob...               
    Microsoft Corporation  2/10/2014
    Microsoft SQL Server 2012 Native Client                        
    Microsoft Corporation  2/10/2014
    Microsoft SQL Server 2012 Transact-SQL Co...                    
    Microsoft Corporation   9/21/2012
    Microsoft SQL Server 2012 Transact-SQL Ser...            
    Microsoft  Corporation 2/10/2014
    Microsoft SQL Server 2012 T-SQL Language ...             
    Microsoft Corporation  2/10/2014
    Microsoft SQL Server Compact 3.5 Design T...                     
    Microsoft Corporation   2/14/2008
    Microsoft SQL Server Compact 3.5 SP2 ENU                       
    Microsoft Corporation   5/25/2010
    Microsoft SQL Server Compact 4.0SP1 ENU                        
    Microsoft Corporation   9/21/2012
     Microsoft SQL Se1Ver Data Tools - enu (11.1....                 
    Microsoft Corporation   5/19/2013
     Microsoft SQL Server Data Tools - enu (12.0....            
    Microsoft Corporation  2/10/2014
     Microsoft 
    SQL Server Data  Tools Build   Utiliti ...              
    Microsoft Corporation   5/19/2013
     Microsoft 
    SQL Server Data  Tools Build   Utiliti ...         
    Microsoft  Corporation 2/10/2014
     Microsoft SQL Server Database Publishing ...                     
    Microsoft Corporation   2/14/2008
    Microsoft SQL Server Database Publishing ...                      
    Microsoft Corporation   5/25/2010
    Microsoft SQL Server Native Client                                      
    Microsoft Corporation   4/1/2011
    Microsoft SQL Server Setup Support Files (E...                    
    Microsoft Corporation   4/1/2011
    Microsoft SQL Se1Ver System CLR Types                             
    Microsoft Corporation   1217/2011
    Microsoft SQL Server VSS Writer                                         
    Microsoft Corporation   4/1/2011

    Hello,
    Please read the following resources:
    http://msdn.microsoft.com/en-us/library/ms233763.aspx
    http://stackoverflow.com/questions/20333518/how-to-create-a-database-in-ms-visual-studio-2013
    http://msdn.microsoft.com/en-us/vstudio/bb643825.aspx
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • SQL Server Agent and Jobs and executing @EventData

    I have a SQL Server Agent Job and within it a Job Step which states "Execute Report Subscriptions" and a command which has...
    exec msdb.dbo.sp_start_job '6FF53AED-855F-43AB-9FB7-064062B8012E' --9:07 subscription
    GO
    WAITFOR DELAY '00:08';
    Now, I find within SQL Server Agent the Job  '6FF53AED-855F-43AB-9FB7-064062B8012E' and its step command which is...
    exec [ReportServer].dbo.AddEvent @EventType='TimedSubscription', @EventData='ca4e5410-2758-4a1a-9b06-513821e0d962'
    How can I drill-down further into the @EventData 'ca4e5410-2758-4a1a-9b06-513821e0d962' to see what it does? I do not see 'ca4e5410-2758-4a1a-9b06-513821e0d962' within SQL Server Agent and Jobs or am I way off base here as to what exactly the @EventData
    parameter seems to be?
    Thanks for your review and am hopeful for a reply.

    Hi ITBobbyP,
    According to your description, you need to know the what does SQL Server Reporting Services do when fire a subscription, right?
    When you create a subscription several things are added to the RS server
    A row is placed in the Subscriptions table identifying the name of the report, along with parameter settings, data driven query info and so on to process the subscription
    A row is placed in the Schedule and ReportSchedule tables with the timing of the subscription
    A SQL Server Agent job is created to control the scheduled execution of the report, and this is stored in the sysjobs and sysjobsteps of the MSDB database.
    When the subscription runs several things happen
    The SQL Server Agent job fires and puts a row in the Event table in the RS catalog with the settings necessary to process the subscription
    The RS server service has a limited number of threads (2 per CPU) that poll the Event table every few seconds looking for subscriptions to process
    When it finds an event, it puts a row in the Notifications table and starts processing the subscription
    Please refer to the links below to see the details.
    http://blogs.msdn.com/b/deanka/archive/2009/01/13/diagnosing-and-troubleshooting-subscriptions.aspx
    http://blogs.msdn.com/b/deanka/archive/2010/02/16/troubleshooting-subscriptions-part-ii-using-the-report-services-trace-log-file.aspx
    Regards,
    Charlie Liao
    TechNet Community Support

Maybe you are looking for

  • Adding new data to a notification

    Hi everyone, I have a requirement to modify an approval notification and add some new data to it. On the internet I have found examples of how to embed an OA Framework region into a workflow notification. For example here - http://www.oraclearea51.co

  • TV series download, part on 1 compter other on 2nd computer

    I purchased and downloaded a TV series. 4 shows downloaded to my Asis computer then gave me an error that there was no room on the disk drive which is questionable since I don't do downloads to that computer. My Dell took the other 8 episodes. I cann

  • Transaction code to post Target costs to a Repetitive order

    Hi, Could you please let me know the Transaction code to post Target costs to a Repetitive order or Product cost collector? Thanks in advance for the help.

  • Deleted Word doc from Ipad. Any way to recover?

    I was working on a document and accidentally hit the delete button. It's gone. Any way to recover the doc?

  • How provide reviews and ratings in App Store?

    I have an application I bought on my iPod. I want to go back in and create a review and rate the app but when I look at the app page in iTunes I cannot edit my rating stars and when I select write a review nothing happens. Following instructions foun