How to compare 2 different database to get table name which are not present in second database

How to compare 2 different database to get table name which are not present in second database

Sorry cannot test it right now
use db1
go
select * from sys.tables t where not exists
(select * from db2.sys.tables s where t.object_id=s.object_id)
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

Similar Messages

  • How to find Tables names which are updated or inserted data

    Hi,
    I need some help to know.
    I am submitting a form in Oracle OWS (Oracle Workforce Scheduling), but don’t know where exactly data is going in the tables or how many tables are going to updated.
    I want to know the table names which are update after the submitting the form.
    Thanks in advance....
    Regards,
    Saket

    I don't think so. Never heard of Oracle Workforce Scheduling. Is there a forum for that?
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    https://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • Is it ok to query tables/views that are not in the reporting database?

    I have a requirement to show when a resource submitted/modified each of the items in their time sheet I found that we can get in this information by going directly to the publishing table MSP_Assignment_Transactions but it is well documented that accessing
    the publishing tables directly is not supported by Microsoft.
    What other options are there to get the data from this table or for that matter any table other than the reporting tables that Microsoft would support?
    Just as an FYI we do not want to write to them we just want to select the data we need.

    Even though accessing published DB is not supported for several reason, depending upon query you may start experiencing performance problems, if a later CU/SP alters the DB schema your reports may fail, but personally haven't experienced it in long
    time,
    Also in my personal experience if you are not acquiring lock on the table while querying, it doesn't harms but then there are downside of it
    However as an alternate as Rod suggested use PSI to get the data and stage it in staging table or something and then use it for reporting or you can replicate the publish DB and use that for reporting purpose  
    Thanks | Sunil Kr Singh | http://epmxperts.wordpress.com

  • How can I sync the standard Outlook calendar with the "Calendar in iCloud"? I just get 2 calendars which are not synchronized.

    I am using a PC with Windows 7 and MS Office/Outlook 2007 together with the latest iCloud control panel.
    Everything seems to be fine, but the synchronization works only for the calendar "Calendar in iCloud". Which is the one coming from my iPhone.
    Which means the iCloud function is working from the iPhone.
    When I update my standard Outlook calendar "Calendar" on the PC it is not getting transferred to the "Calendar in iCloud".
    How can I "merge" them?
    I have to use the standard Outlook Calendar because it is the one connected to the Exchange server and shared among my colleagues.

    same issue, looks like nobody answered you from last JULY....

  • EMERGENCY: List of files in Recovery Area not managed by the database

    Hi,
    this is an emergency request....
    I have this data guard set up. And i accidently dropped online redo logs, standby logs and the archive log except the current online redolog.
    i actually ran to cleanup the whole directory which included the controlfile and the datafiles (was on the wrong location on ASM)
    but the controlfile and the datafiles did not get deleted. i can still see them on the ASM.
    and now when i am trying to restore the archive logs, but i keep getting error as shown below...
    WARNING: A file of type ARCHIVED LOG may exist in
    db_recovery_file_dest that is not known to the database.
    Use the RMAN command CATALOG RECOVERY AREA to re-catalog
    any such files. This is most likely the result of a crash
    during file creation.
    so when i did the below i was getting error as:
    RMAN> CATALOG RECOVERY AREA;
    using target database control file instead of recovery catalog
    searching for all files in the recovery area
    no files found to be unknown to the database
    List of files in Recovery Area not managed by the database
    ==========================================================
    File Name: +DATA/afcpdg/controlfile/controlfile01.ctl
    RMAN-07526: Reason: File is not an Oracle Managed File
    File Name: +DATA/afcpdg/onlinelog/group_1.304.718194815
    RMAN-07527: Reason: File was not created using DB_RECOVERY_FILE_DEST initialization parameter
    number of files not managed by recovery area is 82, totaling 168.10GB
    But i do see those data files that RMAN is complaining as shown above in the ASM.
    I HOPE I DID NOT MESS UP THE CONTROLFILE and the DATFILES
    CAN SOMEONE HELP ME FIX THIS MISTAKE THAT I DID.
    Right now the data guard is running fine, the logs are getting shipped from primary and the getting applied at the DG.
    And i am able to see all the redo logs got deleted.
    But not sure how the deleted redo logs got created in the ASM (i did not create them manually)
    Thanks.
    Philip.
    Edited by: user8898644 on May 5, 2010 8:52 AM
    Edited by: user8898644 on May 5, 2010 9:16 AM
    Edited by: user8898644 on May 5, 2010 11:43 AM

    Yes this happened on the standby database.
    I had to restore the archive logs because i deleted all the archive logs which got shipped from the primary.
    I did re-create the standby logs. But when i checked back the redo logs that i deleted came back again.
    I have no idea how they can back again. is it a feature of ASM where a mirrored copy of the files are stored on ASM and they re-create them when accidently dropped.
    Can you help me understand how the redologs got created again automatically.
    Right now the data guard is running fine but i do see the error
    WARNING: A file of type ARCHIVED LOG may exist in
    db_recovery_file_dest that is not known to the database.
    Use the RMAN command CATALOG RECOVERY AREA to re-catalog
    any such files. This is most likely the result of a crash
    during file creation.
    and when i do the following
    RMAN> catalog recovery area;
    i do see errors as below...
    List of files in Recovery Area not managed by the database
    ==========================================================
    File Name: +DATA/afcpdg/controlfile/controlfile01.ctl
    RMAN-07526: Reason: File is not an Oracle Managed File
    File Name: +DATA/afcpdg/onlinelog/group_1.304.718194815
    RMAN-07527: Reason: File was not created using DB_RECOVERY_FILE_DEST initialization parameter
    File Name: +DATA/afcpdg/onlinelog/group_2.372.718194833
    RMAN-07527: Reason: File was not created using DB_RECOVERY_FILE_DEST initialization parameter
    File Name: +DATA/afcpdg/datafile/system.596.715610261
    RMAN-07527: Reason: File was not created using DB_RECOVERY_FILE_DEST initialization parameter
    File Name: +DATA/afcpdg/datafile/undotbs1.571.715603525
    number of files not managed by recovery area is 82, totaling 168.10GB
    we do have the db_create_file_dest and db_recovery_file_dest pointing to the same location as +DATA
    How do i fix the above error?
    Thanks in advance.

  • How to compare two rows from two table with different data

    how to compare two rows from two table with different data
    e.g.
    Table 1
    ID   DESC
    1     aaa
    2     bbb
    3     ccc
    Table 2
    ID   DESC
    1     aaa
    2     xxx
    3     ccc
    Result
    2

    Create
    table tab1(ID
    int ,DE char(10))
    Create
    table tab2(ID
    int ,DE char(10))
    Insert
    into tab1 Values
    (1,'aaa')
    Insert
    into tab1  Values
    (2,'bbb')
    Insert
    into tab1 Values(3,'ccc')
    Insert
    into tab1 Values(4,'dfe')
    Insert
    into tab2 Values
    (1,'aaa')
    Insert
    into tab2  Values
    (2,'xx')
    Insert
    into tab2 Values(3,'ccc')
    Insert
    into tab2 Values(6,'wdr')
    SELECT 
    tab1.ID,tab2.ID
    As T2 from tab1
    FULL
    join tab2 on tab1.ID
    = tab2.ID  
    WHERE
    BINARY_CHECKSUM(tab1.ID,tab1.DE)
    <> BINARY_CHECKSUM(tab2.ID,tab2.DE)
    OR tab1.ID
    IS NULL
    OR 
    tab2.ID IS
    NULL
    ID column considered as a primary Key
    Apart from different record,Above query populate missing record in both tables.
    Result Set
    ID ID 
    2  2
    4 NULL
    NULL 6
    ganeshk

  • From one user, how to get tables names of other user.

    hi all,
    now i connected to Oracle with one user let us assume 'pavan/pavan'. and i need to get the table names that are in user: pavan and in user: gupta (gupta/gupta).
    one way is,
    from Java, first get connection to pavan user, execute the query and store the results and disconnect to it and againg connect to user 'gupta', execute the query and add these results to first results.
    but this is very expensive and time consuming also.
    is there any query to get this one. or need to create 'Database Link' and access through that link.
    regards
    pavan.

    First you have to grant permission (like SELECT,UPDATE,DELETE....etc..) to PAVAN on objects that are belongs to GUPTA. Then you can make use the GUPTA user objects.
    Suppose you connected to PAVAN and you want see the data in table A which exist in GUPTA user.
    Connect GUPTA user first and execute following statement
    GRANT SELECT,UPDATE,DELETE ON A TO PAVAN;
    After executing the above query connect to PAVAN user and execute following statement.
    SELECT * FROM GUPTA.A;

  • How to Get Resource value which are referred in code behind file using IResourceProvider

    Hi Everyone,
    Currently I'm working on moving the Resource file from "App_GlobalResources" to Database by using IResourceProvider. I created a CustomResourceProvider project using ResourceProviderFactory and able to get the resource values from DB which
    are used in aspx page.
    But i'm not able to get the values which are referring from code behind file.
    Ex: Label1.Text = Resources.Common.Car; // This is still coming from resx file.
    Can any one please let me know how to get the value from DB instead of resx file which are referred in cs file.
    Appreciate your help. 
    The below code uses the ResourceProviderFactory which calls this method and gets it from DB. Please let me know if you need any more info.
    public class DBResourceProviderFactory : ResourceProviderFactory
            public override IResourceProvider CreateGlobalResourceProvider(string classKey)
                return new DBResourceProvider(classKey);
            public override IResourceProvider CreateLocalResourceProvider(string virtualPath)
                 // we should always get a path from the runtime
                string classKey = virtualPath;
                if (!string.IsNullOrEmpty(virtualPath))
                    virtualPath = virtualPath.Remove(0, 1);
                    classKey = virtualPath.Remove(0, virtualPath.IndexOf('/') + 1);
                return new DBResourceProvider(classKey);
    Regards, Ravi Neelam.

    Hi Ravi Neelam.
    >>Currently I'm working on moving the Resource file from "App_GlobalResources" to Database by using IResourceProvider.
    Based on this message, your issue related to web application, questions related to Asp.Net should be posted in
    Asp.Net forum.
    Please reopen a new thread in that forum. You will get more efficient response.
    Regards,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to find table name which provide data for the DataSource

    Hi friends,
    How to find the Table name which providing data for the Business content DataSources (Master Data). Is there any table or Transation which give datasource and Table name at once.
    Thanks&Regards
    Revathi

    Hi Revathi...........
    1)If the datasource is extracting data from any table.................open the datasource using RSO2..........there u will get the table name......
    2) If the datasource is extracting data from any view.............go to RSA2..........copy the view name..........go to SE11 >> give the view name >> and check..........
    3) If Datasource is Function module based............then u hav to check in RSA2 >> give the datasource name >> execute >> there u will find the Extract structure name......Copy the Extract Structure name >> Go to SE11 >> in the Data Element field give the Extract structure name >> Display >> From the Entry Help/Check tab u can get the Table name............
    If u double click on the Extractor..............u will get the Function Module..............from there also u can check that the FM extracting data from which tables............
    For Other datasources also...........u can get the structure name from here........
    4) If the Datasources r LO datasources............then u can get the table name in LBWE.............LO extractor - goto transaction LBWE.................... Select the maintenance link for your datasource............
    here in the right hand pane.........in the drop down box, you can see the structures associated with this extractor ........ just remove the MC for the structure names to get the base table names. e.g. EKKO for MCEKKO.
    5) There is a pattern for the Extract structure name for LO datasources.............for an example..........
    DataSource 2LIS_11_VAITM ......Extract structure name is  MC11VA0ITM
    2LIS_11_VAHDR  >> MC11VA0HDR
    Hope this helps.........
    Regards,
    Debjani.......

  • Table /xyz/abc does not exist in the database

    Hi experienced developers,
    I created two transparent tables in customer name space in development system, transport to quality together with program using the tables, everything fine, no errors, no warnings.
    Then transported to production. No errors, no warnings. Detailed protocol shows tables have been activated, no errors or warnings.
    First try to use the program gives a dump.
    line 1191:
    ""/xyz/abc" is not defined in the ABAP Dictionary as a table, p"
    "rojection view, or database view."
    Double-click on the table in program code gives a popup information message
    Table/xyz/abc does not exist in the
    database
    After acknowleding the popup, the usual dictionary entry is shown, table is active. Utilities -> database object -> Display leads to an empty screen
    Fields of /xyz/abc  
    Fld name Position Data Type Length Decimals Not null Default
      Indexes for /xyz/abcI
    Utilities -> runtime object -> Display shows  the table name followed by message
    There is no active runtime object for ...
    prededed by big icon exclamation mark.
    We created a new transport with exactly the same result.
    Basis people have no idea.
    The only thing special (but OK I think) is that the tables have key fields only.
    Database is Oracle 11.2.0.2.0, SAP ECC 6.0
    SAP_ABA     701     0008     SAPKA70108     Cross-Application Component
    SAP_BASIS     701     0008     SAPKB70108     SAP Basis Component
    PI_BASIS     701     0008     SAPK-70108INPIBASIS     Basis Plug-In
    ST-PI     2008_1_700     0005     SAPKITLRD5     SAP Solution Tools Plug-In
    SAP_BS_FND     701     0009     SAPK-70109INSAPBSFND     SAP Business Suite Foundation
    SAP_BW     701     0008     SAPKW70108     SAP Business Warehouse
    SAP_AP     700     0022     SAPKNA7022     SAP Application Platform
    WEBCUIF     700     0009     SAPK-70009INWEBCUIF     SAP WEBCUIF 700
    Yes I know, this is a DDIC forum question but I hope for more (experienced) readers here.
    Thank you all for any hint leading to a solution.
    Best regards
    Clemens Li

    Hi,
    thank you for the comments although it does not help.
    Here is the excerpt from productive system  import protocol (original table names replaced as customer requirement)
    *** Activate objects at level 1
    Too low cost (2.100) for parallel processing. Minimum: 6.000
    * Synchronous execution, no parallel processing *
    Activate table /xyz/abcd1
    Table /xyz/abcd1 was activated successfully
    Activate table /xyz/abcd2
    Table /xyz/abcd2 was activated successfully
    Synchronous processing: 4 sec., 2 objects, 2.100 costs
          Object Activation
    End phase  001 ***********************************************************
    Start phase 002 **********************************************************
          Statistics on Activated and Deleted Objects
    Number of objects to be activated............:  2
    Objects not activated........................:  0
    Activated objects with errors in dependencies:  0
    Objects activated with warning...............:  0
    Successfully activated objects...............:  2
    Number of objects to be deleted..............:  0
    Objects not successfully deleted.............:  0
    Successfully deleted objects.................:  0
    Tables/views with DROP/CREATE................:  0
    No. of them marked for DROP/CREATE: 0
    Not marked for DROP/CREATE: 0
    Number of nametabs to be deleted.............:  0
    Successfully deleted nametabs................:  0
    Nametabs that were not successfully deleted..:  0
          Statistics on Activated and Deleted Objects
    End phase  002 ***********************************************************
    =========================================================================
    Mass Activation
    =========================================================================
    Process..................: ENNIPROD_10
    Return code..............: 0
    Phase 001..................: 00:00:04 (Object Activation)
    Phase 002..................: < 1 sec. (Statistics on Activated and ...)
    Program runtime..........: 00:00:05
    Date, time...............: 08.03.2012, 16:30:43
    Program end==============================================================
    ABAP Dictionary: Activation
    End date and time : 20120308163043
    Ended with return code:  ===> 0 <===
    Actually, I don' understand it.
    Regards,
    Clemens

  • When inserting 2 column details in a single table using Stored Procedure.Only 2 Column details getting inserted.1column details are not getting into the table.Please see the below script and help me to change.

    Line 390 Under the (Insert into SALES_TRADEIN Table)
    I need to insert (TradeIn_1_VIN) Values If there is no values in (TradeIn_1_VIN) then i have to insert (TradeIn_2_VIN) values to the (SALES_TRADEIN) Table.
    After i run then below script only (TradeIn_2_VIN) values are get inserted in the table. (TradeIn_1_VIN) are not getting loaded in to the table.
    I think there is the problem from Line No (404 to 414) Please help me change those particular lines to insert (TradeIn_1_VIN) Values also.If there is no details then (TradeIn_2_VIN) need to be inserted.
    -- =============================================
    -- Stored Procedure for Flatfile_Sales
    -- =============================================
    USE [IconicMarketing]
    ---==========Sales_Cursor
    --USE [IconicMarketing]
    --GO
    DECLARE
    @FileType
    varchar(50),
    @ACDealerID
    varchar(50),
    @ClientDealerID
    varchar(50),
    @DMSType
    varchar(50),
    @DealNumber
    varchar(50),
    @CustomerNumber
    varchar(50),
    @CustomerName
    varchar(50),
    @CustomerFirstName
    varchar(50),
    @CustomerLastName
    varchar(50),
    @CustomerAddress
    varchar(50),
    @CustomerCity
    varchar(50),
    @CustomerState
    varchar(50),
    @CustomerZip
    varchar(50),
    @CustomerCounty
    varchar(50),
    @CustomerHomePhone
    varchar(50),
    @CustomerWorkPhone
    varchar(50),
    @CustomerCellPhone
    varchar(50),
    @CustomerPagerPhone
    varchar(50),
    @CustomerEmail
    varchar(50),
    @CustomerBirthDate
    varchar(50),
    @MailBlock
    varchar(50),
    @CoBuyerName
    varchar(50),
    @CoBuyerFirstName
    varchar(50),
    @CoBuyerLastName
    varchar(50),
    @CoBuyerAddress
    varchar(50),
    @CoBuyerCity
    varchar(50),
    @CoBuyerState
    varchar(50),
    @CoBuyerZip
    varchar(50),
    @CoBuyerCounty
    varchar(50),
    @CoBuyerHomePhone
    varchar(50),
    @CoBuyerWorkPhone
    varchar(50),
    @CoBuyerBirthDate
    varchar(50),
    @Salesman_1_Number
    varchar(50),
    @Salesman_1_Name
    varchar(50),
    @Salesman_2_Number
    varchar(50),
    @Salesman_2_Name
    varchar(50),
    @ClosingManagerName
    varchar(50),
    @ClosingManagerNumber
    varchar(50),
    @F_AND_I_ManagerNumber
    varchar(50),
    @F_AND_I_ManagerName
    varchar(50),
    @SalesManagerNumber
    varchar(50),
    @SalesManagerName
    varchar(50),
    @EntryDate
    varchar(50),
    @DealBookDate
    varchar(50),
    @VehicleYear
    varchar(50),
    @VehicleMake
    varchar(50),
    @VehicleModel
    varchar(50),
    @VehicleStockNumber
    varchar(50),
    @VehicleVIN
    varchar(50),
    @VehicleExteriorColor
    varchar(50),
    @VehicleInteriorColor
    varchar(50),
    @VehicleMileage
    varchar(50),
    @VehicleType
    varchar(50),
    @InServiceDate
    varchar(50),
    @HoldBackAmount
    varchar(50),
    @DealType
    varchar(50),
    @SaleType
    varchar(50),
    @BankCode
    varchar(50),
    @BankName
    varchar(50),
    @SalesmanCommission
    varchar(50),
    @GrossProfitSale
    varchar(50),
    @FinanceReserve
    varchar(50),
    @CreditLifePremium
    varchar(50),
    @CreditLifeCommision
    varchar(50),
    @TotalInsuranceReserve
    varchar(50),
    @BalloonAmount
    varchar(50),
    @CashPrice
    varchar(50),
    @AmountFinanced
    varchar(50),
    @TotalOfPayments
    varchar(50),
    @MSRP varchar(50),
    @DownPayment
    varchar(50),
    @SecurityDesposit
    varchar(50),
    @Rebate
    varchar(50),
    @Term varchar(50),
    @RetailPayment
    varchar(50),
    @PaymentType
    varchar(50),
    @RetailFirstPayDate
    varchar(50),
    @LeaseFirstPayDate
    varchar(50),
    @DayToFirstPayment
    varchar(50),
    @LeaseAnnualMiles
    varchar(50),
    @MileageRate
    varchar(50),
    @APRRate
    varchar(50),
    @ResidualAmount
    varchar(50),
    @LicenseFee
    varchar(50),
    @RegistrationFee
    varchar(50),
    @TotalTax
    varchar(50),
    @ExtendedWarrantyName
    varchar(50),
    @ExtendedWarrantyTerm
    varchar(50),
    @ExtendedWarrantyLimitMiles
    varchar(50),
    @ExtendedWarrantyDollar
    varchar(50),
    @ExtendedWarrantyProfit
    varchar(50),
    @FrontGross
    varchar(50),
    @BackGross
    varchar(50),
    @TradeIn_1_VIN
    varchar(50),
    @TradeIn_2_VIN
    varchar(50),
    @TradeIn_1_Make
    varchar(50),
    @TradeIn_2_Make
    varchar(50),
    @TradeIn_1_Model
    varchar(50),
    @TradeIn_2_Model
    varchar(50),
    @TradeIn_1_ExteriorColor
    varchar(50),
    @TradeIn_2_ExteriorColor
    varchar(50),
    @TradeIn_1_Year
    varchar(50),
    @TradeIn_2_Year
    varchar(50),
    @TradeIn_1_Mileage
    varchar(50),
    @TradeIn_2_Mileage
    varchar(50),
    @TradeIn_1_Gross
    varchar(50),
    @TradeIn_2_Gross
    varchar(50),
    @TradeIn_1_Payoff
    varchar(50),
    @TradeIn_2_Payoff
    varchar(50),
    @TradeIn_1_ACV
    varchar(50),
    @TradeIn_2_ACV
    varchar(50),
    @Fee_1_Name
    varchar(50),
    @Fee_1_Fee
    varchar(50),
    @Fee_1_Commission
    varchar(50),
    @Fee_2_Name
    varchar(50),
    @Fee_2_Fee
    varchar(50),
    @Fee_2_Commission
    varchar(50),
    @Fee_3_Name
    varchar(50),
    @Fee_3_Fee
    varchar(50),
    @Fee_3_Commission
    varchar(50),
    @Fee_4_Name
    varchar(50),
    @Fee_4_Fee
    varchar(50),
    @Fee_4_Commission
    varchar(50),
    @Fee_5_Name
    varchar(50),
    @Fee_5_Fee
    varchar(50),
    @Fee_5_Commission
    varchar(50),
    @Fee_6_Name
    varchar(50),
    @Fee_6_Fee
    varchar(50),
    @Fee_6_Commission
    varchar(50),
    @Fee_7_Name
    varchar(50),
    @Fee_7_Fee
    varchar(50),
    @Fee_7_Commission
    varchar(50),
    @Fee_8_Name
    varchar(50),
    @Fee_8_Fee
    varchar(50),
    @Fee_8_Commission
    varchar(50),
    @Fee_9_Name
    varchar(50),
    @Fee_9_Fee
    varchar(50),
    @Fee_9_Commission
    varchar(50),
    @Fee_10_Name
    varchar(50),
    @Fee_10_Fee
    varchar(50),
    @Fee_10_Commission
    varchar(50),
    @ContractDate
    varchar(50),
    @InsuranceName
    varchar(50),
    @InsuranceAgentName
    varchar(50),
    @InsuranceAddress
    varchar(50),
    @InsuranceCity
    varchar(50),
    @InsuranceState
    varchar(50),
    @InsuranceZip
    varchar(50),
    @InsurancePhone
    varchar(50),
    @InsurancePolicyNumber
    varchar(50),
    @InsuranceEffectiveDate
    varchar(50),
    @InsuranceExpirationDate
    varchar(50),
    @InsuranceCompensationDeduction
    varchar(50),
    @TradeIn_1_InteriorColor
    varchar(50),
    @TradeIn_2_InteriorColor
    varchar(50),
    @PhoneBlock
    varchar(50),
    @LicensePlateNumber
    varchar(50),
    @Cost varchar(50),
    @InvoiceAmount
    varchar(50),
    @FinanceCharge
    varchar(50),
    @TotalPickupPayment
    varchar(50),
    @TotalAccessories
    varchar(50),
    @TotalDriveOffAmount
    varchar(50),
    @EmailBlock
    varchar(50),
    @ModelDescriptionOfCarSold
    varchar(50),
    @VehicleClassification
    varchar(50),
    @ModelNumberOfCarSold
    varchar(50),
    @GAPPremium
    varchar(50),
    @LastInstallmentDate
    varchar(50),
    @CashDeposit
    varchar(50),
    @AHPremium
    varchar(50),
    @LeaseRate
    varchar(50),
    @DealerSelect
    varchar(50),
    @LeasePayment
    varchar(50),
    @LeaseNetCapCost
    varchar(50),
    @LeaseTotalCapReduction
    varchar(50),
    @DealStatus
    varchar(50),
    @CustomerSuffix
    varchar(50),
    @CustomerSalutation
    varchar(50),
    @CustomerAddress2
    varchar(50),
    @CustomerMiddleName
    varchar(50),
    @GlobalOptOut
    varchar(50),
    @LeaseTerm
    varchar(50),
    @ExtendedWarrantyFlag
    varchar(50),
    @Salesman_3_Number
    varchar(50),
    @Salesman_3_Name
    varchar(50),
    @Salesman_4_Number
    varchar(50),
    @Salesman_4_Name
    varchar(50),
    @Salesman_5_Number
    varchar(50),
    @Salesman_5_Name
    varchar(50),
    @Salesman_6_Number
    varchar(50),
    @Salesman_6_Name
    varchar(50),
    @APRRate2
    varchar(50),
    @APRRate3
    varchar(50),
    @APRRate4
    varchar(50),
    @Term2
    varchar(50),
    @SecurityDeposit2
    varchar(50),
    @DownPayment2
    varchar(50),
    @TotalOfPayments2
    varchar(50),
    @BasePayment
    varchar(50),
    @JournalSaleAmount
    varchar(50),
    @IndividualBusinessFlag
    varchar(50),
    @InventoryDate
    varchar(50),
    @StatusDate
    varchar(50),
    @ListPrice
    varchar(50),
    @NetTradeAmount
    varchar(50),
    @TrimLevel
    varchar(50),
    @SubTrimLevel
    varchar(50),
    @BodyDescription
    varchar(50),
    @BodyDoorCount
    varchar(50),
    @TransmissionDesc
    varchar(50),
    @EngineDesc
    varchar(50),
    @TypeCode
    varchar(50),
    @SLCT2
    varchar(50),
    @DealDateOffset
    varchar(50),
    @AccountingDate
    varchar(50),
    @CoBuyerCustNum
    varchar(50),
    @CoBuyerCell
    varchar(50),
    @CoBuyerEmail
    varchar(50),
    @CoBuyerSalutation
    varchar(50),
    @CoBuyerPhoneBlock
    varchar(50),
    @CoBuyerMailBlock
    varchar(50),
    @CoBuyerEmailBlock
    varchar(50),
    @RealBookDate
    varchar(50),
    @CoBuyerMiddleName
    varchar(50),
    @CoBuyerCountry
    varchar(50),
    @CoBuyerAddress2
    varchar(50),
    @CoBuyerOptOut
    varchar(50),
    @CoBuyerOccupation
    varchar(50),
    @CoBuyerEmployer
    varchar(50),
    @Country
    varchar(50),
    @Occupation
    varchar(50),
    @Employer
    varchar(50),
    @Salesman2Commission
    varchar(50),
    @BankAddress
    varchar(50),
    @BankCity
    varchar(50),
    @BankState
    varchar(50),
    @BankZip
    varchar(50),
    @LeaseEstimatedMiles
    varchar(50),
    @AFTReserve
    varchar(50),
    @CreditLifePrem
    varchar(50),
    @CreditLifeRes
    varchar(50),
    @AHRes
    varchar(50),
    @Language
    varchar(50),
    @BuyRate
    varchar(50),
    @DMVAmount
    varchar(50),
    @Weight
    varchar(50),
    @StateDMVTotFee
    varchar(50),
    @ROSNumber
    varchar(50),
    @Incentives
    varchar(50),
    @CASS_STD_LINE1
    varchar(50),
    @CASS_STD_LINE2
    varchar(50),
    @CASS_STD_CITY
    varchar(50),
    @CASS_STD_STATE
    varchar(50),
    @CASS_STD_ZIP
    varchar(50),
    @CASS_STD_ZIP4
    varchar(50),
    @CASS_STD_DPBC
    varchar(50),
    @CASS_STD_CHKDGT
    varchar(50),
    @CASS_STD_CART
    varchar(50),
    @CASS_STD_LOT
    varchar(50),
    @CASS_STD_LOTORD
    varchar(50),
    @CASS_STD_URB
    varchar(50),
    @CASS_STD_FIPS
    varchar(50),
    @CASS_STD_EWS
    varchar(50),
    @CASS_STD_LACS
    varchar(50),
    @CASS_STD_ZIPMOV
    varchar(50),
    @CASS_STD_Z4LOM
    varchar(50),
    @CASS_STD_NDIAPT
    varchar(50),
    @CASS_STD_NDIRR
    varchar(50),
    @CASS_STD_LACSRT
    varchar(50),
    @CASS_STD_ERROR_CD
    varchar(50),
    @NCOA_AC_ID
    varchar(50),
    @NCOA_COA_ADDSRC
    varchar(50),
    @NCOA_COA_MATCH
    varchar(50),
    @NCOA_COA_MOVTYP
    varchar(50),
    @NCOA_COA_DATE
    varchar(50),
    @NCOA_COA_DELCD
    varchar(50),
    @NCOA_COA_RTYPE
    varchar(50),
    @NCOA_COA_RTNCD
    varchar(50),
    @NCOA_COA_LINE1
    varchar(50),
    @NCOA_COA_LINE2
    varchar(50),
    @NCOA_COA_CITY
    varchar(50),
    @NCOA_COA_STATE
    varchar(50),
    @NCOA_COA_ZIP
    varchar(50),
    @NCOA_COA_ZIP4
    varchar(50),
    @NCOA_COA_DPBC
    varchar(50),
    @NCOA_COA_CHKDGT
    varchar(50),
    @NCOA_COA_CART
    varchar(50),
    @NCOA_COA_LOT
    varchar(50),
    @NCOA_COA_LOTORD
    varchar(50),
    @NCOA_COA_URB
    varchar(50),
    @NCOA_COA_Z4LOM
    varchar(50),
    @NCOA_COA_ACTION
    varchar(50),
    @NCOA_COA_QNAME
    varchar(50),
    @NCOA_DPV_AA
    varchar(50),
    @NCOA_DPV_A1
    varchar(50),
    @NCOA_DPV_BB
    varchar(50),
    @NCOA_DPV_CC
    varchar(50),
    @NCOA_DPV_M1
    varchar(50),
    @NCOA_DPV_M3
    varchar(50),
    @NCOA_DPV_N1
    varchar(50),
    @NCOA_DPV_P1
    varchar(50),
    @NCOA_DPV_P3
    varchar(50),
    @NCOA_DPV_RR
    varchar(50),
    @NCOA_DPV_R1
    varchar(50),
    @NCOA_DPV_STATUS
    varchar(50),
    @NCOA_DPV_F1
    varchar(50),
    @NCOA_DPV_G1
    varchar(50),
    @NCOA_DPV_U1
    varchar(50),
    @myerror
    varchar(500),
    @SalesID
    int,
    @errornumber int,
                @errorseverity varchar(500),
                @errorstate int,
                @errorprocedure varchar(500),
                @errorline varchar(50),
                @errormessage varchar(1000);
    DECLARE Sales_Cursor CURSOR FOR 
    SELECT * from FLATFILE_SALES;
    OPEN Sales_Cursor;
     :r C:\Clients\BlackBook\BlackBookMarketing\Bharath\LOG_SALES_INSERT.sql
    WHILE @@FETCH_STATUS = 0
    BEGIN
    PRINT @VehicleVIN    ;
    --===============================================================================
    -- ****************** insert into Sales Table ***********
    BEGIN TRY
        INSERT INTO Sales 
    IconicDealerID,
    DealNumber,
    CustomerNumber,
    DMSType,
    ContractDate
    VALUES (@ClientDealerID,@DealNumber,@CustomerNumber,@DMSType,@ContractDate);
    END TRY
    BEGIN CATCH
         SELECT
            @errornumber = ERROR_NUMBER()
            ,@errorseverity = ERROR_SEVERITY() 
            ,@errorstate = ERROR_STATE() 
            ,@errorprocedure = ERROR_PROCEDURE() 
            ,@errorline = ERROR_LINE()
            ,@errormessage = ERROR_MESSAGE();
           :r C:\Clients\BlackBook\BlackBookMarketing\Bharath\LOG_SALES_INSERT.sql
    @errornumber ,
                @errorseverity ,
                @errorstate,
                @errorprocedure,
                @errorline,
                @errormessage);
    END CATCH
    PRINT @errornumber;
    PRINT @errorseverity;
    PRINT @errorprocedure;
    PRINT @errorline;
    PRINT @errormessage;
    PRINT @errorstate;
    set @myerror = @@ERROR;
        -- This PRINT statement prints 'Error = 0' because
        -- @@ERROR is reset in the IF statement above.
        PRINT N'Error = ' + @myerror;
    set @SalesID = scope_identity();
    PRINT @SalesID;
    --================================================================================
    --Insert into SALES_TRADEIN Table
    BEGIN TRY
    INSERT INTO SALES_TRADEIN
    SalesID,
    TradeIn_VIN,
    TradeIn_Make,
    TradeIn_Model,
    TradeIn_ExteriorColor,
    TradeIn_Year,
    TradeIn_Mileage,
    TradeIn_Gross,
    TradeIn_Payoff,
    TradeIn_ACV,
    TradeIn_InteriorColor
    VALUES
    @SalesID,
    case when  @TradeIn_1_VIN is not null then @TradeIn_2_VIN end,
    case when  @TradeIn_1_Make is not null  then @TradeIn_2_Make end,
    case when  @TradeIn_1_Model is not null  then @TradeIn_2_Model end,
    case when  @TradeIn_1_ExteriorColor is not null  then @TradeIn_2_ExteriorColor end,
    case when @TradeIn_1_Year is not null  then @TradeIn_2_Year end,
    case when  @TradeIn_1_Mileage is not null  then @TradeIn_2_Mileage end,
    case when @TradeIn_1_Gross is not null  then @TradeIn_2_Gross end,
    case when @TradeIn_1_Payoff is not null  then @TradeIn_2_Payoff end,
    case when @TradeIn_1_ACV is not null  then @TradeIn_2_ACV end,
    case when  @TradeIn_1_InteriorColor is not null  then @TradeIn_2_InteriorColor end
    END TRY
    BEGIN CATCH
    SELECT
            @errornumber = ERROR_NUMBER()
            ,@errorseverity = ERROR_SEVERITY() 
            ,@errorstate = ERROR_STATE() 
            ,@errorprocedure = ERROR_PROCEDURE() 
            ,@errorline = ERROR_LINE()
            ,@errormessage = ERROR_MESSAGE();
          :r C:\Clients\BlackBook\BlackBookMarketing\Bharath\LOG_SALES_INSERT.sql
    END CATCH

    This is what I've understood from your question. You want to replace @TradeIn_2_VIN value if @TradeIn_1_VIN
    is NULL, else the value of @TradeIn_1_VIN.
    If this is the requirement then, your CASE statement is missing ELSE part. You can re-write this as below
    case when  @TradeIn_1_VIN is null then @TradeIn_2_VIN
    ELSE @TradeIn_1_VIN end,
    or simply you can replace the CASE statement with the below
    COALESCE function,
    COALESCE(@TradeIn_1_VIN, @TradeIn_2_VIN),
    Krishnakumar S

  • I'm in India and use Indian iTune store. But there are certain books which are not avaiable in Indian store but are there in US store. How can i get those books?

    I'm in India and use Indian iTune store. But there are certain books which are not avaiable in Indian store but are there in US store. How can i get those books?

    Hi Jai Shree Hari,
    Yeah, I don't see why you shouldn't be able to sign your friend's iTunes sign-on into iTunes, and then use that to download the books. You may need to also authorize your computer in iTunes with that ID in order to be able to re-download them to your device if you ever need to (not sure if this is absolutely required since most things live in the cloud now, but better to be safe than sorry.... ).
    Best of luck!
    Cheers,
    GB

  • What is Best Way to Get Table Name in Oracle Applications : 12.1.1 (web)

    Hello Friends..
    I need your Help My Friends...
    we are working currently on Oracle Applications : 12.1.1
    i would like to know the best way to get Table name from Web Based Form..
    Regards
    Yas.

    Hi Yas;
    Please follow below 2 thread i belive you will find some hint in those thread
    table name for a jdeveloper page
    Re: EBS, 11.5.10, table name
    Hope it helps
    Regard
    Helios

  • HT201272 I am using Apple ipod 2nd gen with IOS 4.2.1 . No i recently updated my IOS and all my apps were deleted. Now when i download IBOOKS it needs IOS 5. How do i get the apps which are copatible with IOS 4.2.1 or IPOS 2nd GEN??

    I am using Apple ipod 2nd gen with IOS 4.2.1 . No i recently updated my IOS and all my apps were deleted. Now when i download IBOOKS it needs IOS 5. How do i get the apps which are copatible with IOS 4.2.1 or IPOS 2nd GEN??

    You should always have your apps on your computer.  If you have failed to keep a copy of the old app versions, then you cannot get them back at all.
    Sorry.
    Many app makers no longer support the old ios and ipod models

  • How to delete images from folder which are not in the database

    I am created windows form
    i wont to delete images from the folder where i have stored images but i only want to delete those images which are not in the data base.
    i don't know how it is possible . i have written some code
    private void button1_Click(object sender, EventArgs e)
    string connectionString = "Data Source";
    conn = new SqlConnection(connectionString);
    DataTable dt = new DataTable();
    cmd.Connection = conn;
    cmd.CommandText = "select * from tbl_pro";
    conn.Open();
    SqlDataAdapter da = new SqlDataAdapter(cmd);
    da.Fill(dt);
    int count = Convert.ToInt32( dt.Rows.Count);
    string[] image1 = new string[count];
    for (int i = 0; i < count; i++)
    image1[i] = dt.Rows[i]["Image1"].ToString();
    string[] image2 = new string[count];
    for (int i = 0; i < count; i++)
    image2[i] = dt.Rows[i]["Image2"].ToString();
    var arr = image1.Union(image2).ToArray();
    string[] arrays;
    String dirPath = "G:\\Proj\\";
    arrays = Directory.GetFiles(dirPath, "*", SearchOption.AllDirectories).Select(x => Path.GetFileName(x)).ToArray();
    int b= arrays.Count();
    for (int j = 1; j <= b; j++)
    if (arrays[j].ToString() != arr[j].ToString())
    var del = arrays[j].ToString();
    else
    foreach (var value in del) // ERROR DEL IS NOT IN THE CURRENT CONTEXT
    string filePath = "G:\\Projects\\Images\\"+value;
    File.Delete(filePath);
    here error coming "DEL IS NOT IN THE CURRENT CONTEXT"
    I have to change anything .Will It work alright?
    pls help me
    Sms

    Hi Fresherss,
    Your del is Local Variable, it can't be accessed out of the if statement. you need to declare it as global variable like below. And if you want to collect the string, you could use the List to collect, not a string.  the string will be split to chars
    one by one.
    List<string> del=new List<string>();
    for (int j = 1; j <= b; j++)
    if (arrays[j].ToString() != arr[j].ToString())
    del.Add(arrays[j].ToString());
    else
    foreach (var value in del)
    string filePath = "G:\\Projects\\Images\\" + value;
    File.Delete(filePath);
    If you have any other concern regarding this issue, please feel free to let me know.
    Best regards,
    Youjun Tang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for