Quantcast
Channel: SQL Server Integration Services forum
Viewing all 24688 articles
Browse latest View live

Importing data from an Open Source CRM to a SQL Database

$
0
0

I would like to import data from a CRM system to SSMS so that I can use for data correction and reporting.

I could import this data via CSV but a better option would be to have the data import daily in an automated way.

I have full editing rights on the CRM but I do not have access to the backend, hence my request.

The database would be used to access the data via T-SQL but not used to make changes to the base data.

Is this possible and what is the best way to do this?

I currently use SQL 2016 Express.


Error: Exception has been thrown by the target of an invocation.

$
0
0

Hello,
I hope you are well..
I really need your help to help me resolve an issue.

I created an SSIS package (SSIS 2012) which processes a tabular model in Azure AS.
To do this I created a task script (C # 2010) and I had to add 2 references Microsoft.AnalysisService.Core and Microsoft.AnalysisService.Tabular.
The package runs fine when I run it locally.

However when I deploy it on the SSIS server and run it I get this error: "Error: Exception has been thrown by the target of an invocation.".

Do you know where this error could come from?
How can I resolve this error?

Thanks for your help


Moving ssis packages from MSDB to SSISDB Catalog.

$
0
0
I have some ssis packages in MSDB. Now I want to move this ssis packages into SSISDB Catalog. What should I do? 

Problem with migration to new server

$
0
0

My Company has a old SSIS Package Solution (2005)  and we need transfer this on a new (SQL SERVER 2016 SP2).

I can open that project with Visual Studio 2017 I can make oneway-Upgrade and then I can convert that from package deployment model to Project Deployment Model (with than process I lost data source connections)  

After that i create a new catalog on Sql Integration Folder (Sql Data Engine). But when I try Import Packages that give me

ssis-deployment-error-6522  


SSIS Job Fails with unexpected termination on Execute of Data Flow Task

$
0
0

Hi there,

I've looked all over the community and none of the possible solutions fixed my problems. Can someone help me look into it?

In the SSIS job history the error message is not helpful. The error message is just unexpected termination. In the event viewer I see that it is categorized as a windows error reporting. There are mdmp files attached to the error, but I'm not able to open it and I'm afraid that even if I do, I won't be able to debug it.

I know that mdmp file is more for windows support, is there anywhere I can send my mdmp files related to my error so that I can find out the root cause of my error and fix it. 

The ssis job succeeds 20% of the time, but 80% of the time it would fail. Not sure why.

Thanks,

Ron

SSIS Package is working fine in SSDT but givign error in SQL Agent JOB

$
0
0

 I am getting below error using SSIS package created in SSDT 2019 and SQL server 2019 in  SSMS v18.4. 

its working fine when i am running from SSDT and only giving error by SQL agent job. I am not passing any parameter. its simple package is with just one script task. i don't think its issue with script task because i also checked   with execute process task in ssis with simple different package and that is also giving the same error.

is there any help? Thanks in advance....

Description: Cannot create a task from XML for task "Script Task", type "Microsoft.ScriptTask" due to error 0x80070057 "The parameter is incorrect.".  End Error  Error: 2019-12-23 00:29:35.22    Code: 0xC0010018     Source: Script Task      Description: Failed to load task "Script Task", type "". The contact information for this task is "".  End Error  Error: 2019-12-23 00:29:35.22     Code: 0xC0010026     Source: Script Task      Description: The task has failed to load. The contact information for this task is "".  End Error  Error: 2019-12-23 00:29:35.22    Code: 0xC0024107     Source: Script Task      Description: There were errors during task validation.  End Error  Error: 2019-12-23 00:29:35.22     Code: 0xC0010025     Source: Package2      Description: The package cannot execute because it contains tasks that failed to load.  End Error  DTExec: The package execution returned DTSER_FAILURE (1).  Started:  12:29:35 AM  Finished: 12:29:35 AM  Elapsed:  0.094 seconds.  The package execution failed.  The step failed.

SSIS task failed to load(Script task)

$
0
0

Hi,

I am running a SSIS package using a bat file. When I run the bat file it gives the error ,'The task has failed to load.The contact information for the task is " " '. Can you let me know how to resolve this?

I am running this on Sql server 2008 . I have seen previous posts with same error saying, the problem is with the installation of SQL Server .What components should I install additionally or what are the components that did not install correctly?

Thanks

SSMS 2016 will not Connect to Integration Services on SQL Server 2016

$
0
0

We have a SQL Server 2016 server with Integration Services 13.0 running on it.  We are not using Integration Services Catalog.  On my workstation, in SSMS 2016 (16.5.3), when I attempt to connect to Integration Services on the server, I get Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc)

TITLE: Connect to Server
------------------------------
Cannot connect to -------.
------------------------------
ADDITIONAL INFORMATION:

Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&LinkId=20476
------------------------------

Connecting to the Integration Services service on the computer "---" failed with the following error: "The specified service does not exist as an installed service.".

This error can occur when you try to connect to a SQL Server 2005 Integration Services service from the current version of the SQL Server tools. Instead, add folders to the service configuration file to let the local Integration Services service manage packages on the SQL Server 2005 instance.
For help, click: http://go.microsoft.com/fwlink/?LinkId=506689
------------------------------
Connecting to the Integration Services service on the computer "---" failed with the following error: "The specified service does not exist as an installed service.".

This error can occur when you try to connect to a SQL Server 2005 Integration Services service from the current version of the SQL Server tools. Instead, add folders to the service configuration file to let the local Integration Services service manage packages on the SQL Server 2005 instance.

------------------------------

I cannot find any reason for SSMS 2016 to not be able to connect to Integration Services on a 2016 Sql Server server.

I have reinstalled SSMS 2016 and installed on a machine with a clean image applied and still receive the error.

These are the SSMS versions, in Help/:

Microsoft SQL Server Management Studio13.0.16106.4
Microsoft Analysis Services Client Tools13.0.1700.441
Microsoft Data Access Components (MDAC)10.0.18362.1
Microsoft MSXML3.0 6.0 
Microsoft Internet Explorer9.11.18362.0
Microsoft .NET Framework4.0.30319.42000
Operating System6.3.18363

Where else can I look to find the reason for this error?


Don't see SSIS and SSRS projects templates in VS 2019 anymore

$
0
0

Hi,

I have VS 2019 installed and I believe I was able to create new SSIS projects locally. Now I don't see the templates when I try to create these projects. 

What am I missing?

Thanks in advance.


For every expert, there is an equal and opposite expert. - Becker's Law


My blog


My TechNet articles

Execute Process Task: Batch file don't work through SQL Server Agent job

$
0
0

Hi,

I created a batch file to create copy of SQL database backup file.

@ECHO OFF

set year=%date:~10,4%
set month=%date:~4,2%
set day=%date:~7,2%
REM set filename=%year%_%month%_%day%
REM echo %filename%

echo F|xcopy /Y "\\Backup\Backup_%year%_%month%_%day%_*.bak" "\\Backup\Backup.bak"

Execute Process Task works fine when I execute it from package. Fails after deploying and running job, do not create copy of the backup file.

Regards

 

How can I get a filename path, but only the name after the last slash "\"

$
0
0

Hi I have a filename path:

\\obrg\\Input Files\EasyTax\7020740348 DirectiveRecon 20121231.rpt

I only only want 7020740348 DirectiveRecon 20121231.rpt.

how do I write an expression in the derived column that will get me the last part of the path?

GUID gives Invalid character value for cast specification in Data Flow

$
0
0

Good day,

I hope you are doing well in these strange times, jumping right into the issue:

I have created a Data Flow Task with two tasks in it. The first collects data based on a GUID, an OLE DB Source Task, and the other inserts this data in some other table.

When trying to collect the data the following error is fired:

Error: 0xC0202009 at Insert Doc Log Data, Get Doc Data [2]: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E21.
An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 11.0"  Hresult: 0x80040E21  Description: "Invalid character value for cast specification".

The Data Source Task runs the following SQL Command:

SELECT        DocID, XML, FileHash, CompCode, CompName, VesselName, VesselID, ComponentID, CreatedOn
FROM            SLEP_XML_MP_PROD
WHERE        (DocID = CAST(? as uniqueidentifier))

Where the input on the question mark, ?, is given by the following: 

Name Value Type
User::CurDocID {ADE3B511-0A3E-4DCD-AAF0-306FA38DB0FB} String


In SQL Server itself it has no problem running the following, with or without the curly braces { and }:

SELECT        DocID, XML, FileHash, CompCode, CompName, VesselName, VesselID, ComponentID, CreatedOn
FROM            SLEP_XML_MP_PROD
WHERE        (DocID = CAST('ADE3B511-0A3E-4DCD-AAF0-306FA38DB0FB' as uniqueidentifier))

Normally outside a Data Flow I can specify the input data type, but inside I can't.

Is there someway without to much of a work around to fix this, e.g. I would like to refrain from using a variable to run the command as I find this quite cumbersome.

Thank you for your time and comments!

Connection Manager trust relationship SSL/TLS secure channel

$
0
0

I have created an SSIS package that emails SSRS reports to an email distribution group.  In the package, I run the reports and save the pdf or excel files to an Azure storage account.  Then I attach the files to the email and send it out.  This was working until I switched the Report server to an Azure SQL Server.  Now I am getting this error message when I try to change the ReportServer connection manager to the new server:

TITLE: Microsoft Visual Studio
------------------------------
The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
------------------------------
BUTTONS:

OK
------------------------------

I can connect to the new Report Server in IE.  Why doesn't Visual Studio allow me to connect to it?  In the connection manager, I do not see any options to turn on or off the SSL/TLS security.

Fred


Fred

Removing LineFeed within the same column prior to loading in DB from Salesforce

$
0
0

Hello,

I am trying to load data from salesforce into the SQL server database and/or flat files (csv). There is unfortunately a single object (Task) that is messing up the process. Within that object there is a text field (nvarchar(255)) that the users have entered data in two lines byt hitting "shift+enter". The standard CrLF is the row identifier. Now when i export the data, that text field is causing and error in the flat file as the system gets confused between line feeds.

Please advise on how to remove the line feeds in this specific column before i load it into destination (table /csv). The source component is a Salesforce Source connector. 

Thank you.

Edit: There is a need to create a sql file and then i have to manually insert them into another database. When i open the sql file (i get the pop up  "The line endings in the following file are not consistent. Do you want to normalize the line endings? Line ending Windows (CR LF)". I click on Yes and it works, but how to fix the data early on so i dont get this error. 

Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.The wait operation timed out

$
0
0

Hi,

 I am trying to split data from a table which has 120 million rows into multiple .txt files with 1 million records in each file.

I am using script task in SSIS to achieve the same but after executing the package, it is creating around 8 txt files and then failing with below error.

"SqlException (0x80131904): Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out"

Below is the code from the scrip task :

#region Help:  Introduction to the script task
/* The Script Task allows you to perform virtually any operation that can be accomplished in
 * a .Net application within the context of an Integration Services control flow. 
 * 
 * Expand the other regions which have "Help" prefixes for examples of specific ways to use
 * Integration Services features within this script task. */
#endregion


#region Namespaces
using System;
using System.Data;
using Microsoft.SqlServer.Dts.Runtime;
using System.Windows.Forms;
using System.IO;
using System.Data.SqlClient;
#endregion

namespace ST_056616145e7743499d097317fe432711
{
    /// <summary>
    /// ScriptMain is the entry point class of the script.  Do not change the name, attributes,
    /// or parent of this class.
    /// </summary>
[Microsoft.SqlServer.Dts.Tasks.ScriptTask.SSISScriptTaskEntryPointAttribute]
    public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
    {
        #region Help:  Using Integration Services variables and parameters in a script
        /* To use a variable in this script, first ensure that the variable has been added to 
         * either the list contained in the ReadOnlyVariables property or the list contained in 
         * the ReadWriteVariables property of this script task, according to whether or not your
         * code needs to write to the variable.  To add the variable, save this script, close this instance of
         * Visual Studio, and update the ReadOnlyVariables and 
         * ReadWriteVariables properties in the Script Transformation Editor window.
         * To use a parameter in this script, follow the same steps. Parameters are always read-only.
         * 
         * Example of reading from a variable:
         *  DateTime startTime = (DateTime) Dts.Variables["System::StartTime"].Value;
         * 
         * Example of writing to a variable:
         *  Dts.Variables["User::myStringVariable"].Value = "new value";
         * 
         * Example of reading from a package parameter:
         *  int batchId = (int) Dts.Variables["$Package::batchId"].Value;
         *  
         * Example of reading from a project parameter:
         *  int batchId = (int) Dts.Variables["$Project::batchId"].Value;
         * 
         * Example of reading from a sensitive project parameter:
         *  int batchId = (int) Dts.Variables["$Project::batchId"].GetSensitiveValue();
         * */

        #endregion

        #region Help:  Firing Integration Services events from a script
        /* This script task can fire events for logging purposes.
         * 
         * Example of firing an error event:
         *  Dts.Events.FireError(18, "Process Values", "Bad value", "", 0);
         * 
         * Example of firing an information event:
         *  Dts.Events.FireInformation(3, "Process Values", "Processing has started", "", 0, ref fireAgain)
         * 
         * Example of firing a warning event:
         *  Dts.Events.FireWarning(14, "Process Values", "No values received for input", "", 0);
         * */
        #endregion

        #region Help:  Using Integration Services connection managers in a script
        /* Some types of connection managers can be used in this script task.  See the topic 
         * "Working with Connection Managers Programatically" for details.
         * 
         * Example of using an ADO.Net connection manager:
         *  object rawConnection = Dts.Connections["Sales DB"].AcquireConnection(Dts.Transaction);
         *  SqlConnection myADONETConnection = (SqlConnection)rawConnection;
         *  //Use the connection in some code here, then release the connection
         *  Dts.Connections["Sales DB"].ReleaseConnection(rawConnection);
         *
         * Example of using a File connection manager
         *  object rawConnection = Dts.Connections["Prices.zip"].AcquireConnection(Dts.Transaction);
         *  string filePath = (string)rawConnection;
         *  //Use the connection in some code here, then release the connection
         *  Dts.Connections["Prices.zip"].ReleaseConnection(rawConnection);
         * */
        #endregion


        /// <summary>
        /// This method is called when this script task executes in the control flow.
        /// Before returning from this method, set the value of Dts.TaskResult to indicate success or failure.
        /// To open Help, press F1.
        /// </summary>
        public void Main()
        {
            // TODO: Add your code here

            string datetime = DateTime.Now.ToString("yyyyMMddHHmmss");
            try
            {

                //Declare Variables
                string FileNamePart = Dts.Variables["User::FileNamePart"].Value.ToString();
                string DestinationFolder = Dts.Variables["User::DestinationFolder"].Value.ToString();
                string TableName = Dts.Variables["User::TableName"].Value.ToString();
                string FileDelimiter = Dts.Variables["User::FileDelimiter"].Value.ToString();
                string FileExtension = Dts.Variables["User::FileExtension"].Value.ToString();
                Int32 RecordCntPerFile = (Int32)Dts.Variables["User::RecordsPerFile"].Value;
                string RecordCntPerFileDecimal = RecordCntPerFile + ".0";


                //USE ADO.NET Connection from SSIS Package to get data from table
                SqlConnection myADONETConnection = new SqlConnection();
                myADONETConnection = (SqlConnection)(Dts.Connections["DBConn"].AcquireConnection(Dts.Transaction) as SqlConnection);


                //Read distinct Group Values for each Excel Sheet
                string query = "select ceiling(count(*)/" + RecordCntPerFileDecimal + ") AS LoopCnt from " + TableName+ " (nolock)";
                decimal LoopCnt = 0;

                //Get the Count of Sheets need to be created
                SqlCommand cmd = myADONETConnection.CreateCommand();
                cmd.CommandText = query;
                cmd.CommandTimeout = 7200;
                LoopCnt = (decimal)cmd.ExecuteScalar();
                

                int startRowCnt = 0;
                int endRowCnt = RecordCntPerFile;

                for (int fileloop = 1; fileloop <= LoopCnt; fileloop++)
                {


                    //Load Data into DataTable from SQL ServerTable
                    string queryString = ";with cte as (Select *, Row_Number() over (order by (Select 1)) AS RowNumber from " +
                    TableName + ") Select * From cte where RowNumber > " + startRowCnt.ToString() + " and RowNumber<=" + endRowCnt.ToString();
                    SqlDataAdapter adapter = new SqlDataAdapter(queryString, myADONETConnection);
                    DataSet ds = new DataSet();
                    adapter.Fill(ds);

                    foreach (DataTable d_table in ds.Tables)
                    {
                        string FileFullPath = DestinationFolder + "\\" + FileNamePart + "_" + fileloop.ToString() + FileExtension;

                        StreamWriter sw = null;
                        sw = new StreamWriter(FileFullPath, false);

                        // Write the Header Row to File
                        int ColumnCount = d_table.Columns.Count;
                        for (int ic = 0; ic < ColumnCount; ic++)
                        {
                            sw.Write(d_table.Columns[ic]);
                            if (ic < ColumnCount - 1)
                            {
                                sw.Write(FileDelimiter);
                            }
                        }
                        sw.Write(sw.NewLine);

                        // Write All Rows to the File
                        foreach (DataRow dr in d_table.Rows)
                        {
                            for (int ir = 0; ir < ColumnCount; ir++)
                            {
                                if (!Convert.IsDBNull(dr[ir]))
                                {
                                    sw.Write(dr[ir].ToString());
                                }
                                if (ir < ColumnCount - 1)
                                {
                                    sw.Write(FileDelimiter);
                                }
                            }
                            sw.Write(sw.NewLine);

                        }

                        sw.Close();

                    }
                    startRowCnt += RecordCntPerFile;
                    endRowCnt += RecordCntPerFile;
                    Dts.TaskResult = (int)ScriptResults.Success;
                }

            }

            catch (Exception exception)
            {

                // Create Log File for Errors
                using (StreamWriter sw = File.CreateText(Dts.Variables["User::LogFolder"].Value.ToString() + "\\" +
                    "ErrorLog_" + datetime + ".log"))
                {
                    sw.WriteLine(exception.ToString());
                    Dts.TaskResult = (int)ScriptResults.Failure;


                }
            }
        }

        #region ScriptResults declaration
        /// <summary>
        /// This enum provides a convenient shorthand within the scope of this class for setting the
        /// result of the script.
        /// 
        /// This code was generated automatically.
        /// </summary>
        enum ScriptResults
        {
            Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
            Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
        };
        #endregion

    }
}



harshac


The connection "Connection" cannot be found. Verify that the connection manager has a connection with that name.

$
0
0

Hi, 

I am getting data of sharepoint online with ssis and odata. If I use Visual Studio the package work howerver I get a error when I deploying the package.  the configuration is the next:

Auth Type=4

target server version 140

url: https://blablabla.sharepoint.com/sites/_vti_bin/listdata.svc

user: usuario@dominio.com

The connection string is the next:

Service Document Url=https://***.sharepoint.com/sites/SISED/_vti_bin/listdata.svc;Include Atom Elements=Auto;Include Expanded Entities=False;Integrated Security=False;Cookie="SPOIDCRL=77u/PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48U1A+VjQsMGguZnxtZW1iZXJzaGlwfDEwMDMwMDAwYTMxZWFmMzdAbGl2ZS5jb20sMCMuZnxtZW1iZXJzaGlwfHNvcG9ydGV0aUBpbnNzZXJ2aWNpb3MuY29tLDEzMTc0NjkyNTU4MDAwMDAwMCwxMzE2NzE2NTE3MzAwMDAwMDAsMTMxNzUxMjQ1NTgyODY2NzY3LDAuMC4wLjAsNCw3YTI2ZjMyNC1mM2FlLTRkNDYtOWMwNy1hMzBjMmYyNTEzNzMsLCw1MmE1NzU5ZS0wMDU5LTYwMDAtMzExOS04NDc0YjcxMjc3NGEsNTJhNTc1OWUtMDA1OS02MDAwLTMxMTktODQ3NGI3MTI3NzRhLCwwLDAsMCx1MjNjMTRKQ1hhSHcxRUtPcXhzdUFySUVuVHJSRStpaUM3dm1ZYjNZQUVrUXJCVjJES3h5MFRzeTdKMWd2M05iNW80UERzNHpLZURFTGIzQXcyZVFOcjlhYUQrYVNoaC9PSmJSMkgwTE5SbEpSL2IwNmpEN2VGUCtwV0NWdml4SHdtZWxrL0gvOWVvNmdVZkRZSWhVUmp0SVhxb2MvR1BWS1k1TEoyT052M2FjTW9FTU5tYWxtRVBTdG9hTk51TmlveDBiV2w1eG81UTFaaUhQZ3FnTTdtYUlLbjJBYzhBVzltZ1BGODZlRjlRNll0UVpUeXVnd0liUjYvdXFyTVJ5OCs2dStlUHVTV2pqTGpKNnJ1V3BFTlMvZzNuOTg2SjVpQTJaYzNEVVd1SUxPMzBDV3MwWGFWckZjSVpSOGt2clIwOUhLT0QvNGRybm9vYVFhS3RDYlE9PTwvU1A+";User ID=soporteTI@dominio.com;Persist Security Info=False;Time Out=600;Schema Sample Size=25;Retry Count=5;Retry Sleep=100;Keep Alive=False;Max Received Message Size=4398046511104

The error is the next:

 OData source failed validation and returned code 0xc020801a.

the connection "connection" cannot be found. Verify that the connection manager has a connection with that name.

Can you help me? Thanks you

Excel Destination : Avoid Text Format in Excel File

$
0
0

Hi,

I have 1 requirements 

1) 
Source Data Coming From SQL Server Table  format and output must be Excel (*.xlsx) file

Sample Data (SQL Table)
Col1 (Number)  Col2 (Text)
1                      A
2                      B
O/P I am getting (Not Expected)

Col1 (Text)  Col2 (Text)
1                      A
2                      B

I need output in New file Format (*.xlsx)

O/P

Col1 (Number)  Col2 (Text)
1                      A
2                      B

Note: I want to keep O/P format for Col1 must be number not the Text.

Many Thanks in Advance!

The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.

$
0
0

Hi everyone,

I have an SSIS package that loads data from Excel 2003 (Microsoft.Jet.OLEDB.4.0), do some transformation and creates a new file 2010 (Microsoft.ACE.OLEDB.12.0) afterwards. When I run the package from my computer it runs successful, but when I deploy to SSIS Catalog and run from a server I got this message "The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine."

I have set the 64bitRuntime to both True and False and checked and unchecked the 32bitruntime on the server yet it doesnt seems to solve the issue.

Please help!


me

Quiet Install SQL 2016 using configuration file with passwords for service accounts encrypted

$
0
0

Hello

Im trying to make an automated MDT task for installing SQL Server 2016 using a configuration file and i dont want to enter my service accounts password in plain text

EG : /AGTSVCPASSWORD="mypassword"

there its any way i can encrypt this password ?

Thank you in advance for your help

Best Regards





complex node xml output using t-sql

$
0
0

Hi All,

i am trying to build xml file with following tables and data.. I have already got middle part (address and phone) but not sure how to get final xml as below.. please help. T.I.A

-- Code start

-- header information table
create table #headerdetails 
(totalRecordCount int
, correlationId varchar(255)
, senderid varchar(255)
, receiverId int)

insert into #headerdetails
select 1, 'CARIL0200115-1','144R',437

-- vendor table
create table #v (Identifier varchar(100))

insert into #v
select '9876263'

-- vendor details table
create table #vd (Identifier varchar(100),add_id int, other_Address varchar(50)
, phoneNumber varchar(100), PhoneTypeid varchar(100)
,identificationType varchar(255), orderStartDate varchar(20),NId varchar(15))

insert into #vd 
select '9876263', 101, '56 xyz Rd', '31xx646','Mobile', 'Highway part Company','2016-01-01','N1234'

-- code end

xml output as

<?xml version="1.0" encoding="UTF-8"?>
<carMaintenanceServiceRequestRoot xmlns="http://www.global.com/schema/carmaintenance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<header xmlns="http://www.global.com/schema/common">
<totalRecordCount xmlns="">1</totalRecordCount>             -- count of vendor
<fileCreationDate xmlns="">2018-01-15</fileCreationDate>   -- need getdate()
<correlationId xmlns="">CARIL0200115-1</correlationId>
<senderId xmlns="">144R</senderId>
<receiverId xmlns="">437</receiverId>
</header>
<carMaintenanceServiceStronglyTypedIBRequest>
<createVendorRecordList>
  <recordCount>1</recordCount>     -- count of vendor
  <createVendorRecord>
    <recordId>1</recordId>  
    <createVendor xmlns="http://mnc.com">
      <Vendor xmlns="">   -- null hard coded
        <orderStartDate>2016-01-01</orderStartDate>
        <Identifier>9876263</Identifier>
        <NId>N1234</NId>
        <primaryId>
          <identificationNumber>9876263</identificationNumber>
          <identificationType>
            <id>Highway part Company</id>
          </identificationType>
        </primaryId>
        <otherCorrespondenceAddressList operation="merge">   -- "merge" is hard coded
          <correspondenceInformation>
            <addressInformation>
              <postalAddress>
                <address>56 xyz Rd</address>
              </postalAddress>
  <addressPhoneList>
               <telephone>
                 <phoneNumber>31xx646</phoneNumber>
                 <phoneType>
                   <id>Mobile</id>
                 </phoneType>
                </telephone>
               </addressPhoneList>
            </addressInformation>
          </correspondenceInformation>
        </otherCorrespondenceAddressList>
      </Vendor>
      <asOfDate xmlns="">1900-01-01</asOfDate>   -- this is also hard coded
    </createVendor>
  </createVendorRecord>
</createVendorRecordList>
</carMaintenanceServiceStronglyTypedIBRequest>
</carMaintenanceServiceRequestRoot>

T.I.A

Viewing all 24688 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>