Showing posts with label express. Show all posts
Showing posts with label express. Show all posts

Thursday, March 22, 2012

(2005 express) database replication? how to?!

I want to make a replicationfor my sql server 2005 express database? how can I do that automatically? and documentation?

Replication is not included with SQL Server Express Edition.

If you need replication, you will have to have at least the Workgroup Edition.

Tuesday, March 20, 2012

"Visual Studio 2005 Command Prompt" missing from SQL Server 2005 Express Toolkit insta

The program shortcut "Visual Studio 2005 Command Prompt" seems to be mising from the "Visual Studio 2005 Command Prompt" Start menu added by the current Microsoft SQL Server 2005 Express Edition Toolkit. Where is it? How to workaround?

I am trying to do Download details SQL Server 2005 Samples and Sample Databases (April 2006) -> GettingStartedWithSQLSamples.htm which says "a. Open a Microsoft Visual Studio 2005 command prompt. Click Start, point to All Programs, point to Microsoft Visual Studio 2005, point to Visual Studio Tools, and then click Visual Studio 2005 Command Prompt." but I can find no such command prompt within "Visual Studio Tools", only "Visual Studio 2005 Remote Debugger{, Configuration Wizard}".

What's wrong? How to fix or workaround? I'd install .NET SDK 2.0 to get it's Command Prompt but that's about 570MB merely for a command prompt!

Thanks for your help, -Mike Parker

I believe that the toolkit does not come with the command prompt and the instructions for the samples were written before Advanced was shipped.

What are you trying to do with the samples? If you don't have a copy of VS installed its going to be pretty hard to do anything with them. If you just want accesst to the SQL Server samples I don't think you need a command prompt.

Monday, March 19, 2012

"SQL Server Management Studio Express" install location

I just installed the "SQL Server Management Studio Express" but it didn't tell me where it was installed. How do I get the application started ?A short-cut should have been add to ALL Programs | Microsoft SQL Server 2005 | SQL Server Management Studio Express CTP.

Peter|||found it here

"C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\ssmsee.exe"

"Server type" is disabled in SQL Server Management Studio

Hi,

I'm trying to connect to a remote server using SQL Server management studio express.

But the "server type" field is disabled. I'm not able to select the server type. It is set to "Database Engine". Because of this (I Guess) the connection to the remote SQL server 2005 is failing giving the following error:

"An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 53)"

Please let me know how to solve this issue.

Thanks & Regards,
Bijesh

Hi there,

Is the remote server running either of SQL Server 2005 Express Edition or SQL Server 2005 Developer Edition?

The error mesasge you posted seems to indicate that the remote server won't accept a connection. I don't think this has anything to do with the value in the "Server Type" field.

If you're trying to connect to a remote instance of SQL Server 2005 Express or Developer Edition then remote connections are disabled by default & this would explain why you are unable to connect. If you perform the steps outlined in the below link on your remote server, you should be able to connect to the remote server:

http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277

Also check that the name you are providing for the remote server is correct. If the remote server is running a default instance then the name of the SQL Server is the name of the computer. If the remote server is running a named instance then the name of the SQL Server is <Computer Name>\<Instance Name>

Hope that helps a bit, but sorry if it doesn't
|||SQL Server Express can only connect to the relational engine - that's why server type is grayed out.|||

This means the client couldn't make a connection to the server. Most often, the cause is because the server is not configured to accept connections from other machines. Second most often, there is a firewall getting in the way.

Make sure the remote server is configured to accept named pipes connections. You can check this using the Surface Area Configuration tool.

If named pipes don't work for you, switch to using TCP/IP connections, make sure the server is configured to accept TCP/IP connections, and make sure the IP port used by SQL Server is open in your firewall (by default, this is port 1433).

Hope this helps,
Steve

Friday, March 16, 2012

"Remote access to report data sources and/or the report server database" is not suppor

I'm using SQL Express with Advance Services & I get this error when I try to deploy my reports. Why do I get this error

  • An error has occurred during report processing. (rsProcessingAborted)
  • Cannot create a connection to data source 'EDPSYS'. (rsErrorOpeningConnection)
  • The feature: "Remote access to report data sources and/or the report server database" is not supported in this edition of Reporting Services. (rsOperationNotSupported)

    Justin Song

    SQL Express does not allow access to data sources not on the local machine. You will need to point to local data in your report.|||

    I'm new user of Reporting Services. I'm trying use Samples (AdventureWorks) and can't use it because this error. How do I point to local data in this samples? I create a Data Source named AdventureWorks with this string:

    data source="(local)";persist security info=False;initial catalog=AdventureWorks

    but is not working...

    |||

    I've seen this problem before. The way I solved it previously was to update the connectionstring from an old-style ADO format to the new SQL 2005 format.

    Old:

    data source=(local);persist security info=False;initial catalog=AdventureWorks

    New:

    Server=(local); Database=AdventureWorks; Trusted_Connection=yes;

    Hope this helps. Mark

  • "Remote access to report data sources and/or the report server database" is not suppor

    I'm using SQL Express with Advance Services & I get this error when I try to deploy my reports. Why do I get this error

  • An error has occurred during report processing. (rsProcessingAborted)
  • Cannot create a connection to data source 'EDPSYS'. (rsErrorOpeningConnection)
  • The feature: "Remote access to report data sources and/or the report server database" is not supported in this edition of Reporting Services. (rsOperationNotSupported)

    Justin Song

    SQL Express does not allow access to data sources not on the local machine. You will need to point to local data in your report.|||

    I'm new user of Reporting Services. I'm trying use Samples (AdventureWorks) and can't use it because this error. How do I point to local data in this samples? I create a Data Source named AdventureWorks with this string:

    data source="(local)";persist security info=False;initial catalog=AdventureWorks

    but is not working...

    |||

    I've seen this problem before. The way I solved it previously was to update the connectionstring from an old-style ADO format to the new SQL 2005 format.

    Old:

    data source=(local);persist security info=False;initial catalog=AdventureWorks

    New:

    Server=(local); Database=AdventureWorks; Trusted_Connection=yes;

    Hope this helps. Mark

  • "Remote access to report data sources and/or the report server database" is not su

    I'm using SQL Express with Advance Services & I get this error when I try to deploy my reports. Why do I get this error

  • An error has occurred during report processing. (rsProcessingAborted)

  • Cannot create a connection to data source 'EDPSYS'. (rsErrorOpeningConnection)

  • The feature: "Remote access to report data sources and/or the report server database" is not supported in this edition of Reporting Services. (rsOperationNotSupported)

    Justin Song

    SQL Express does not allow access to data sources not on the local machine. You will need to point to local data in your report.|||

    I'm new user of Reporting Services. I'm trying use Samples (AdventureWorks) and can't use it because this error. How do I point to local data in this samples? I create a Data Source named AdventureWorks with this string:

    data source="(local)";persist security info=False;initial catalog=AdventureWorks

    but is not working...

    |||

    I've seen this problem before. The way I solved it previously was to update the connectionstring from an old-style ADO format to the new SQL 2005 format.

    Old:

    data source=(local);persist security info=False;initial catalog=AdventureWorks

    New:

    Server=(local); Database=AdventureWorks; Trusted_Connection=yes;

    Hope this helps. Mark

  • Sunday, March 11, 2012

    "ON DUPLICATE KEY UPDATE"?

    Hi,

    I am migrating from MySQL to SQL Express. In MySQL, I import data from Oracle using the "INSERT INTO .... ON DUPLICATE KEY UPDATE". With the "ON DUPLICATE KEY UPDATE", when there is a duplicate key in MySQL exists, the respective records will be updated (so to avoid inserting the data twice). I cannot remove the duplicated rows in MySQL as it contains extra fields with user-input value.

    Is there any way I can do the same in SQL Express? Is it a must that I need to create a temp table to hold the downloaded data and then update the duplicated data in the original before an INSERT?

    Thanks

    Raymond

    There is no equivalent functionality. You can however do the following:

    1. You can create an unique index on the key column(s) with the IGNORE_DUP_KEY option set to on. This will result in the duplicate rows being ignored during the INSERT operation for instance. You will have to however update the rows by inserting into another table and then performing update

    2. Use a worktable approach where you insert all the rows into the worktable and then use insert/update as into the main table.

    |||

    Thanks,

    I think I will go for the second option, as there is only a few new records (inserts) every time, and most the other records involve changes (updates).

    Raymond

    Saturday, February 25, 2012

    "Could not find schema information ..." error in XSD annotation

    When I open any annotated schema in VC# 2005 Express, I get the error:

    "Could not find schema information for the attribute 'urn:schemas-microsoft-com:mapping-schema:relation'."

    Am I missing a reference? MSXML4.0 and the SQL Client are installed on my workstation.

    An example of one of the annotated schemas I've tried is this one, from Andrew Conrad's MSDN article "A Survey of Microsoft SQL Server 2000 XML Features":

    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"

    xmlns:sql="urn:schemas-microsoft-com:mapping-schema">

    <xsd:element name="CustomerRecord" sql:relation="Customers" >

    <xsd:complexType>

    <xsd:sequence>

    <xsd:element name="Contact" sql:field="ContactName"

    type="xsd:string" />

    ... etc. All references to sql:relation, sql:field and sql:relationship produce the same error.

    How do you open it?

    Thanks

    Michael

    |||I was opening the schema in the standard editor pane and then clicking on Show Errors in one of the drop-down menus (can't remember which one that is, now). I dumped VC# 2005 Express in favor of C# in VS 2003 Enterprise, which validates the same schema with no problem. The documentation which installed with the Express edition was clearly meant for the standard VS product, anyway, and, so far, schema handling in VS 2003 appears to work as advertised.

    Best Regards,

    Mike|||

    I think the issue may be that the VC# 2005 editor by default expects all namespaces to have schemas associated. I am forwarding this to our schema editor experts to see what's going on.

    Thanks

    Michael

    |||

    The schema for these mapping annotations was not shipped in Visual Studio 2005. If you plop the following XSD schema into your "program files\visual studio 8\xml\schema" folder then the errors will go away:

    <?xml version="1.0" encoding="utf-8" ?>

    <xs:schema targetNamespace="urn:schemas-microsoft-com:mapping-schema"

    elementFormDefault="qualified"

    xmlns="urn:schemas-microsoft-com:mapping-schema"

    xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <xs:attribute name="encode" type="xs:anyURI">

    <xs:annotation>

    <xs:documentation>

    When an XML element or attribute is mapped to a SQL Server BLOB column, allows requesting a reference URI. This URI can be used later to return BLOB data.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="field" type="xs:string">

    <xs:annotation>

    <xs:documentation>Maps an XML item to a database column.</xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="guid" type="guid">

    <xs:annotation>

    <xs:documentation>

    Allows you to specify whether to use a GUID value generated by SQL Server or use the value provided in the updategram for that column.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="hide" type="xs:boolean">

    <xs:annotation>

    <xs:documentation>

    Hides the element or attribute that is specified in the schema in the resulting XML document.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="identity" type="guid">

    <xs:annotation>

    <xs:documentation>

    Can be specified on any node that maps to an IDENTITY-type database column. The value specified for this annotation defines how the corresponding IDENTITY-type column in the database is updated.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="inverse" type="xs:boolean">

    <xs:annotation>

    <xs:documentation>

    Instructs the updategram logic to inverse its interpretation of the parent-child relationship that has been specified using &lt;sql:relationship&gt;

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="is-constant" type="xs:boolean">

    <xs:annotation>

    <xs:documentation>

    Creates an XML element that does not map to any table. The element appears in the query output.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="key-fields" type="xs:string">

    <xs:annotation>

    <xs:documentation>

    Allows specification of column(s) that uniquely identify the rows in a table.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="limit-field" type="xs:string">

    <xs:annotation>

    <xs:documentation>

    Allows limiting the values that are returned on the basis of a limiting value.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="limit-value" type="xs:string">

    <xs:annotation>

    <xs:documentation>

    Allows limiting the values that are returned on the basis of a limiting value.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="mapped" type="xs:boolean">

    <xs:annotation>

    <xs:documentation>

    Allows schema items to be excluded from the result.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="max-depth" type="xs:positiveInteger">

    <xs:annotation>

    <xs:documentation>

    Allows you to specify depth in recursive relationships that are specified in the schema.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="overflow-field" type="xs:string">

    <xs:annotation>

    <xs:documentation>

    Identifies the database column that contains the overflow data.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="prefix" type="xs:string">

    <xs:annotation>

    <xs:documentation>

    Creates valid XML ID, IDREF, and IDREFS. Prepends the values of ID, IDREF, and IDREFS with a string.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="relation" type="xs:string">

    <xs:annotation>

    <xs:documentation>

    Maps an XML item to a database table.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="relationship" type="xs:string">

    <xs:annotation>

    <xs:documentation>

    Specifies relationships between XML elements. The parent, child, parent-key, and child-key attributes are used to establish the relationship.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="use-cdata" type="xs:boolean">

    <xs:annotation>

    <xs:documentation>

    Allows specifying CDATA sections to be used for certain elements in the XML document.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:simpleType name="guid">

    <xs:restriction base="xs:string">

    <xs:pattern value="\{[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\}"/>

    </xs:restriction>

    </xs:simpleType>

    </xs:schema>

    |||Thanks, Chris. That makes perfect sense. I saved the schema and will use it if I try VS C# Express again.

    Mike|||

    Fine, but where in that folder should the schema be plopped?

    Should I be able to deduce the file name from the info in the schema?

    Or doesn't the fle name matter?

    In that case, please explain the magic that allows it to be fetched in to cure the problem under discusssion

    Regards,

    Al

    |||Al -

    I'm no longer using VC# 2005 Express, but the schema name would be mapping-schema.xsd, and I think you would save it to the folder Program Files\Microsoft Visual Studio 8\Xml\Schemas.

    There's probably a way to implicitly embed a xsi:schemaLocation directive in your annotated schema, so you could put the mapping-schema in your bin\Debug folder along with the program source files, but I can't figure out what such a directive would look like.

    Good luck,

    Mike
    |||

    What should the filename be?

    |||

    Did you ever find out how the file should be named? I am having the same endless messages and i would like to get rid of them.

    Thanks,

    |||

    RoseD wrote:

    Did you ever find out how the file should be named? I am having the same endless messages and i would like to get rid of them.

    Thanks,

    No. That is still a mystery, unfortunately.

    It is absolutely ridiculous.

    Releasing a service-pack or at least a patch would be VERY simple; but, the creators obviously have moved on to bigger and better things-- that is, sadly, pretty common for MS these days-- they move on to a new technology before they have fixed Version 1 of a release product. They keep adding bells-and-whistles but they often miss the core features. Oh well. They still have some of the best tools; I just wish there were a little more support for products by the way of services-packs, patches, and add-ons. In fact, I am sure they could have charged a nominal fee ($20, $50, even $100) for the Express tools and then they would have had a budget for product support.

    Thank you.

    -- Mark Kamoski

    |||I wish I could give you a definitive answer, but as I said earlier, I switched to VS 2003 and the problem went away, so I never tried the solution proposed by Chris Lovett. Did you try naming the file "mapping-schema.xsd"? The full path would then be "Program Files\Visual Studio 8\xml\schema\mapping-schema.xsd".|||

    This is an actual microsoft.com forum - isn't there a microsoft support engineer that can give a definitive answer to the question, what xsd file contains the xml schema info for remoting configuration files?

    "Could not find schema information ..." error in XSD annotation

    When I open any annotated schema in VC# 2005 Express, I get the error:

    "Could not find schema information for the attribute 'urn:schemas-microsoft-com:mapping-schema:relation'."

    Am I missing a reference? MSXML4.0 and the SQL Client are installed on my workstation.

    An example of one of the annotated schemas I've tried is this one, from Andrew Conrad's MSDN article "A Survey of Microsoft SQL Server 2000 XML Features":

    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"

    xmlns:sql="urn:schemas-microsoft-com:mapping-schema">

    <xsd:element name="CustomerRecord" sql:relation="Customers" >

    <xsd:complexType>

    <xsd:sequence>

    <xsd:element name="Contact" sql:field="ContactName"

    type="xsd:string" />

    ... etc. All references to sql:relation, sql:field and sql:relationship produce the same error.

    How do you open it?

    Thanks

    Michael

    |||I was opening the schema in the standard editor pane and then clicking on Show Errors in one of the drop-down menus (can't remember which one that is, now). I dumped VC# 2005 Express in favor of C# in VS 2003 Enterprise, which validates the same schema with no problem. The documentation which installed with the Express edition was clearly meant for the standard VS product, anyway, and, so far, schema handling in VS 2003 appears to work as advertised.

    Best Regards,

    Mike
    |||

    I think the issue may be that the VC# 2005 editor by default expects all namespaces to have schemas associated. I am forwarding this to our schema editor experts to see what's going on.

    Thanks

    Michael

    |||

    The schema for these mapping annotations was not shipped in Visual Studio 2005. If you plop the following XSD schema into your "program files\visual studio 8\xml\schema" folder then the errors will go away:

    <?xml version="1.0" encoding="utf-8" ?>

    <xs:schema targetNamespace="urn:schemas-microsoft-com:mapping-schema"

    elementFormDefault="qualified"

    xmlns="urn:schemas-microsoft-com:mapping-schema"

    xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <xs:attribute name="encode" type="xs:anyURI">

    <xs:annotation>

    <xs:documentation>

    When an XML element or attribute is mapped to a SQL Server BLOB column, allows requesting a reference URI. This URI can be used later to return BLOB data.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="field" type="xs:string">

    <xs:annotation>

    <xs:documentation>Maps an XML item to a database column.</xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="guid" type="guid">

    <xs:annotation>

    <xs:documentation>

    Allows you to specify whether to use a GUID value generated by SQL Server or use the value provided in the updategram for that column.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="hide" type="xs:boolean">

    <xs:annotation>

    <xs:documentation>

    Hides the element or attribute that is specified in the schema in the resulting XML document.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="identity" type="guid">

    <xs:annotation>

    <xs:documentation>

    Can be specified on any node that maps to an IDENTITY-type database column. The value specified for this annotation defines how the corresponding IDENTITY-type column in the database is updated.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="inverse" type="xs:boolean">

    <xs:annotation>

    <xs:documentation>

    Instructs the updategram logic to inverse its interpretation of the parent-child relationship that has been specified using &lt;sql:relationship&gt;

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="is-constant" type="xs:boolean">

    <xs:annotation>

    <xs:documentation>

    Creates an XML element that does not map to any table. The element appears in the query output.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="key-fields" type="xs:string">

    <xs:annotation>

    <xs:documentation>

    Allows specification of column(s) that uniquely identify the rows in a table.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="limit-field" type="xs:string">

    <xs:annotation>

    <xs:documentation>

    Allows limiting the values that are returned on the basis of a limiting value.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="limit-value" type="xs:string">

    <xs:annotation>

    <xs:documentation>

    Allows limiting the values that are returned on the basis of a limiting value.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="mapped" type="xs:boolean">

    <xs:annotation>

    <xs:documentation>

    Allows schema items to be excluded from the result.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="max-depth" type="xs:positiveInteger">

    <xs:annotation>

    <xs:documentation>

    Allows you to specify depth in recursive relationships that are specified in the schema.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="overflow-field" type="xs:string">

    <xs:annotation>

    <xs:documentation>

    Identifies the database column that contains the overflow data.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="prefix" type="xs:string">

    <xs:annotation>

    <xs:documentation>

    Creates valid XML ID, IDREF, and IDREFS. Prepends the values of ID, IDREF, and IDREFS with a string.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="relation" type="xs:string">

    <xs:annotation>

    <xs:documentation>

    Maps an XML item to a database table.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="relationship" type="xs:string">

    <xs:annotation>

    <xs:documentation>

    Specifies relationships between XML elements. The parent, child, parent-key, and child-key attributes are used to establish the relationship.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="use-cdata" type="xs:boolean">

    <xs:annotation>

    <xs:documentation>

    Allows specifying CDATA sections to be used for certain elements in the XML document.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:simpleType name="guid">

    <xs:restriction base="xs:string">

    <xs:pattern value="\{[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\}"/>

    </xs:restriction>

    </xs:simpleType>

    </xs:schema>

    |||Thanks, Chris. That makes perfect sense. I saved the schema and will use it if I try VS C# Express again.

    Mike
    |||

    Fine, but where in that folder should the schema be plopped?

    Should I be able to deduce the file name from the info in the schema?

    Or doesn't the fle name matter?

    In that case, please explain the magic that allows it to be fetched in to cure the problem under discusssion

    Regards,

    Al

    |||Al -

    I'm no longer using VC# 2005 Express, but the schema name would be mapping-schema.xsd, and I think you would save it to the folder Program Files\Microsoft Visual Studio 8\Xml\Schemas.

    There's probably a way to implicitly embed a xsi:schemaLocation directive in your annotated schema, so you could put the mapping-schema in your bin\Debug folder along with the program source files, but I can't figure out what such a directive would look like.

    Good luck,

    Mike
    |||

    What should the filename be?

    |||

    Did you ever find out how the file should be named? I am having the same endless messages and i would like to get rid of them.

    Thanks,

    |||

    RoseD wrote:

    Did you ever find out how the file should be named? I am having the same endless messages and i would like to get rid of them.

    Thanks,

    No. That is still a mystery, unfortunately.

    It is absolutely ridiculous.

    Releasing a service-pack or at least a patch would be VERY simple; but, the creators obviously have moved on to bigger and better things-- that is, sadly, pretty common for MS these days-- they move on to a new technology before they have fixed Version 1 of a release product. They keep adding bells-and-whistles but they often miss the core features. Oh well. They still have some of the best tools; I just wish there were a little more support for products by the way of services-packs, patches, and add-ons. In fact, I am sure they could have charged a nominal fee ($20, $50, even $100) for the Express tools and then they would have had a budget for product support.

    Thank you.

    -- Mark Kamoski

    |||I wish I could give you a definitive answer, but as I said earlier, I switched to VS 2003 and the problem went away, so I never tried the solution proposed by Chris Lovett. Did you try naming the file "mapping-schema.xsd"? The full path would then be "Program Files\Visual Studio 8\xml\schema\mapping-schema.xsd".|||

    This is an actual microsoft.com forum - isn't there a microsoft support engineer that can give a definitive answer to the question, what xsd file contains the xml schema info for remoting configuration files?

    "Could not find schema information ..." error in XSD annotation

    When I open any annotated schema in VC# 2005 Express, I get the error:

    "Could not find schema information for the attribute 'urn:schemas-microsoft-com:mapping-schema:relation'."

    Am I missing a reference? MSXML4.0 and the SQL Client are installed on my workstation.

    An example of one of the annotated schemas I've tried is this one, from Andrew Conrad's MSDN article "A Survey of Microsoft SQL Server 2000 XML Features":

    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"

    xmlns:sql="urn:schemas-microsoft-com:mapping-schema">

    <xsd:element name="CustomerRecord" sql:relation="Customers" >

    <xsd:complexType>

    <xsd:sequence>

    <xsd:element name="Contact" sql:field="ContactName"

    type="xsd:string" />

    ... etc. All references to sql:relation, sql:field and sql:relationship produce the same error.

    How do you open it?

    Thanks

    Michael

    |||I was opening the schema in the standard editor pane and then clicking on Show Errors in one of the drop-down menus (can't remember which one that is, now). I dumped VC# 2005 Express in favor of C# in VS 2003 Enterprise, which validates the same schema with no problem. The documentation which installed with the Express edition was clearly meant for the standard VS product, anyway, and, so far, schema handling in VS 2003 appears to work as advertised.

    Best Regards,

    Mike
    |||

    I think the issue may be that the VC# 2005 editor by default expects all namespaces to have schemas associated. I am forwarding this to our schema editor experts to see what's going on.

    Thanks

    Michael

    |||

    The schema for these mapping annotations was not shipped in Visual Studio 2005. If you plop the following XSD schema into your "program files\visual studio 8\xml\schema" folder then the errors will go away:

    <?xml version="1.0" encoding="utf-8" ?>

    <xs:schema targetNamespace="urn:schemas-microsoft-com:mapping-schema"

    elementFormDefault="qualified"

    xmlns="urn:schemas-microsoft-com:mapping-schema"

    xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <xs:attribute name="encode" type="xs:anyURI">

    <xs:annotation>

    <xs:documentation>

    When an XML element or attribute is mapped to a SQL Server BLOB column, allows requesting a reference URI. This URI can be used later to return BLOB data.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="field" type="xs:string">

    <xs:annotation>

    <xs:documentation>Maps an XML item to a database column.</xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="guid" type="guid">

    <xs:annotation>

    <xs:documentation>

    Allows you to specify whether to use a GUID value generated by SQL Server or use the value provided in the updategram for that column.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="hide" type="xs:boolean">

    <xs:annotation>

    <xs:documentation>

    Hides the element or attribute that is specified in the schema in the resulting XML document.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="identity" type="guid">

    <xs:annotation>

    <xs:documentation>

    Can be specified on any node that maps to an IDENTITY-type database column. The value specified for this annotation defines how the corresponding IDENTITY-type column in the database is updated.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="inverse" type="xs:boolean">

    <xs:annotation>

    <xs:documentation>

    Instructs the updategram logic to inverse its interpretation of the parent-child relationship that has been specified using &lt;sql:relationship&gt;

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="is-constant" type="xs:boolean">

    <xs:annotation>

    <xs:documentation>

    Creates an XML element that does not map to any table. The element appears in the query output.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="key-fields" type="xs:string">

    <xs:annotation>

    <xs:documentation>

    Allows specification of column(s) that uniquely identify the rows in a table.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="limit-field" type="xs:string">

    <xs:annotation>

    <xs:documentation>

    Allows limiting the values that are returned on the basis of a limiting value.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="limit-value" type="xs:string">

    <xs:annotation>

    <xs:documentation>

    Allows limiting the values that are returned on the basis of a limiting value.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="mapped" type="xs:boolean">

    <xs:annotation>

    <xs:documentation>

    Allows schema items to be excluded from the result.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="max-depth" type="xs:positiveInteger">

    <xs:annotation>

    <xs:documentation>

    Allows you to specify depth in recursive relationships that are specified in the schema.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="overflow-field" type="xs:string">

    <xs:annotation>

    <xs:documentation>

    Identifies the database column that contains the overflow data.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="prefix" type="xs:string">

    <xs:annotation>

    <xs:documentation>

    Creates valid XML ID, IDREF, and IDREFS. Prepends the values of ID, IDREF, and IDREFS with a string.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="relation" type="xs:string">

    <xs:annotation>

    <xs:documentation>

    Maps an XML item to a database table.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="relationship" type="xs:string">

    <xs:annotation>

    <xs:documentation>

    Specifies relationships between XML elements. The parent, child, parent-key, and child-key attributes are used to establish the relationship.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="use-cdata" type="xs:boolean">

    <xs:annotation>

    <xs:documentation>

    Allows specifying CDATA sections to be used for certain elements in the XML document.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:simpleType name="guid">

    <xs:restriction base="xs:string">

    <xs:pattern value="\{[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\}"/>

    </xs:restriction>

    </xs:simpleType>

    </xs:schema>

    |||Thanks, Chris. That makes perfect sense. I saved the schema and will use it if I try VS C# Express again.

    Mike
    |||

    Fine, but where in that folder should the schema be plopped?

    Should I be able to deduce the file name from the info in the schema?

    Or doesn't the fle name matter?

    In that case, please explain the magic that allows it to be fetched in to cure the problem under discusssion

    Regards,

    Al

    |||Al -

    I'm no longer using VC# 2005 Express, but the schema name would be mapping-schema.xsd, and I think you would save it to the folder Program Files\Microsoft Visual Studio 8\Xml\Schemas.

    There's probably a way to implicitly embed a xsi:schemaLocation directive in your annotated schema, so you could put the mapping-schema in your bin\Debug folder along with the program source files, but I can't figure out what such a directive would look like.

    Good luck,

    Mike
    |||

    What should the filename be?

    |||

    Did you ever find out how the file should be named? I am having the same endless messages and i would like to get rid of them.

    Thanks,

    |||

    RoseD wrote:

    Did you ever find out how the file should be named? I am having the same endless messages and i would like to get rid of them.

    Thanks,

    No. That is still a mystery, unfortunately.

    It is absolutely ridiculous.

    Releasing a service-pack or at least a patch would be VERY simple; but, the creators obviously have moved on to bigger and better things-- that is, sadly, pretty common for MS these days-- they move on to a new technology before they have fixed Version 1 of a release product. They keep adding bells-and-whistles but they often miss the core features. Oh well. They still have some of the best tools; I just wish there were a little more support for products by the way of services-packs, patches, and add-ons. In fact, I am sure they could have charged a nominal fee ($20, $50, even $100) for the Express tools and then they would have had a budget for product support.

    Thank you.

    -- Mark Kamoski

    |||I wish I could give you a definitive answer, but as I said earlier, I switched to VS 2003 and the problem went away, so I never tried the solution proposed by Chris Lovett. Did you try naming the file "mapping-schema.xsd"? The full path would then be "Program Files\Visual Studio 8\xml\schema\mapping-schema.xsd".|||

    This is an actual microsoft.com forum - isn't there a microsoft support engineer that can give a definitive answer to the question, what xsd file contains the xml schema info for remoting configuration files?

    "Could not find schema information ..." error in XSD annotation

    When I open any annotated schema in VC# 2005 Express, I get the error:

    "Could not find schema information for the attribute 'urn:schemas-microsoft-com:mapping-schema:relation'."

    Am I missing a reference? MSXML4.0 and the SQL Client are installed on my workstation.

    An example of one of the annotated schemas I've tried is this one, from Andrew Conrad's MSDN article "A Survey of Microsoft SQL Server 2000 XML Features":

    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"

    xmlns:sql="urn:schemas-microsoft-com:mapping-schema">

    <xsd:element name="CustomerRecord" sql:relation="Customers" >

    <xsd:complexType>

    <xsd:sequence>

    <xsd:element name="Contact" sql:field="ContactName"

    type="xsd:string" />

    ... etc. All references to sql:relation, sql:field and sql:relationship produce the same error.

    How do you open it?

    Thanks

    Michael

    |||I was opening the schema in the standard editor pane and then clicking on Show Errors in one of the drop-down menus (can't remember which one that is, now). I dumped VC# 2005 Express in favor of C# in VS 2003 Enterprise, which validates the same schema with no problem. The documentation which installed with the Express edition was clearly meant for the standard VS product, anyway, and, so far, schema handling in VS 2003 appears to work as advertised.

    Best Regards,

    Mike|||

    I think the issue may be that the VC# 2005 editor by default expects all namespaces to have schemas associated. I am forwarding this to our schema editor experts to see what's going on.

    Thanks

    Michael

    |||

    The schema for these mapping annotations was not shipped in Visual Studio 2005. If you plop the following XSD schema into your "program files\visual studio 8\xml\schema" folder then the errors will go away:

    <?xml version="1.0" encoding="utf-8" ?>

    <xs:schema targetNamespace="urn:schemas-microsoft-com:mapping-schema"

    elementFormDefault="qualified"

    xmlns="urn:schemas-microsoft-com:mapping-schema"

    xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <xs:attribute name="encode" type="xs:anyURI">

    <xs:annotation>

    <xs:documentation>

    When an XML element or attribute is mapped to a SQL Server BLOB column, allows requesting a reference URI. This URI can be used later to return BLOB data.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="field" type="xs:string">

    <xs:annotation>

    <xs:documentation>Maps an XML item to a database column.</xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="guid" type="guid">

    <xs:annotation>

    <xs:documentation>

    Allows you to specify whether to use a GUID value generated by SQL Server or use the value provided in the updategram for that column.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="hide" type="xs:boolean">

    <xs:annotation>

    <xs:documentation>

    Hides the element or attribute that is specified in the schema in the resulting XML document.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="identity" type="guid">

    <xs:annotation>

    <xs:documentation>

    Can be specified on any node that maps to an IDENTITY-type database column. The value specified for this annotation defines how the corresponding IDENTITY-type column in the database is updated.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="inverse" type="xs:boolean">

    <xs:annotation>

    <xs:documentation>

    Instructs the updategram logic to inverse its interpretation of the parent-child relationship that has been specified using &lt;sql:relationship&gt;

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="is-constant" type="xs:boolean">

    <xs:annotation>

    <xs:documentation>

    Creates an XML element that does not map to any table. The element appears in the query output.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="key-fields" type="xs:string">

    <xs:annotation>

    <xs:documentation>

    Allows specification of column(s) that uniquely identify the rows in a table.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="limit-field" type="xs:string">

    <xs:annotation>

    <xs:documentation>

    Allows limiting the values that are returned on the basis of a limiting value.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="limit-value" type="xs:string">

    <xs:annotation>

    <xs:documentation>

    Allows limiting the values that are returned on the basis of a limiting value.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="mapped" type="xs:boolean">

    <xs:annotation>

    <xs:documentation>

    Allows schema items to be excluded from the result.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="max-depth" type="xs:positiveInteger">

    <xs:annotation>

    <xs:documentation>

    Allows you to specify depth in recursive relationships that are specified in the schema.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="overflow-field" type="xs:string">

    <xs:annotation>

    <xs:documentation>

    Identifies the database column that contains the overflow data.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="prefix" type="xs:string">

    <xs:annotation>

    <xs:documentation>

    Creates valid XML ID, IDREF, and IDREFS. Prepends the values of ID, IDREF, and IDREFS with a string.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="relation" type="xs:string">

    <xs:annotation>

    <xs:documentation>

    Maps an XML item to a database table.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="relationship" type="xs:string">

    <xs:annotation>

    <xs:documentation>

    Specifies relationships between XML elements. The parent, child, parent-key, and child-key attributes are used to establish the relationship.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:attribute name="use-cdata" type="xs:boolean">

    <xs:annotation>

    <xs:documentation>

    Allows specifying CDATA sections to be used for certain elements in the XML document.

    </xs:documentation>

    </xs:annotation>

    </xs:attribute>

    <xs:simpleType name="guid">

    <xs:restriction base="xs:string">

    <xs:pattern value="\{[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\}"/>

    </xs:restriction>

    </xs:simpleType>

    </xs:schema>

    |||Thanks, Chris. That makes perfect sense. I saved the schema and will use it if I try VS C# Express again.

    Mike|||

    Fine, but where in that folder should the schema be plopped?

    Should I be able to deduce the file name from the info in the schema?

    Or doesn't the fle name matter?

    In that case, please explain the magic that allows it to be fetched in to cure the problem under discusssion

    Regards,

    Al

    |||Al -

    I'm no longer using VC# 2005 Express, but the schema name would be mapping-schema.xsd, and I think you would save it to the folder Program Files\Microsoft Visual Studio 8\Xml\Schemas.

    There's probably a way to implicitly embed a xsi:schemaLocation directive in your annotated schema, so you could put the mapping-schema in your bin\Debug folder along with the program source files, but I can't figure out what such a directive would look like.

    Good luck,

    Mike
    |||

    What should the filename be?

    |||

    Did you ever find out how the file should be named? I am having the same endless messages and i would like to get rid of them.

    Thanks,

    |||

    RoseD wrote:

    Did you ever find out how the file should be named? I am having the same endless messages and i would like to get rid of them.

    Thanks,

    No. That is still a mystery, unfortunately.

    It is absolutely ridiculous.

    Releasing a service-pack or at least a patch would be VERY simple; but, the creators obviously have moved on to bigger and better things-- that is, sadly, pretty common for MS these days-- they move on to a new technology before they have fixed Version 1 of a release product. They keep adding bells-and-whistles but they often miss the core features. Oh well. They still have some of the best tools; I just wish there were a little more support for products by the way of services-packs, patches, and add-ons. In fact, I am sure they could have charged a nominal fee ($20, $50, even $100) for the Express tools and then they would have had a budget for product support.

    Thank you.

    -- Mark Kamoski

    |||I wish I could give you a definitive answer, but as I said earlier, I switched to VS 2003 and the problem went away, so I never tried the solution proposed by Chris Lovett. Did you try naming the file "mapping-schema.xsd"? The full path would then be "Program Files\Visual Studio 8\xml\schema\mapping-schema.xsd".

    "Command text was not set for the command object" Error

    Hi. I am writing a program in C# to migrate data from a Foxpro database to an SQL Server 2005 Express database. The package is being created programmatically. I am creating a separate data flow for each Foxpro table. It seems to be doing it ok but I am getting the following error message at the package validation stage:

    Description: An OLE DB Error has occured. Error code: 0x80040E0C.

    An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80040E0C Description: "Command text was not set for the command object".

    .........

    Description: "component "OLE DB Destination" (22)" failed validation and returned validation status "VS_ISBROKEN".

    This is the first time I am writing such code and I there must be something I am not doing correct but can't seem to figure it out. Any help will be highly appreciated. My code is as below:

    private bool BuildPackage()

    {

    // Create the package object

    oPackage = new Package();

    // Create connections for the Foxpro and SQL Server data

    Connections oPkgConns = oPackage.Connections;

    // Foxpro Connection

    ConnectionManager oFoxConn = oPkgConns.Add("OLEDB");

    oFoxConn.ConnectionString = sSourceConnString; // Created elsewhere

    oFoxConn.Name = "SourceConnectionOLEDB";

    oFoxConn.Description = "OLEDB Connection For Foxpro Database";

    // SQL Server Connection

    ConnectionManager oSQLConn = oPkgConns.Add("OLEDB");

    oSQLConn.ConnectionString = sTargetConnString; // Created elsewhere

    oSQLConn.Name = "DestinationConnectionOLEDB";

    oSQLConn.Description = "OLEDB Connection For SQL Server Database";

    // Add Prepare SQL Task

    Executable exSQLTask = oPackage.Executables.Add("STOCK:SQLTask");

    TaskHost thSQLTask = exSQLTask as TaskHost;

    thSQLTask.Properties["Connection"].SetValue(thSQLTask, "oSQLConn");

    thSQLTask.Properties["DelayValidation"].SetValue(thSQLTask, true);

    thSQLTask.Properties["ResultSetType"].SetValue(thSQLTask, ResultSetType.ResultSetType_None);

    thSQLTask.Properties["SqlStatementSource"].SetValue(thSQLTask, @."C:\LPFMigrate\LPF_Script.sql");

    thSQLTask.Properties["SqlStatementSourceType"].SetValue(thSQLTask, SqlStatementSourceType.FileConnection);

    thSQLTask.FailPackageOnFailure = true;

    // Add Data Flow Tasks. Create a separate task for each table.

    // Get a list of tables from the source folder

    arFiles = Directory.GetFileSystemEntries(sLPFDataFolder, "*.DBF");

    for (iCount = 0; iCount <= arFiles.GetUpperBound(0); iCount++)

    {

    // Get the name of the file from the array

    sDataFile = Path.GetFileName(arFiles[iCount].ToString());

    sDataFile = sDataFile.Substring(0, sDataFile.Length - 4);

    oDataFlow = ((TaskHost)oPackage.Executables.Add("DTS.Pipeline.1")).InnerObject as MainPipe;

    oDataFlow.AutoGenerateIDForNewObjects = true;

    // Create the source component

    IDTSComponentMetaData90 oSource = oDataFlow.ComponentMetaDataCollection.New();

    oSource.Name = (sDataFile + "Src");

    oSource.ComponentClassID = "DTSAdapter.OLEDBSource.1";

    // Get the design time instance of the component and initialize the component

    CManagedComponentWrapper srcDesignTime = oSource.Instantiate();

    srcDesignTime.ProvideComponentProperties();

    // Add the connection manager

    if (oSource.RuntimeConnectionCollection.Count > 0)

    {

    oSource.RuntimeConnectionCollection[0].ConnectionManagerID = oFoxConn.ID;

    oSource.RuntimeConnectionCollection[0].ConnectionManager = DtsConvert.ToConnectionManager90(oFoxConn);

    }

    // Set Custom Properties

    srcDesignTime.SetComponentProperty("AccessMode", 0);

    srcDesignTime.SetComponentProperty("AlwaysUseDefaultCodePage", true);

    srcDesignTime.SetComponentProperty("OpenRowset", sDataFile);

    // Re-initialize metadata

    srcDesignTime.AcquireConnections(null);

    srcDesignTime.ReinitializeMetaData();

    srcDesignTime.ReleaseConnections();

    // Create Destination component

    IDTSComponentMetaData90 oDestination = oDataFlow.ComponentMetaDataCollection.New();

    oDestination.Name = (sDataFile + "Dest");

    oDestination.ComponentClassID = "DTSAdapter.OLEDBDestination.1";

    // Get the design time instance of the component and initialize the component

    CManagedComponentWrapper destDesignTime = oDestination.Instantiate();

    destDesignTime.ProvideComponentProperties();

    // Add the connection manager

    if (oDestination.RuntimeConnectionCollection.Count > 0)

    {

    oDestination.RuntimeConnectionCollection[0].ConnectionManagerID = oSQLConn.ID;

    oDestination.RuntimeConnectionCollection[0].ConnectionManager = DtsConvert.ToConnectionManager90(oSQLConn);

    }

    // Set custom properties

    destDesignTime.SetComponentProperty("AccessMode", 2);

    destDesignTime.SetComponentProperty("AlwaysUseDefaultCodePage", false);

    destDesignTime.SetComponentProperty("OpenRowset", "[dbo].[" + sDataFile + "]");

    // Create the path to link the source and destination components of the dataflow

    IDTSPath90 dfPath = oDataFlow.PathCollection.New();

    dfPath.AttachPathAndPropagateNotifications(oSource.OutputCollection[0], oDestination.InputCollection[0]);

    // Iterate through the inputs of the component.

    foreach (IDTSInput90 input in oDestination.InputCollection)

    {

    // Get the virtual input column collection

    IDTSVirtualInput90 vInput = input.GetVirtualInput();

    // Iterate through the column collection

    foreach (IDTSVirtualInputColumn90 vColumn in vInput.VirtualInputColumnCollection)

    {

    // Call the SetUsageType method of the design time instance of the component.

    destDesignTime.SetUsageType(input.ID, vInput, vColumn.LineageID, DTSUsageType.UT_READWRITE);

    }

    //Map external metadata to the inputcolumn

    foreach (IDTSInputColumn90 inputColumn in input.InputColumnCollection)

    {

    IDTSExternalMetadataColumn90 externalColumn = input.ExternalMetadataColumnCollection.New();

    externalColumn.Name = inputColumn.Name;

    externalColumn.Precision = inputColumn.Precision;

    externalColumn.Length = inputColumn.Length;

    externalColumn.DataType = inputColumn.DataType;

    externalColumn.Scale = inputColumn.Scale;

    // Map the external column to the input column.

    inputColumn.ExternalMetadataColumnID = externalColumn.ID;

    }

    }

    }

    // Add precedence constraints to the package executables

    PrecedenceConstraint pcTasks = oPackage.PrecedenceConstraints.Add((Executable)thSQLTask, oPackage.Executables[0]);

    pcTasks.Value = DTSExecResult.Success;

    for (iCount = 1; iCount <= (oPackage.Executables.Count - 1); iCount++)

    {

    pcTasks = oPackage.PrecedenceConstraints.Add(oPackage.Executables[iCount - 1], oPackage.Executables[iCount]);

    pcTasks.Value = DTSExecResult.Success;

    }

    // Validate the package

    DTSExecResult eResult = oPackage.Validate(oPkgConns, null, null, null);

    // Check if the package was successfully executed

    if (eResult.Equals(DTSExecResult.Canceled) || eResult.Equals(DTSExecResult.Failure))

    {

    string sErrorMessage = "";

    foreach (DtsError pkgError in oPackage.Errors)

    {

    sErrorMessage = sErrorMessage + "Description: " + pkgError.Description + "\n";

    sErrorMessage = sErrorMessage + "HelpContext: " + pkgError.HelpContext + "\n";

    sErrorMessage = sErrorMessage + "HelpFile: " + pkgError.HelpFile + "\n";

    sErrorMessage = sErrorMessage + "IDOfInterfaceWithError: " + pkgError.IDOfInterfaceWithError + "\n";

    sErrorMessage = sErrorMessage + "Source: " + pkgError.Source + "\n";

    sErrorMessage = sErrorMessage + "Subcomponent: " + pkgError.SubComponent + "\n";

    sErrorMessage = sErrorMessage + "Timestamp: " + pkgError.TimeStamp + "\n";

    sErrorMessage = sErrorMessage + "ErrorCode: " + pkgError.ErrorCode;

    }

    MessageBox.Show("The DTS package was not built successfully because of the following error(s):\n\n" + sErrorMessage, "Package Builder", MessageBoxButtons.OK, MessageBoxIcon.Information);

    return false;

    }

    // return a successful result

    return true;

    }

    So the OLE-DB Destination is not happy and I cannot see anything obvious. A better way to debug this would be to just add a Save method before validation to save your package to disk. You can then open it in Visual Studio/BIDS, and enjoy the full GUI experience to help find the problem. I've found this method very useful for just checking packages when building programmatically.

    |||

    I have inserted code to save the package just before the validation but it throws an exception. And I don't find the help in MSDN very useful!! I want to save the package in the folder C:\LPFMigrate and call it Package.dtsx. The code is as follows:

    oApp = new Microsoft.SqlServer.Dts.Runtime.Application();

    oApp.SaveToDtsServer(oPackage, null, @."C:\LPFMigrate\Package", "MARS");

    Any idea why an exception is being thrown? The exception message is:

    The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))

    Sunday, February 19, 2012

    "A transport-level error has occurred..." When linking a server.

    I just installed Microsoft SQL Server Express SP2. I setup a linked server to an Oracle database using the followings commands:

    EXEC sp_addlinkedserver 'Oracle_DEV', 'Oracle', 'MSDAORA', 'DEV'

    EXEC sp_addlinkedsrvlogin 'Oracle_DEV ', false, NULL, 'oracledbuser', 'dbuserpassword'

    When I try and query the linked database I get the following error message:

    Msg 109, Level 20, State 0, Line 0
    A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 0 - The pipe has been ended.)

    I've been searching the web and have gotten a lot of hits on the error message but have yet to uncover anything specifically related to linked servers or anything closely related enough to help me resolve this problem. Any advice would be appreciated. Thanks.I am having the exact same problem as you.. I am still trying to find a solution.. I will let you know if I do.. also if you find a solution could you post it here. Thanks|||

    This is more of a general engine issue so I'm going to move it to that forum.

    Mike

    |||

    I seem to have solved the problem.. I changed the registry settings for

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSDTC\MTxOCI

    OracleSqlLib = orasql10.dll

    OracleXaLib = oraclient10.dll

    then in Admin tools / services. I stopped and started SQL server Express & SQL Server browser (not sure if this did anything - but just letting you know what worked for me)

    I am now able to query the oracle database.

    One thing though - it is a lot slower than using MS Access and an ODBC passthrough query

    Thursday, February 16, 2012

    <<SQL2k5>>

    Can I have SQL2k5, Sql2k2, Sql2k5 Express Edition installed and functioning
    correctly on 1 box?
    TIA> Can I have SQL2k5, Sql2k2, Sql2k5 Express Edition installed and
    functioning
    > correctly on 1 box?
    From
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsse/html/sseoverview.asp:
    Multiple SQL Server 2005 Express installations can coexist on the same
    machine along with other installations of SQL Server 2000, SQL Server 2005,
    or Microsoft Desktop Engine (MSDE). In general, it is best that SQL Server
    2000 instances be upgraded to SP3a or higher. The maximum limit to the
    number of SQL instances is 50 on the same machine. These instances must be
    uniquely named for the purpose of identifying them.
    Still, be aware that SQL 2005 is in Beta version, so you might experience
    problems. I prefer installing beta versions in a virtual machine.
    --
    Dejan Sarka, SQL Server MVP
    Associate Mentor
    www.SolidQualityLearning.com

    <<SQL2k5>>

    Can I have SQL2k5, Sql2k2, Sql2k5 Express Edition installed and functioning
    correctly on 1 box?
    TIA
    > Can I have SQL2k5, Sql2k2, Sql2k5 Express Edition installed and
    functioning
    > correctly on 1 box?
    From
    http://msdn.microsoft.com/library/de...eoverview.asp:
    Multiple SQL Server 2005 Express installations can coexist on the same
    machine along with other installations of SQL Server 2000, SQL Server 2005,
    or Microsoft Desktop Engine (MSDE). In general, it is best that SQL Server
    2000 instances be upgraded to SP3a or higher. The maximum limit to the
    number of SQL instances is 50 on the same machine. These instances must be
    uniquely named for the purpose of identifying them.
    Still, be aware that SQL 2005 is in Beta version, so you might experience
    problems. I prefer installing beta versions in a virtual machine.
    Dejan Sarka, SQL Server MVP
    Associate Mentor
    www.SolidQualityLearning.com

    <<SQL2k5>>

    Can I have SQL2k5, Sql2k2, Sql2k5 Express Edition installed and functioning
    correctly on 1 box?
    TIA> Can I have SQL2k5, Sql2k2, Sql2k5 Express Edition installed and
    functioning
    > correctly on 1 box?
    From
    http://msdn.microsoft.com/library/d... />
    rview.asp:
    Multiple SQL Server 2005 Express installations can coexist on the same
    machine along with other installations of SQL Server 2000, SQL Server 2005,
    or Microsoft Desktop Engine (MSDE). In general, it is best that SQL Server
    2000 instances be upgraded to SP3a or higher. The maximum limit to the
    number of SQL instances is 50 on the same machine. These instances must be
    uniquely named for the purpose of identifying them.
    Still, be aware that SQL 2005 is in Beta version, so you might experience
    problems. I prefer installing beta versions in a virtual machine.
    Dejan Sarka, SQL Server MVP
    Associate Mentor
    www.SolidQualityLearning.com

    Saturday, February 11, 2012

    #URGENT# Remote Connections to Server

    Hi, I've been trying all day to make connections to SQL server 2005 express work. I have gone throgh the setup of tcp/ip, firewall exceptions, and anything else possible. My problem is that after i have gone through the microsoft support pages.

    I can connect to SQL server in VS2005 but i can connect and make changes to databases with SQL Server Management Studio. In VS2005 i try to connect and i get the error System.Data.SqlClient.SqlException

    Message="An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Shared Memory Provider, error: 40 - Could not open a connection to SQL Server)"

    I have to write a program by the end of the week and cannot proceed without SQL Server working proerly. Any replies would be apreciated as i am so fustrated with this problem. I have included the full error stack below if it is required. Contact me for any more details

    Regards
    Matt

    System.Data.SqlClient.SqlException was unhandled
    Class=20
    ErrorCode=-2146232060
    LineNumber=0
    Message="An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Shared Memory Provider, error: 40 - Could not open a connection to SQL Server)"
    Number=2
    Server=""
    Source=".Net SqlClient Data Provider"
    State=0
    StackTrace:
    at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
    at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
    at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)
    at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
    at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
    at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
    at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
    at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
    at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
    at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
    at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
    at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
    at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
    at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
    at System.Data.SqlClient.SqlConnection.Open()
    at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
    at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
    at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
    at Tour_Operator.DataSet1TableAdapters.ToursTableAdapter.Fill(ToursDataTable dataTable) in C:\Documents and Settings\Matty\My Documents\Visual Studio 2005\Projects\Computermat-IT\Tour Operator\Print\DataSet1.Designer.vb:line 1332
    at Tour_Operator.main.main_Load(Object sender, EventArgs e) in C:\Documents and Settings\Matty\My Documents\Visual Studio 2005\Projects\Computermat-IT\Tour Operator\main.vb:line 18
    at System.EventHandler.Invoke(Object sender, EventArgs e)
    at System.Windows.Forms.Form.OnLoad(EventArgs e)
    at System.Windows.Forms.Form.OnCreateControl()
    at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
    at System.Windows.Forms.Control.CreateControl()
    at System.Windows.Forms.Control.WmShowWindow(Message& m)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
    at System.Windows.Forms.ContainerControl.WndProc(Message& m)
    at System.Windows.Forms.Form.WmShowWindow(Message& m)
    at System.Windows.Forms.Form.WndProc(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)
    at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
    at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
    at System.Windows.Forms.Control.set_Visible(Boolean value)
    at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
    at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
    at System.Windows.Forms.Application.Run(ApplicationContext context)
    at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
    at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
    at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
    at Tour_Operator.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
    at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
    at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
    at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
    at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
    at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
    at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
    at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    at System.Threading.ThreadHelper.ThreadStart()
    Hi check the following things.

    1.) check the servername displayed in SSMS (eg.servername\SQLEXPRESS) while connecting and use the same servername in vb code.
    2.) By which authentication mode you are connecting (windows or SQL), if its SQL , the check SQLEXPRESS is configured in mixed mode
    3.) Check SQL services are up

    |||Hi, thanks for the reply. However, i have sorted the problem, dont know what was cuasing becuase i could connect to the database with the SMSE but not vs2005. I have reformatted my server machine and reinstalled everything and it works fine now. The first time i installed sql server i had to do it many times as it was error after error so maybe a currupt file caused my problem with connections.

    Still strange with connection becuase i can fully connect to the database in vs2005 but if i run the "OSQL" cmd test it doesn't connect.

    But thanks anyway for replying.

    Regards
    Matt
    |||What is the error message you are getting while connect using OSQL?

    Try connect with SQLCMD , this shoud work
    |||

    Under SQL Server Surface Area Configuration Manager, check if Remote Connections are Enabled via Named Pipes and TCP/IP

    Also, verify that the Protocols TCP/IP, Named Pipes are enabled from SQL Server Configuration Manager