Showing posts with label integration. Show all posts
Showing posts with label integration. Show all posts

Friday, March 30, 2012

mapping XML data to variable

I can’t figure out how to map xml data stored in a table to a variable in integration service.

For example:
I would like to use a “for each loop container” to iterate through a row set selected from database. Each row has three columns, an integer, a string and an xml data. In the variable mappings, I can map the integer column and the string column to a variable with type of int and a variable with type of string. But I am having trouble to map the xml data column to any variable. I tried using either a string variable or object. It always reports error like “variable mapping number X to variable XXX can’t apply”.

Any help?

This is a supported scenario. Ensure that:

The column is actually being loaded into the record set: Check the column mappings in the recordset dest The value being mapped to the variable is less than 4000 characters long: select max(datalength(xmlCol)) from XmlTable

Wednesday, March 28, 2012

Mapping of SQL Server data types to Integration Services Data Type

Does anyone know of any cross-references between SQL Server data types and the new data types introduced with SQL Server Integration Services?

For example, Integration Services has "DT_DATE", "DT_DBDATE", "DT_DBTIME" and "DT_DBTIMESTAMP". So far, if I have a SQL Server datetime column, the only Integration Services type I have been able to use is "DT_DBTIMESTAMP". There must be a way to map the datetime type to "DT_DATE", "DT_DBDATE" and "DT_DBTIME", but there no easy to use reference for this.

Please post a link to the resources if you know of one.

Thanks.We are just in the process of refining such a topic for the around-RTM Web refresh of Books Online. Copying and pasting HTML out of BOL is usually a disaster, but I'll give it a try, below. It will look more user-friendly when it appears in BOL! This topic has not been fully edited and tech reviewed - use at your own risk.

-Doug

Mapping Data Types in the Data Flow

While moving data from sources through transformations to destinations, a data flow component must sometimes convert data types between the SQL Server 2005 Integration Services (SSIS) types defined in the DataType enumeration and the managed data types of the Microsoft .NET Framework defined in the System namespace. In addition, a component must sometimes convert one Integration Services data type to another before that type can be converted to a managed type.

Note: The mapping files in XML format that are installed by default to C:\Program Files\Microsoft SQL Server\90\DTS\MappingFiles are not related to the data type mapping discussed in this topic. These files map data types from one database version or system to another (for example, from SQL Server 2000 to SQL Server 2005, or from SQL Server 2005 to Oracle), and are used only by the SQL Server Import and Export Wizard.

Mapping between Integration Services and Managed Data Types

Sometimes a data flow component must convert data types between the SQL Server 2005 Integration Services (SSIS) types defined in the DataType enumeration and the managed data types of the Microsoft .NET Framework defined in the System namespace. The following table lists the conversions that are currently performed by the BufferTypeToDataRecordType and the DataRecordTypeToBufferType methods of the PipelineComponent class. Other Integration Services data types not listed here cannot be converted to managed types.

Caution: Developers should use these methods of the the PipelineComponent class with caution, and may want to code data type mapping methods of their own that are more suited to the unique needs of their custom components. The existing methods do not consider numeric precision or scale, or any other properties closely related to the data type itself. Microsoft may modify or remove these methods, or modify the mappings that they perform, in a future version of Integration Services.

Integration Services Data Type Managed Data Type DT_WSTR System.String DT_BYTES Array of System.Byte DT_DBTIMESTAMP System.DateTime DT_NUMERIC System.Decimal DT_GUID System.Guid DT_I1 System.Byte DT_I2 System.Int16 DT_I4 System.Int32 DT_I8 System.Int64 DT_BOOL System.Boolean DT_R4 System.Single DT_R8 System.Double DT_UI1 System.Byte DT_UI2 System.UInt16 DT_UI4 System.UInt32 DT_UI8 System.UInt64

Converting Integration Services Data Types to Fit Managed Data Types

Sometimes a data flow component must also convert one Integration Services data type to another before that type can be converted to a managed type. The following table lists the conversions that are currently performed by the ConvertBufferDataTypeToFitManaged method of the PipelineComponent class.

Caution: Developers should use these methods of the the PipelineComponent class with caution, and may want to code data type mapping methods of their own that are more suited to the unique needs of their custom components. The existing methods do not consider numeric precision or scale, or any other properties closely related to the data type itself. Microsoft may modify or remove these methods, or modify the mappings that they perform, in a future version of Integration Services.

Original Data Type Converted Data Type DT_DECIMAL DT_NUMERIC DT_DATE DT_DBTIMESTAMP DT_BOOL DT_I4 DT_TEXT DT_WSTR DT_STR DT_WSTR DT_IMAGE DT_BYTES

See Also

Reference

BufferTypeToDataRecordType
DataRecordTypeToBufferType
ConvertBufferDataTypeToFitManaged

|||This is a good start, thanks. I'll be mindful of the risks in using it.

Ken|||Let me clarify in particular that the sentence, "Other Integration Services data types not listed here cannot be converted to managed types." (already rewritten since that build of BOL) means "...by using these methods." That is, the API methods mentioned in that paragraph.|||

If you interested in mapping of tinyints have a look at my post

http://www.sqljunkies.com/WebLog/simons/archive/2006/02/24/tinyint_in_SSIS.aspx

sql

Mapping of SQL Server data types to Integration Services Data Type

Does anyone know of any cross-references between SQL Server data types and the new data types introduced with SQL Server Integration Services?

For example, Integration Services has "DT_DATE", "DT_DBDATE", "DT_DBTIME" and "DT_DBTIMESTAMP". So far, if I have a SQL Server datetime column, the only Integration Services type I have been able to use is "DT_DBTIMESTAMP". There must be a way to map the datetime type to "DT_DATE", "DT_DBDATE" and "DT_DBTIME", but there no easy to use reference for this.

Please post a link to the resources if you know of one.

Thanks.We are just in the process of refining such a topic for the around-RTM Web refresh of Books Online. Copying and pasting HTML out of BOL is usually a disaster, but I'll give it a try, below. It will look more user-friendly when it appears in BOL! This topic has not been fully edited and tech reviewed - use at your own risk.

-Doug

Mapping Data Types in the Data Flow

While moving data from sources through transformations to destinations, a data flow component must sometimes convert data types between the SQL Server 2005 Integration Services (SSIS) types defined in the DataType enumeration and the managed data types of the Microsoft .NET Framework defined in the System namespace. In addition, a component must sometimes convert one Integration Services data type to another before that type can be converted to a managed type.

Note: The mapping files in XML format that are installed by default to C:\Program Files\Microsoft SQL Server\90\DTS\MappingFiles are not related to the data type mapping discussed in this topic. These files map data types from one database version or system to another (for example, from SQL Server 2000 to SQL Server 2005, or from SQL Server 2005 to Oracle), and are used only by the SQL Server Import and Export Wizard.

Mapping between Integration Services and Managed Data Types

Sometimes a data flow component must convert data types between the SQL Server 2005 Integration Services (SSIS) types defined in the DataType enumeration and the managed data types of the Microsoft .NET Framework defined in the System namespace. The following table lists the conversions that are currently performed by the BufferTypeToDataRecordType and the DataRecordTypeToBufferType methods of the PipelineComponent class. Other Integration Services data types not listed here cannot be converted to managed types.

Caution: Developers should use these methods of the the PipelineComponent class with caution, and may want to code data type mapping methods of their own that are more suited to the unique needs of their custom components. The existing methods do not consider numeric precision or scale, or any other properties closely related to the data type itself. Microsoft may modify or remove these methods, or modify the mappings that they perform, in a future version of Integration Services.

Integration Services Data Type Managed Data Type DT_WSTR System.String DT_BYTES Array of System.Byte DT_DBTIMESTAMP System.DateTime DT_NUMERIC System.Decimal DT_GUID System.Guid DT_I1 System.Byte DT_I2 System.Int16 DT_I4 System.Int32 DT_I8 System.Int64 DT_BOOL System.Boolean DT_R4 System.Single DT_R8 System.Double DT_UI1 System.Byte DT_UI2 System.UInt16 DT_UI4 System.UInt32 DT_UI8 System.UInt64

Converting Integration Services Data Types to Fit Managed Data Types

Sometimes a data flow component must also convert one Integration Services data type to another before that type can be converted to a managed type. The following table lists the conversions that are currently performed by the ConvertBufferDataTypeToFitManaged method of the PipelineComponent class.

Caution: Developers should use these methods of the the PipelineComponent class with caution, and may want to code data type mapping methods of their own that are more suited to the unique needs of their custom components. The existing methods do not consider numeric precision or scale, or any other properties closely related to the data type itself. Microsoft may modify or remove these methods, or modify the mappings that they perform, in a future version of Integration Services.

Original Data Type Converted Data Type DT_DECIMAL DT_NUMERIC DT_DATE DT_DBTIMESTAMP DT_BOOL DT_I4 DT_TEXT DT_WSTR DT_STR DT_WSTR DT_IMAGE DT_BYTES

See Also

Reference

BufferTypeToDataRecordType
DataRecordTypeToBufferType
ConvertBufferDataTypeToFitManaged

|||This is a good start, thanks. I'll be mindful of the risks in using it.

Ken|||Let me clarify in particular that the sentence, "Other Integration Services data types not listed here cannot be converted to managed types." (already rewritten since that build of BOL) means "...by using these methods." That is, the API methods mentioned in that paragraph.|||

If you interested in mapping of tinyints have a look at my post

http://www.sqljunkies.com/WebLog/simons/archive/2006/02/24/tinyint_in_SSIS.aspx

Monday, March 26, 2012

MAPI client for SQL Mail and SNMP Integration

We are trying avoid installing MAPI client, Outlook 2000, on our production
database servers. My boss thinks there is a security threat by installing
Outlook on production servers? Are you all aware of any security issues with
this?
I heard about SNMP integration wiith SQL Server which enables monitoring
database status and sending alerts to pager or email. Did anyone use this?
Using this, can I send alerts regarding SQL Server errors with severity
greater than 19? Any poniters on this topic will be appreciated.I am unaware of any security issues. I have run into some stability and
usability issues woth Outlook and MAPI mail from SQL and SQL agent.
You might want to look at xp_smtp_sendmail from www.sqldev.net. It doesn't
have the seamless integration, but with a little extra work it can do most
everything you will need. It is also much more stable than Outlook on a SQL
console.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Prasad Koukuntla" <prasad.koukuntla@.scapromo.com> wrote in message
news:eoBRa99%23DHA.684@.tk2msftngp13.phx.gbl...
> We are trying avoid installing MAPI client, Outlook 2000, on our
production
> database servers. My boss thinks there is a security threat by installing
> Outlook on production servers? Are you all aware of any security issues
with
> this?
> I heard about SNMP integration wiith SQL Server which enables monitoring
> database status and sending alerts to pager or email. Did anyone use this?
> Using this, can I send alerts regarding SQL Server errors with severity
> greater than 19? Any poniters on this topic will be appreciated.
>
>|||Thank you Geoff.
I too feel that there are no security issues.
I have used xp_smtp_sendmail before, however, this one may require custom
programming to capture the errors and then sending the alerts which we may
not want to do. Thanks.
"Geoff N. Hiten" <SRDBA@.Careerbuilder.com> wrote in message
news:%23FlnFC%23%23DHA.3220@.TK2MSFTNGP10.phx.gbl...
> I am unaware of any security issues. I have run into some stability and
> usability issues woth Outlook and MAPI mail from SQL and SQL agent.
> You might want to look at xp_smtp_sendmail from www.sqldev.net. It
doesn't
> have the seamless integration, but with a little extra work it can do most
> everything you will need. It is also much more stable than Outlook on a
SQL
> console.
> --
> Geoff N. Hiten
> Microsoft SQL Server MVP
> Senior Database Administrator
> Careerbuilder.com
> I support the Professional Association for SQL Server
> www.sqlpass.org
> "Prasad Koukuntla" <prasad.koukuntla@.scapromo.com> wrote in message
> news:eoBRa99%23DHA.684@.tk2msftngp13.phx.gbl...
> production
installing
> with
this?
>|||Prasad,
To add to the other comments:
You can use xp_smtp_sendmail for event alerts without creating jobs for each
alert, check out http://www.dbmaint.com/SmtpAlerter.asp.
As for the SNMP support: As of 7.0 there are no longer support for SNMP
alerts in SQL Server (I'm far away from an SNMP expert, but I think they
call it Alerts in the SNMP world), only monitoring. IMO, SNMP alerts are
probably more useful than what monitoring is...
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=...ublic.sqlserver
"Prasad Koukuntla" <prasad.koukuntla@.scapromo.com> wrote in message
news:eoBRa99%23DHA.684@.tk2msftngp13.phx.gbl...
> We are trying avoid installing MAPI client, Outlook 2000, on our
production
> database servers. My boss thinks there is a security threat by installing
> Outlook on production servers? Are you all aware of any security issues
with
> this?
> I heard about SNMP integration wiith SQL Server which enables monitoring
> database status and sending alerts to pager or email. Did anyone use this?
> Using this, can I send alerts regarding SQL Server errors with severity
> greater than 19? Any poniters on this topic will be appreciated.
>
>|||Thanks Tibor,
I will check it out.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:eB1kG7%23%23DHA.2476@.TK2MSFTNGP12.phx.gbl...
> Prasad,
> To add to the other comments:
> You can use xp_smtp_sendmail for event alerts without creating jobs for
each
> alert, check out http://www.dbmaint.com/SmtpAlerter.asp.
> As for the SNMP support: As of 7.0 there are no longer support for SNMP
> alerts in SQL Server (I'm far away from an SNMP expert, but I think they
> call it Alerts in the SNMP world), only monitoring. IMO, SNMP alerts are
> probably more useful than what monitoring is...
> --
> Tibor Karaszi, SQL Server MVP
> Archive at:
>
http://groups.google.com/groups?oi=...ublic.sqlserver
>
> "Prasad Koukuntla" <prasad.koukuntla@.scapromo.com> wrote in message
> news:eoBRa99%23DHA.684@.tk2msftngp13.phx.gbl...
> production
installing
> with
this?
>

MAPI client for SQL Mail and SNMP Integration

We are trying avoid installing MAPI client, Outlook 2000, on our production
database servers. My boss thinks there is a security threat by installing
Outlook on production servers? Are you all aware of any security issues with
this?
I heard about SNMP integration wiith SQL Server which enables monitoring
database status and sending alerts to pager or email. Did anyone use this?
Using this, can I send alerts regarding SQL Server errors with severity
greater than 19? Any poniters on this topic will be appreciated.I am unaware of any security issues. I have run into some stability and
usability issues woth Outlook and MAPI mail from SQL and SQL agent.
You might want to look at xp_smtp_sendmail from www.sqldev.net. It doesn't
have the seamless integration, but with a little extra work it can do most
everything you will need. It is also much more stable than Outlook on a SQL
console.
--
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"Prasad Koukuntla" <prasad.koukuntla@.scapromo.com> wrote in message
news:eoBRa99%23DHA.684@.tk2msftngp13.phx.gbl...
> We are trying avoid installing MAPI client, Outlook 2000, on our
production
> database servers. My boss thinks there is a security threat by installing
> Outlook on production servers? Are you all aware of any security issues
with
> this?
> I heard about SNMP integration wiith SQL Server which enables monitoring
> database status and sending alerts to pager or email. Did anyone use this?
> Using this, can I send alerts regarding SQL Server errors with severity
> greater than 19? Any poniters on this topic will be appreciated.
>
>|||Thank you Geoff.
I too feel that there are no security issues.
I have used xp_smtp_sendmail before, however, this one may require custom
programming to capture the errors and then sending the alerts which we may
not want to do. Thanks.
"Geoff N. Hiten" <SRDBA@.Careerbuilder.com> wrote in message
news:%23FlnFC%23%23DHA.3220@.TK2MSFTNGP10.phx.gbl...
> I am unaware of any security issues. I have run into some stability and
> usability issues woth Outlook and MAPI mail from SQL and SQL agent.
> You might want to look at xp_smtp_sendmail from www.sqldev.net. It
doesn't
> have the seamless integration, but with a little extra work it can do most
> everything you will need. It is also much more stable than Outlook on a
SQL
> console.
> --
> Geoff N. Hiten
> Microsoft SQL Server MVP
> Senior Database Administrator
> Careerbuilder.com
> I support the Professional Association for SQL Server
> www.sqlpass.org
> "Prasad Koukuntla" <prasad.koukuntla@.scapromo.com> wrote in message
> news:eoBRa99%23DHA.684@.tk2msftngp13.phx.gbl...
> > We are trying avoid installing MAPI client, Outlook 2000, on our
> production
> > database servers. My boss thinks there is a security threat by
installing
> > Outlook on production servers? Are you all aware of any security issues
> with
> > this?
> >
> > I heard about SNMP integration wiith SQL Server which enables monitoring
> > database status and sending alerts to pager or email. Did anyone use
this?
> > Using this, can I send alerts regarding SQL Server errors with severity
> > greater than 19? Any poniters on this topic will be appreciated.
> >
> >
> >
>|||search for xpsmtp mail for sql server on internet, its
much more stable and reliable and you can download it for
free. You use to monitor sql jobs, error logs and send any
kind of emails from sql server.
to send alerts, create a job and in step text enter
something like following, don't create a schedule for this
job:
exec master.dbo.xp_smtp_sendmail
@.from = 'MSSQLServer@.server.com',
@.to = '<you@.yourdomain.com>',
@.subject = 'SQL Server errors with
severity greater than 19 occurred',
@.message = '<message>',
@.server = '<YOUR SMPT SERVER>'
Define your alerts for severity greater than 19, and
response to the alert Execute the above job.
hth.
>--Original Message--
>We are trying avoid installing MAPI client, Outlook 2000,
on our production
>database servers. My boss thinks there is a security
threat by installing
>Outlook on production servers? Are you all aware of any
security issues with
>this?
>I heard about SNMP integration wiith SQL Server which
enables monitoring
>database status and sending alerts to pager or email. Did
anyone use this?
>Using this, can I send alerts regarding SQL Server errors
with severity
>greater than 19? Any poniters on this topic will be
appreciated.
>
>.
>|||Okay, I will try this approach. Thanks Guru.
"Guru" <gss20@.hotmail.com> wrote in message
news:192d01c3fbe3$85760c80$a001280a@.phx.gbl...
> search for xpsmtp mail for sql server on internet, its
> much more stable and reliable and you can download it for
> free. You use to monitor sql jobs, error logs and send any
> kind of emails from sql server.
> to send alerts, create a job and in step text enter
> something like following, don't create a schedule for this
> job:
> exec master.dbo.xp_smtp_sendmail
> @.from = 'MSSQLServer@.server.com',
> @.to = '<you@.yourdomain.com>',
> @.subject = 'SQL Server errors with
> severity greater than 19 occurred',
> @.message = '<message>',
> @.server = '<YOUR SMPT SERVER>'
> Define your alerts for severity greater than 19, and
> response to the alert Execute the above job.
> hth.
> >--Original Message--
> >We are trying avoid installing MAPI client, Outlook 2000,
> on our production
> >database servers. My boss thinks there is a security
> threat by installing
> >Outlook on production servers? Are you all aware of any
> security issues with
> >this?
> >
> >I heard about SNMP integration wiith SQL Server which
> enables monitoring
> >database status and sending alerts to pager or email. Did
> anyone use this?
> >Using this, can I send alerts regarding SQL Server errors
> with severity
> >greater than 19? Any poniters on this topic will be
> appreciated.
> >
> >
> >
> >.
> >|||Prasad,
To add to the other comments:
You can use xp_smtp_sendmail for event alerts without creating jobs for each
alert, check out http://www.dbmaint.com/SmtpAlerter.asp.
As for the SNMP support: As of 7.0 there are no longer support for SNMP
alerts in SQL Server (I'm far away from an SNMP expert, but I think they
call it Alerts in the SNMP world), only monitoring. IMO, SNMP alerts are
probably more useful than what monitoring is...
--
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Prasad Koukuntla" <prasad.koukuntla@.scapromo.com> wrote in message
news:eoBRa99%23DHA.684@.tk2msftngp13.phx.gbl...
> We are trying avoid installing MAPI client, Outlook 2000, on our
production
> database servers. My boss thinks there is a security threat by installing
> Outlook on production servers? Are you all aware of any security issues
with
> this?
> I heard about SNMP integration wiith SQL Server which enables monitoring
> database status and sending alerts to pager or email. Did anyone use this?
> Using this, can I send alerts regarding SQL Server errors with severity
> greater than 19? Any poniters on this topic will be appreciated.
>
>|||Thanks Tibor,
I will check it out.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:eB1kG7%23%23DHA.2476@.TK2MSFTNGP12.phx.gbl...
> Prasad,
> To add to the other comments:
> You can use xp_smtp_sendmail for event alerts without creating jobs for
each
> alert, check out http://www.dbmaint.com/SmtpAlerter.asp.
> As for the SNMP support: As of 7.0 there are no longer support for SNMP
> alerts in SQL Server (I'm far away from an SNMP expert, but I think they
> call it Alerts in the SNMP world), only monitoring. IMO, SNMP alerts are
> probably more useful than what monitoring is...
> --
> Tibor Karaszi, SQL Server MVP
> Archive at:
>
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
>
> "Prasad Koukuntla" <prasad.koukuntla@.scapromo.com> wrote in message
> news:eoBRa99%23DHA.684@.tk2msftngp13.phx.gbl...
> > We are trying avoid installing MAPI client, Outlook 2000, on our
> production
> > database servers. My boss thinks there is a security threat by
installing
> > Outlook on production servers? Are you all aware of any security issues
> with
> > this?
> >
> > I heard about SNMP integration wiith SQL Server which enables monitoring
> > database status and sending alerts to pager or email. Did anyone use
this?
> > Using this, can I send alerts regarding SQL Server errors with severity
> > greater than 19? Any poniters on this topic will be appreciated.
> >
> >
> >
>sql