Best Procedure to Validate data in Xlsx

Hi All,
I have a requirement where we have to build an ETL  to load xlsx files into my SQL Database. Before loading to my target table i would need to validate the data.
I have Two Procedures to validate the data
1) Import every thing into SQL, validate it  load to Target Table
2) Validate the xlsx in ssis using the data conversion task, conditional split task etc.
My Question is which is the best procedure to validate.
I have 15 columns (Mostly numeric,date,money) and two validation scenarios check for null? check the length?
Thanks in Advance.
kuk

I would prefer doing this in SQL unless there are any complicated steps like RegexMatch which may be much better dealt with using SCript Task in SSIS by using .NET functions.
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Similar Messages

  • PL SQL Procedure to validate the data before inserting

    Hi All,
    I have a PLSQL procedure that validates the data and also inserts the data into the table. That procedure must be run to validate each row to be inserted. My doubt is how to reference that procedure within the interface of ODI.
    After reading some posts that mention the use of procedures, I think the best option is to call the procedure inside the knowledge module (inside a cursor that does a insert clause). Am I correct?
    As the KM's do a lot of verification and use temporary tables, I don't know what are the steps to be modified. Also, I would like to know if it's necessary to modified only the IKM or the LKM too.
    I'm using the IKM Oracle Incremental Update (PL SQL) and LKM Oracle to Oracle.
    Thanks.
    Luciene

    by validating data you mean looking up some table and see if it exists?
    If this is the case the you can implement this using a user function.
    If validation fails then you may put a -1 into the mapping.
    Then put a constraint on the target( say column is -1) and enable flow control.

  • Best procedure to delete all data in my iMac etc

    Selling or trading in an iMac which is best procedure to completely erase all data ?
    Also procedure to transfer data from external disk with saved data from entire system using TM ?
    Thanks so much Happy New Year

    Before you sell or give away your computer, in addition to the steps listed in this support article, take these steps:
    1. Run Apple Diagnostics or the Apple Hardware Test. The buyer will do this (or he should), and you don't want to be surprised by the results.
    2. Reset the PRAM and the SMC, which might contain personal information.
    3. If you set a firmware password, remove it by running Firmware Password Utility in Recovery mode.
    4. If you activated FileVault in OS X 10.7 or later, turn it off.
    5. If you use Boot Camp, the partition must be deleted.
    6. If you created any other data partitions on the internal drive, remove them in Disk Utility.
    7. If the machine has an internal hard drive, erase the one remaining data partition with the option to zero out data. An SSD doesn't need to be zeroed.
    You can't legally or practically transfer any software downloaded from the Mac App Store to the new owner of the machine, even if it was free. That includes OS X, so if you upgraded to OS X 10.7 or later, you must reinstall an older OS, either from the installation media, if applicable, or by starting up in Internet Recovery mode (option-command-R at the startup chime.) If you installed from physical media, deliver those to the new owner.
    If you're selling the machine, or donating it in working order, and it originally shipped with OS X 10.4 or 10.5, then you have the option of installing either from the discs that came with it or from a retail Snow Leopard disc (which you must then transfer to the buyer.) The buyer should understand that if he doesn't get the original discs from you, he won't get the bundled iLife applications or the Apple Hardware Test. Replacements for the original discs can be ordered from Apple.
    The new owner will have to redownload any software that came from the App Store, including OS X upgrades, under his or her Apple ID. If you ever updated the bundled iLife applications (Garage Band, iMovie, and iPhoto) through the App Store, you can't transfer those either. The buyer will have to purchase them.
    Remove the machine from your list of registered products. If it's still covered by an AppleCare Protection Plan, transfer the coverage to the new owner by following the instructions in the AppleCare Terms and Conditions (under the heading "Transfer of Plan.")

  • What is the best approach/tools/methodolgy to validate data in SSIS

    Hi,
    I have implemented ETL packages for more than 200 tables . I logged the row count as a first step for testing. Now i would like to implement automation/validate data using test cases.
    Being a single resource to do all this process is little difficult for the give time frame:(
    Could you please guide me for effective testing scenarios(automation technique) with optimum effort?

    I have a script that among all other things does
    dtexec.exe package_name /Validate
    Other than that, there is a grater danger down the road from schema changes.
    Arthur My Blog

  • Simple stored procedure to validate multiple customer account numbers without defining a type

    I would like to create a simple stored procedure to validate up to 1-10 different customer account numbers at a time and tell me which ones are valid and which ones are invalid (aka exist in the Accounts table).  I want it to return two columns, the
    account number passed in and whether each is valid or invalid.  
    The real catch is I don't want to have to define a type and would like to do it with standard ANSI sql as my application has to support using multiple dbms's and not just sql server.  Thanks!

    Hi again :-)
    Now we have the information to help you :-)
    I write the explanation in the code itself. Please read it all and if you have any follow up question then just ask
    This solution is for SQL Server and it is not fit for all data sources. Please read all the answer including the comments at the end regarding other data sources. Basically you can use one String with all the numbers seperated by comma and
    use a SPLIT function in the SP. I give you the solution using datatype as this is best for SQL Server.
    In this case you should have a split function and this is very different from one database to another (some have it build it, most dont)
    ------------------------------------------------------------------- This part call DDL
    CREATE TABLE Accounts(
    AccountNbr [char](10) NOT NULL,
    CustomerName [varchar](100) NOT NULL,
    CONSTRAINT [PK_Accounts] PRIMARY KEY CLUSTERED ([AccountNbr] ASC)
    GO
    ------------------------------------------------------------------- This part call DML
    INSERT INTO Accounts(AccountNbr, CustomerName)
    SELECT
    cast(cast((9000000000* Rand() + 100000) as bigint ) as char(10)) as AccountNbr
    ,SUBSTRING(CONVERT(varchar(255), NEWID()), 0, 11) as CustomerName
    GO
    ------------------------------------------------------------------- Always I like to check the data
    SELECT * from Accounts
    GO
    /* Since you use random input in the DML and I need to check valid or in-valid data,
    Therefore I need to use this valid AccountNbr for the test!
    AccountNbr CustomerName
    6106795116 E689A83F-A
    -------------------------- Now we sytart with the answer ------------------------------------
    -- You should learn how to Create stored Procedure. It is very eazy especially for a developr!
    -- http://msdn.microsoft.com/en-us/library/ms345415.aspx
    -- dont use the SSMS tutorial! use Transact-SQL
    -- Since you want to insert unknown number of parameters then you can use Table-Valued Parameters as you can read here
    -- http://msdn.microsoft.com/en-us/library/bb510489.aspx
    -------------------------- Here is what you looking for probably:
    /* Create a table type. */
    CREATE TYPE Ari_AcountsToCheck_Type AS TABLE (AccountNbr BIGINT);
    GO
    /* Create a procedure to receive data for the table-valued parameter. */
    CREATE PROCEDURE Ari_WhatAccountsAreValid_sp
    @AcountsToCheck Ari_AcountsToCheck_Type READONLY -- This is a table using our new type, which will used like an array in programing
    AS
    SET NOCOUNT ON;
    SELECT
    T1.AccountNbr,
    CASE
    when T2.CustomerName is null then 'Not Valid'
    else 'Valid'
    END
    from @AcountsToCheck T1
    Left JOIN Accounts T2 On T1.AccountNbr = T2.AccountNbr
    GO
    -- Here we can use it like this (execute all together):
    /* Declare a variable that references the type. */
    DECLARE @_AcountsToCheck AS Ari_AcountsToCheck_Type;
    /* Add data to the table variable. */
    Insert @_AcountsToCheck values (45634),(6106795116),(531522),(687),(656548)
    /* Pass the table variable data to a stored procedure. */
    exec Ari_WhatAccountsAreValid_sp @AcountsToCheck = @_AcountsToCheck
    GO
    ------------------------------------------------------------------- This part I clean the DDL+DML since this is only testing
    drop PROCEDURE Ari_WhatAccountsAreValid_sp
    drop TYPE Ari_AcountsToCheck_Type
    -------------------------- READ THIS PART, for more details!!
    -- validate up to 1-10 different customer account numbers at a time
    --> Why not to validate alkl ?
    --> SQL Server work with SET and not individual record. In most time it will do a better job to work on one SET then to loop row by row in the table.
    -- tell me which ones are valid and which ones are invalid (aka exist in the Accounts table)
    --> If I understand you correctly then: Valid = "exist in the table". true?
    -- I want it to return two columns, the account number passed in and whether each is valid or invalid.
    --> It sound to me like you better create a function then SP for this
    -- The real catch is
    -- I don't want to have to define a type
    --> what do you mean by this?!? Do you mean the input parameter is without type?
    -- and would like to do it with standard ANSI sql
    --> OK, I get that you dont want to use any T-SQL but only pure SQL (Structured Query Language),
    --> but keep inmind that even pure SQL is a bit different between different databases/sources.
    -->
    -- as my application has to support using multiple dbms's and not just sql server.
    --> If you are looking a solution for an applicatin then you probably should use one of those approach (in my opinion):
    --> 1. You can use yourown dictunery, or ini file for each database, or resources which is the build in option forwhat you are looking for
    --> You can create for each data source a unique resources
    --> If the queries that need to be execut are known in advance (like in this question), then you can use the above option to prepare the rigt query for each data source
    --> Moreover! one of those resources can handle as general for "other ources"
    --> 2. There several ORM that already do what you ask for and know how to work with different data sources.
    --> You can use those ORM and use their query languge instead of SQL (for example several work with LINQ).
    I hope this is helpful :-)
    [Personal Site] [Blog] [Facebook]

  • PL/SQL procedure to insert data doesn't work and unable to find reason.

    Sorry that I couldn't find the best place to post this question. It seems that the forum does not deal with this kind of question. I post here for help.
    I have a stored procedure to insert data into one table. SP was compiled without error and executed without error (from log table to get information). But the data was not inserted into
    the target table. I have tried different way to figure out the reason. But I failed to get any idea. Please help me to find possible reasons. The smple SP looks like this:
    CREATE OR REPLACE PROCEDURE my.sp_insert( P_DATE IN VARCHAR2)
    IS
    declare section
    begin
    insert into target_table (column1, column2, column3, column4)
    select record1, record2, record3, record4 from table1, table2, table3, table4
    where clause;
    commit;
    exception section
    UPDATE PROCESS_LOG_TABLE CLAUSE;
    html_email section;
    rollback;
    end my.sp_insert
    I have tested that "select record1, record2, record3, record4 from table1, table2, table3, table4" really fetch the 7,000 records. and if I only run part of SQL from SQLPLUS as
    insert into target_table (column1, column2, column3, column4)
    select record1, record2, record3, record4 from table1, table2, table3, table4
    where clause;
    It will work and insert 7,000 records into target table. Why did it not insert into target_table when execiting as stored procedure? Please help with your input. Thanks.
    Edited by: citicbj on Feb 12, 2013 4:15 PM

    Dear Friend,
    Is the user from which you created database procedure and sqlplus that you tested the code successfully is same?
    Regards
    Ahamed Rafeeque Cherkala

  • What is the best procedure to update from Leopard (or Snow Leopard) to Mavericks?

    The pacient:
    Macbook Pro A1278
    Running 10.5.8 -- but have an Update DVD to 10.6 (Snow Leopard)
    Got slower in start-up
    Very slow in power-off (takes lot of time on shut-down!)
    What is the BEST procedure to update it from Leopard to Mavericks?
    A) update & clean
    Backup to Time Machine (in Leopard)
    Update from 10.5.8 to 10.6 (Snow Leopard)
    Update 10.6 to 10.6.8
    Donwnload and Update to Maverics
    Do any kind of clean to increase speed in start-up / shut-down - Any suggestions?
    or
    B) fresh install & update & recover Time Machine
    Backup to Time Machine
    Reinstall a fresh 10.5.8 (Leopard) - should increase speed in start-up / shut-down ??
    Update from 10.5.8 to 10.6 (Snow Leopard)
    Update 10.6 to 10.6.8
    Donwnload and Update to Maverics
    Recover users data & config from Time Machine
    I am thrilled to heard your advices!!
    PS. Aditional suggestions to make a faster boot / power-down , before or after updating are very welcome ;!)

    Go to  Menu > About this Mac > and tell us Version, Processor & Memory specs on your Mac. Also available hard disk space, by choosing your Macintosh HD and "Get Info" (cmd-i)
    If you're having issues now with slow sratup and shutdown, it's probably a third party item. If it is, then it may limited to your user account. If that's the case and you do a clean install, then migrate you will wind up migrating it right back.
    The first thing to check would be to boot into your Guest account and test, or try starting in Safe Mode and see if the problem still occurs?
    Restart holding the "shift" key.
    (Expect it to take longer to start this way because it runs a directory check first.)
    If this works look in System Preferences > Users & Groups > Login items and delete any third party login items.
    Also look in /Library/Startup Items. Nothing is put in that folder by default, so anything in there is yours. Then log out and back in or restart and test.
    If the problem is sorted, be sure to make a new backup before proceeding. Since the problem is sorted and you have a backup without the offending items, then there's no reason not to use the simple upgrade method you outlined in A. With the exception of "cleaning". The only cleaning your Mac should need is with a soft cloth. Stay away from so-called cleaning/optomizing utilities.

  • What is the best way to validate?

    This image is a template Im using to create an expense form.
    http://img160.imageshack.us/img160/963/form25vp.jpg
    I have a specials item section which is just totaled from all the Special Items fields.
    Was able to create a totals script to but could not get it to leave the field blank. Thanks to Justin Klei using this script it totals without a problem.
    This has been placed it the Calculate section of the Total field.
    var totalval = form1.costs.spei1.rawValue + form1.costs.spei2.rawValue;
    if (totalval == 0 || totalval == null || totalval == "")
    this.rawValue = "";
    else
    this.rawValue = totalval;
    If the user types $12.00 into the Special Items 1 field they then are able to transfer this to the main table by clicking on any of the Special column fields. In each field Ive got the following script that will allow the user to click on any of the Special column fields and only apply the total once. If the user clicks on the Tuesday field and then decides to move the total to Sunday all they have to do is click on the Sunday field.
    This have been placed in the mouse down event (will create a transparent button later).
    if (this.rawValue)
    sunspe.rawValue = ""
    } else {
    sunspe.rawValue = spetot.rawValue
    monspe.rawValue = ""
    tuespe.rawValue = ""
    wedspe.rawValue = ""
    thuspe.rawValue = ""
    frispe.rawValue = ""
    satspe.rawValue = ""
    Ive just reused the script for each field and moved the spetot.rawValue to the appropriate day.
    Here is my question.
    If the user types a figure in Special Items 1 and then applies that figure to the Special column and then decides to add another figure to Special Items 2, what is the best what to validate the Special column?
    Would having a message pop up be the best?
    This has been placed in the Validate section of the Total field.
    if (spetot.rawValue != sunc1.rawValue)
    app.alert("There has been a change to the Special Item Total \n Please update the Special column.");
    Is it possible for the form to automatically update the figure if it has been applied to the Special column?
    The problem I have with the message currently is obviously it pops up every time you add a figure into the Special Items. Is there a way to compare only if there is a figure in the field?
    Any suggestions would be appricated.

    Hi,
    it was the same i built my small proj with the user authentication with SQL server and JSP.
    u should first create a table with 2 fields "user" and "pass"
    in ur jsp the name of the textboxes for the user and pass should b the same .
    use some other name to retrive the data form the table say "user1"and "pass1".
    u need 2 write some connections say "
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("user", "Pass");
    i'll post u the entire code soon.
    thankx.

  • Best choice for a date column in forms

    Hello,
    I want to know what is the best choice for a date field that the user have to enter manually. I read on a other post that a calender control is not directly implemented in forms 9i. So what is the best choice to be "user friendly" with a date field in a form?
    thanks in advance.

    Hi
    Don't know if this would be much use to you, but I wrote this function 'Check_Date' a while back to check whether the user had typed something which could be interpreted as a date. You'd make your date field into a Text Item, and include a call to this function (which could be in your form, or in a library) in the WHEN-VALIDATE-ITEM trigger on the item, ie:
    IF NOT check_date(:ITEMS.date_item1, NULL, NULL) THEN
        RAISE FORM_TRIGGER_FAILURE;
    END IF;This would mean that the user could type 'T' or '*' for today, '+1' for tomorrow, '-7' for one week ago, or the date in a variety of formats. When they leave the field, the function tries to resolve what they've typed into a date, and sets the field to a date in the correct format.
    ('Display_Alert' is just a function to display a named alert with a message.) It can also be used to check that the date entered doesn't fall outside upper and lower bounds. Code follows:
    FUNCTION Check_Date (text_in        IN OUT VARCHAR2,
                         lower_bound_in IN DATE,
                         upper_bound_in IN DATE)
    RETURN BOOLEAN IS
    first_letter      VARCHAR2(1)  := SUBSTR(text_in, 1, 1);
    date_ok           BOOLEAN;
    this_date         DATE;
    date_diff         NUMBER(8);
    output_format     VARCHAR2(12) := Get_Application_Property(BUILTIN_DATE_FORMAT);
    TYPE date_format_table_type IS TABLE OF VARCHAR2(12)
    INDEX BY BINARY_INTEGER;
    date_format_table    date_format_table_type;
    BEGIN
        --Set up table of date formats in order they'll be tested for
        date_format_table(1)  := 'DD-MON-RRRR';
        date_format_table(2)  := 'DD-MM-RRRR';
        date_format_table(3)  := 'DD-MM';
        date_format_table(4)  := 'DD-MON';
        date_format_table(5)  := 'YYYY-MM-DD';
        date_format_table(6)  := 'YYYY-MON-DD';
        --Use of T, or * for today's date...
        IF UPPER(text_in) IN ('T', '*') THEN
               this_date := SYSDATE;
               date_ok := TRUE;
        --Look for use of +x/-x for number of days different from today
        ELSIF first_letter IN ('+', '-') THEN
               BEGIN
                   date_diff := TO_NUMBER(SUBSTR(text_in, 2));
                   IF first_letter = '+' THEN
                       this_date := SYSDATE + date_diff;
                   ELSE
                          this_date := SYSDATE - date_diff;
                   END IF;
                   date_ok := TRUE;              
               EXCEPTION
                      WHEN VALUE_ERROR THEN
                          --User has entered something like '+X', so not valid
                          date_ok := FALSE;
               END;
        ELSE
            --Go through all the possible formats for date entry,
            --if any give a valid date, then return that.
            FOR ix IN date_format_table.FIRST..date_format_table.LAST LOOP
                   EXIT WHEN date_ok;
                BEGIN
                       --Try creating a date using the format masks in the local
                       --table.  If no good, this will throw an INVALID_DATE exception
                       this_date := TO_DATE(text_in, date_format_table(ix));
                       date_ok := TRUE;
                   EXCEPTION
                       WHEN OTHERS THEN
                           date_ok := FALSE;
                   END;
            END LOOP;
        END IF;
        IF date_ok THEN         
               --Check for violation of lower/upper bounds on date
               IF (lower_bound_in IS NOT NULL AND this_date < lower_bound_in) THEN
                   Display_Alert('info_alert', 'Date cannot be before '||TO_CHAR(lower_bound_in, output_format));
                   date_ok := FALSE;
               ELSIF (upper_bound_in IS NOT NULL AND this_date > upper_bound_in) THEN
                   Display_Alert('info_alert', 'Date cannot be after '||TO_CHAR(upper_bound_in, output_format));
                   date_ok := FALSE;
               ELSE
                      text_in := TO_CHAR(this_date, output_format);
               END IF;
        ELSE
            Display_Alert('INFO_ALERT', text_in||' is not a valid date !!');
        END IF;
        RETURN date_ok;
    END;Hope this is useful.
    regards
    Andrew
    UK

  • Where to find best practices for tuning data warehouse ETL queries?

    Hi Everybody,
    Where can I find some good educational material on tuning ETL procedures for a data warehouse environment?  Everything I've found on the web regarding query tuning seems to be geared only toward OLTP systems.  (For example, most of our ETL
    queries don't use a WHERE statement, so the vast majority of searches are table scans and index scans, whereas most index tuning sites are striving for index seeks.)
    I have read Microsoft's "Best Practices for Data Warehousing with SQL Server 2008R2," but I was only able to glean a few helpful hints that don't also apply to OLTP systems:
    often better to recompile stored procedure query plans in order to eliminate variances introduced by parameter sniffing (i.e., better to use the right plan than to save a few seconds and use a cached plan SOMETIMES);
    partition tables that are larger than 50 GB;
    use minimal logging to load data precisely where you want it as fast as possible;
    often better to disable non-clustered indexes before inserting a large number of rows and then rebuild them immdiately afterward (sometimes even for clustered indexes, but test first);
    rebuild statistics after every load of a table.
    But I still feel like I'm missing some very crucial concepts for performant ETL development.
    BTW, our office uses SSIS, but only as a glorified stored procedure execution manager, so I'm not looking for SSIS ETL best practices.  Except for a few packages that pull from source systems, the majority of our SSIS packages consist of numerous "Execute
    SQL" tasks.
    Thanks, and any best practices you could include here would be greatly appreciated.
    -Eric

    Online ETL Solutions are really one of the biggest challenging solutions and to do that efficiently , you can read my blogs for online DWH solutions to know at the end how you can configure online DWH Solution for ETL  using Merge command of SQL Server
    2008 and also to know some important concepts related to any DWH solutions such as indexing , de-normalization..etc
    http://www.sqlserver-performance-tuning.com/apps/blog/show/12927061-data-warehousing-workshop-1-4-
    http://www.sqlserver-performance-tuning.com/apps/blog/show/12927103-data-warehousing-workshop-2-4-
    http://www.sqlserver-performance-tuning.com/apps/blog/show/12927173-data-warehousing-workshop-3-4-
    http://www.sqlserver-performance-tuning.com/apps/blog/show/12927061-data-warehousing-workshop-1-4-
    Kindly let me know if any further help is needed
    Shehap (DB Consultant/DB Architect) Think More deeply of DB Stress Stabilities

  • Best procedure to downgrade a SQL Server 2012 SP2 installation from Enterprise edition to Standard edition

    Hi,
    following a purpose change for a database server, I need to downgrade the SQL Server 2012 SP 2 installation from Enterprise to Standard edition.
    Does it exist the best procedure to do it in a secure manner with a low impact?
    Many thanks

    Please note that while you are downgrading by uninstalling and reinstalling and then restoring backup  taken from 2012 enterprise to standard , if backup contains data about used enterprise features you would not be able to restore the backup so BE
    CAREFUL.
    You should , if possible, get a new box install SQL Server standard and try restoring backup if it fails disable enterprise features and again take backup and then you would be able to restore.
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
    My Technet Wiki Article
    MVP

  • RegEx to validate date between 1900 & today

    Hi,
    I have a RegEx which validates the date of birth
    (0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)dd
    But I want it to validate date of birth until today only from 1900
    How can I do that using regular expression?
    a®s
    Edited by: a®s on Jul 2, 2008 3:00 PM

    Thanks for your reply Jan.
    Jan Stallkamp wrote:
    > In general regex tend to be easy to write but hard to read. So from a maintance perspective they might not be the best choice. >
    I accept the fact that you mentioned above.
    I am planning different RegEx for different date formats.
    This application need to be called from a PHP page. so don't find any other way to tackle this issue.
    Any other info?

  • Exit to validate data in CJ01

    Hi experts ,
    I have a issue in Exits . I need to validate data in CJ01 Project Definition data .
    Exactly is there any Badi or Userexit to validate the data at SAVE of the CJ01.
    Regards,
    Sandeep thota.

    Thats a very generic question. You can use various methods for that
    1. Use script task and include your validation logic
    2. Use derived column transform and do validation using ssis functions and return boolean result based on outcome
    3. Get details onto staging table, use t-sql stored procedure etc
    If you can explain exact scenario we may be able to suggest more specific answer.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Procedure to insert data in multiple rows

    Hi,
    I need a stored procedure which inserts data into multiple rows..
    Ex: I need to have 3 columns in Procedure, where col3 has limit in size let's say 500.
    If user insert about 1500 in col3, i has to insert first 500 in row1 and 501 - 1000 in row 2 and 1001 - 1500 in row 3.
    Can any one help in creating procedure for above scenario.
    Thanks in Advance...
    Sree

    create table #t (id int, id1 int)
    WITH [1-20]
    AS
    SELECT row_number() over (order by number) rn,number
            FROM master..spt_values
             WHERE type = 'P'
             AND number BETWEEN 1 AND 20
     [21-30]
    AS
    SELECT row_number() over (order by number) rn,number
            FROM master..spt_values
             WHERE type = 'P'
             AND number BETWEEN 21 AND 30
    ) INSERT INTO #t 
      SELECT A.number,B.number FROM
         [1-20] A JOIN [21-30] B ON A.rn=B.rn
    SELECT * FROM #t
    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

  • Data Pump .xlsx into a SQL Server Table and the whole 32-Bit, 64-Bit discussion

    First of all...I have a headache!
    Found LOTS of Google hits when trying to data pump a .xlsx File into a SQL Server Table. And the whole discussion of the Microsoft ACE 64-Bit Driver or the Microsoft Jet 32-Bit Driver.
    Specifically receiving this error...
    An OLE DB record is available.  Source: "Microsoft Office Access Database Engine"  Hresult: 0x80004005  Description: "External table is not in the expected format.".
    Error: 0xC020801C at Data Flow Task to Load Alere Coaching Enrolled, Excel Source [56]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "Excel Connection Manager"
    failed with error code 0xC0202009.
    Strangely enough, if I simply data pump ONE .xlsx File into a SQL Server Table utilizing my SSIS Package, it seems to work fine. If instead I am trying to be pro-active and allowing for multiple .xlsx Files by using a Foreach Loop Container and a variable
    @[User::FileName], it's erroring out...but not really because it is indeed storing the rows onto the SQL Server Table. I did check all my Delay
    Why does this have to be sooooooo difficult???
    Can anyone help me out here in trying to set-up a SSIS Package in a rather constrictive environment to pump a .xlsx File into a SQL Server Table? What in God's name am I doing wrong? Or is all this a misnomer? But if it's working how do I disable the error
    so that is stops erroring out?

    Hi ITBobbyP,
    According to your description, when you import data of .xlsx file to SQL Server database, you got the error message.
    The error can be caused by the following reasons:
    The excel file is locked by other processes. Please kindly resave this file and name it to other file name to see if the issue will be fixed.
    The ACE(Access Database Engine) is not up to date as Vaibhav mentioned. Please download the latest ACE and install it from the link:
    https://www.microsoft.com/en-us/download/details.aspx?id=13255.
    The version of OFFICE and server bitness is not the same. To solve the problem, please refer to the following document:
    http://hrvoje.piasevoli.com/2010/09/01/importing-data-from-64-bit-excel-in-ssis/
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    Wendy Fu
    TechNet Community Support

Maybe you are looking for

  • Acrobat 8.0 Printing Problem?

    I am having a problem using Acrobat 8.0, updated, and printing a pdf document from IE 8 or 9.  I am using Windows Vista, updated. The problem I am having is when I attempt to print a web page thru the Adobe printer the titling and oulining of the pag

  • Items on icloud will not download

    Items on icloud will not download

  • PS3 and wrt310nv2

    Hi, Hope someone can help me. I have the wrt310nv2 and a PS3 both the the most up to date firmware. I've set up the router settings for the ps3 that i found on this site and i'm having trouble with streaming video from my media server. I can stream m

  • Ibook g4 that does not  display the battery meter, sound volume, tim

    I have an ibook g4 that does not display the battery meter, sound volume, time & day.When i move cursor over the area where they should be I see a spinning beach ball beach ball

  • How can I view the details of a pending plan change?

    I received a flyer saying I could probably save some money if I came in and changed plans. I went to my local Verizon store and met with an associate who set me up with a new plan to start next billing cycle. He didn't give me any paperwork and I can