Showing posts with label xml. Show all posts
Showing posts with label xml. Show all posts

Friday, March 30, 2012

How to Execute a DiffGram

This article on MSDN:

"Microsoft SQL Server 9.0 Technical Articles, XML Options in Microsoft SQL Server 2005"


states that it is possible to execute a DiffGram using SqlXmlCommand. However, when I execute this code:


static string NorthwindConnString = "Provider=SQLOLEDB;Server=NJSQL06;database=Interlink_GISLink90;Integrated Security=SSPI";
SqlXmlCommand cmd = new SqlXmlCommand(NorthwindConnString);
cmd.CommandStream = new FileStream(@."C:\Development\SQLXML\ApplyDiffGram\ApplyDiffGram\bin\Debug\DiffGramFile.xml", FileMode.Open, FileAccess.Read);
cmd.CommandType = SqlXmlCommandType.DiffGram;
cmd.SchemaPath = @."C:\Development\SQLXML\ApplyDiffGram\ApplyDiffGram\bin\Debug\XSDTypedSchema.xsd";
cmd.ExecuteNonQuery();


I get this error message:

"Empty update, no updatable rows found"

My DiffGram and mapping-schema are pasted below. Does anyone know what I'm doing wrong?


--Nancy

This is my DiffGram:

<ROOT xmlns:sql="urn:schemas-microsoft-com:xml-sql" sql:mapping-schema="XSDTypedSchema.xsd">
<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
<Interlink_GISLink90DataSet>
<GISVessel diffgr:id="GISVessel1" msdata:rowOrder="0" diffgr:hasChanges="modified">
<Vessel_id>2578</Vessel_id>
<Name>SHENG FENG</Name>
<DOT_Number>2578</DOT_Number>
<gb_DB_ID>71</gb_DB_ID>
<gb_DBID_PK>2578</gb_DBID_PK>
<gb_DB_OWNER_ID>156</gb_DB_OWNER_ID>
<Logical_Cancel_Value>0</Logical_Cancel_Value>
<GB_DB_TimeStamp>2002-04-24T14:11:00.943Z</GB_DB_TimeStamp>
<Alias_Name>SHENG FENG </Alias_Name>
<Year_Built>1995</Year_Built>
<Ex_Name>SHENG FENG</Ex_Name>
<Freight_Code>SHFEN</Freight_Code>
<Vessel_State>C</Vessel_State>
<Comments>John Adams</Comments>
<Ownership_Type_id>4</Ownership_Type_id>
</GISVessel>
</Interlink_GISLink90DataSet>
<diffgr:before>
<GISVessel diffgr:id="GISVessel1" msdata:rowOrder="0">
<Vessel_id>2578</Vessel_id>
<Name>SHENG FENG</Name>
<DOT_Number>2578</DOT_Number>
<gb_DB_ID>71</gb_DB_ID>
<gb_DBID_PK>2578</gb_DBID_PK>
<gb_DB_OWNER_ID>156</gb_DB_OWNER_ID>
<Logical_Cancel_Value>0</Logical_Cancel_Value>
<GB_DB_TimeStamp>2000-01-12T10:09:00.943Z</GB_DB_TimeStamp>
<Alias_Name>SHENG FENG </Alias_Name>
<Year_Built>1995</Year_Built>
<Ex_Name>SHENG FENG</Ex_Name>
<Freight_Code>SHFEN</Freight_Code>
<Vessel_State>C</Vessel_State>
<Comments>Edmund Burke</Comments>
<Ownership_Type_id>4</Ownership_Type_id>
</GISVessel>
</diffgr:before>
</diffgr:diffgram>
</ROOT>

This is my mapping schema inside XSDTypedSchema.xsd:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="GISVessel">
<xs:complexType>
<xs:sequence>
<xs:element msdata:ReadOnly="true" msdata:AutoIncrement="true" name="Vessel_id" type="xs:int" />
<xs:element name="Name">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="28" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="Lloyds_No">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="7" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="DOT_Number">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="16" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="Call_Sign">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="9" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="gb_DB_ID" type="xs:int" />
<xs:element name="gb_DBID_PK" type="xs:int" />
<xs:element name="gb_DB_OWNER_ID" type="xs:int" />
<xs:element name="Logical_Cancel_Value" type="xs:int" />
<xs:element name="GB_DB_TimeStamp" type="xs:dateTime" />
<xs:element name="Alias_Name">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="28" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="Net_Tonnage_mt" type="xs:double" />
<xs:element minOccurs="0" name="Gross_Tonnage_mt" type="xs:double" />
<xs:element minOccurs="0" name="Registry_Flag">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="Vessel_Registration_Date" type="xs:dateTime" />
<xs:element minOccurs="0" name="Vessel_Registry_Location_id" type="xs:int" />
<xs:element minOccurs="0" name="Place_Built_Country_id" type="xs:int" />
<xs:element minOccurs="0" name="Year_Built" type="xs:int" />
<xs:element minOccurs="0" name="Official_Number">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="12" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="Ex_Name">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="28" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="Vessel_Type">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="1" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="IMO_Number">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="12" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="Hull_Number" type="xs:int" />
<xs:element minOccurs="0" name="Building_Yard_id" type="xs:int" />
<xs:element minOccurs="0" name="Freight_Code">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="5" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Vessel_State">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="1" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="Registry_Country_id" type="xs:int" />
<xs:element minOccurs="0" name="Comments">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="500" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Ownership_Type_id" type="xs:int" />
<xs:element minOccurs="0" name="GVA_Hull_Id" type="xs:int" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GISVoyage">
<xs:complexType>
<xs:sequence>
<xs:element msdata:ReadOnly="true" msdata:AutoIncrement="true" name="Voyage_id" type="xs:int" />
<xs:element name="Vessel_id" type="xs:int" />
<xs:element name="gb_DB_ID" type="xs:int" />
<xs:element name="gb_DBID_PK" type="xs:int" />
<xs:element name="gb_DB_OWNER_ID" type="xs:int" />
<xs:element name="Logical_Cancel_Value" type="xs:int" />
<xs:element name="GB_DB_TimeStamp" type="xs:dateTime" />
<xs:element minOccurs="0" name="Approved_Date" type="xs:dateTime" />
<xs:element name="Last_Update_Date" type="xs:dateTime" />
<xs:element minOccurs="0" name="Last_Update_SecUser_id" type="xs:int" />
<xs:element name="Completed_For_Replication">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="1" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Vessel_Name">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="28" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Vessel_Alias_Name">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="28" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="Sch_Proforma_id" type="xs:int" />
<xs:element name="Alternate_Ship_type" type="xs:boolean" />
<xs:element name="Voyage_Number_Retired" type="xs:int" />
<xs:element minOccurs="0" name="Rotation_id" type="xs:int" />
<xs:element minOccurs="0" name="Sch_Proforma_GUID">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="TBA" type="xs:boolean" />
<xs:element minOccurs="0" name="Special_Loader_Grid_id" type="xs:int" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GISVoyage_Port_Call">
<xs:complexType>
<xs:sequence>
<xs:element msdata:ReadOnly="true" msdata:AutoIncrement="true" name="Voyage_Port_Call_id" type="xs:int" />
<xs:element name="Voyage_id" type="xs:int" />
<xs:element name="Sequence_Number" type="xs:short" />
<xs:element name="Port_id" type="xs:int" />
<xs:element minOccurs="0" name="Actual_Arrival_Time" type="xs:dateTime" />
<xs:element minOccurs="0" name="Actual_Departure_Time" type="xs:dateTime" />
<xs:element minOccurs="0" name="Estimated_Arrival_Time" type="xs:dateTime" />
<xs:element minOccurs="0" name="Estimated_Departure_Time" type="xs:dateTime" />
<xs:element name="Bypassed_Canceled" type="xs:boolean" />
<xs:element name="gb_DB_ID" type="xs:int" />
<xs:element name="gb_DBID_PK" type="xs:int" />
<xs:element name="gb_DB_TimeStamp" type="xs:dateTime" />
<xs:element name="Is_Import_Call" type="xs:boolean" />
<xs:element name="Is_Export_Call" type="xs:boolean" />
<xs:element minOccurs="0" name="Cut_Off_Date" type="xs:dateTime" />
<xs:element name="Logical_Cancel_Value" type="xs:int" />
<xs:element minOccurs="0" name="Voyage_Export_Suffix">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="1" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="Voyage_Import_Suffix">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="1" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="Commercial_Arrival_Time" type="xs:dateTime" />
<xs:element minOccurs="0" name="Commercial_Departure_Time" type="xs:dateTime" />
<xs:element name="Extra_Call" type="xs:boolean" />
<xs:element minOccurs="0" name="Sch_Proforma_Port_id" type="xs:int" />
<xs:element minOccurs="0" name="Buffer_Remaining_Mins" type="xs:int" />
<xs:element minOccurs="0" name="Bypassed_Reason">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="255" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="Delete_Type">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="1" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Display_Sequence_Number" type="xs:short" />
<xs:element name="Is_Transit_Call" type="xs:boolean" />
<xs:element minOccurs="0" name="Export_Documentation_Voyage_Number">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="10" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="Export_DTX_Voyage_Number">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="10" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="Import_Documentation_Voyage_Number">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="10" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" name="Import_DTX_Voyage_Number">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="10" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Voyage_Number_Change" type="xs:boolean" />
</xs:sequence>
</xs:complexType>
<xs:unique msdata:PrimaryKey="true" name="Constraint1">
<xs:selector xpath=".//GISVessel" />
<xs:field xpath="Vessel_id" />
</xs:unique>
<xs:unique msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true" name="GISVoyage_Constraint1">
<xs:selector xpath=".//GISVoyage" />
<xs:field xpath="Voyage_id" />
</xs:unique>
<xs:unique msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true" name="GISVoyage_Port_Call_Constraint1">
<xs:selector xpath=".//GISVoyage_Port_Call" />
<xs:field xpath="Voyage_Port_Call_id" />
</xs:unique>
</xs:element>
<xs:annotation>
<xs:appinfo>
<msdata:Relationship name="X_VOYG_VSSL_Vessel_id" msdata:parent="GISVessel" msdata:child="GISVoyage" msdata:parentkey="Vessel_id" msdata:childkey="Vessel_id" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" />
<msdata:Relationship name="X_PCAL_VOYG_Voyage_id" msdata:parent="GISVoyage" msdata:child="GISVoyage_Port_Call" msdata:parentkey="Voyage_id" msdata:childkey="Voyage_id" />
</xs:appinfo>
</xs:annotation>
</xs:schema>

None of your elements appear to be mapped to any tables. use the "msdata:relation" annotation to map an element to a table.|||

This error message means that you have specified a row to update, but that the row to be updated could not be found in the database. So the "before" image matched 0 rows in the database. This means either the data in the database has changed, or there are some conversion issues between the data in the diffgram and the data in the database that is causing the rows not to match.

You can try to use SQL Query analyzer to capture the SQL and see which column (or columns) are not matching, or you can try to modify the diffgram to see which colum is causing the problem.

I have a feeling that the problem may be the datetime column. One thing to try is to modify the schema to be:

<xs:element name="GB_DB_TimeStamp" type="xs:dateTime" msdata:datatype="dateTime"/>

This will let SQLXML know to do a datetime specific comparison on the SQL Server.

Hope this helps,

Todd

Wednesday, March 21, 2012

How to Eliminate Nodes with Null values?

I need to shred the xml data to retrieve BrandIDs based on the following business rules.

/**************************************************************************************************************************

(1) Not every instance of xml would contain BrandIDs node

(2) Ignore BrandIDs whenever its a descendant of AlternativeState

(3) We are interested in the data stored under MarketSize whenever the CurrentEvent node is MarketSize.

(4) We are interested in the data stored under OtherEvent whenever the CurrentEvent node is not MarketSize.

****************************************************************************************************************************/

While shredding the xml data, I have noticed that out of 200,000 xml rows there are only 1000 BrandIDs nodes that do actually have data in them (e.g. <BrandIDs> 123, 234</BrandIDs>. Others are just blank in the form of </BrandIDs>. I would like to modify XQuery given below so that I could filter out such rows where even though BrandIDs node exist but it has no scalar value for me to retrieve. From the sample query result given at the end you would notice that the third row is empty. I would like to avoid such rows in result set.

I am open to any suggestions here if anyone out there could come up with a better solution.

declare @.xml xml

set @.xml =

'

<State>

<StatsState>

<CurrentState>

<BrandIDs>2698741</BrandIDs>

</CurrentState>

</StatsState>

</State>

<State>

<StatsState>

<CurrentState>

<OtherEvents>

<BrandIDs>160603,160737</BrandIDs>

</OtherEvents>

<CurrentEvent>BrandShare</CurrentEvent>

</CurrentState>

</StatsState>

</State>

<State>

<StatsState>

<CurrentState>

<MarketSize>

<BrandIDs />

<AlternativeState>

<CurrentEvent>None</CurrentEvent>

<BrandIDs>25630,8956201</BrandIDs>

</AlternativeState>

<CompanyIDs />

</MarketSize>

<CurrentEvent>MarketSize</CurrentEvent>

</CurrentState>

</StatsState>

</State>

<State>

<StatsState>

<CurrentState>

<OtherEvents>

<BrandIDs>2001,2002,2003,2004,2005,2006</BrandIDs>

</OtherEvents>

<CurrentEvent>BrandShare</CurrentEvent>

<MarketSize>

<BrandIDs>40666,71788,201225</BrandIDs>

</MarketSize>

</CurrentState>

</StatsState>

</State>

'

SELECT

Element.Val.query(

'for $s in self::node()

where $s//*/BrandIDs[not(parent::AlternativeState)]

return

if (data(($s/StatsState/CurrentState/CurrentEvent)[1]) = "MarketSize")

then $s/StatsState/CurrentState/MarketSize/BrandIDs/text()

else (

if (data(($s/StatsState/CurrentState/CurrentEvent)[1]) != "MarketSize")

then $s/StatsState/CurrentState/OtherEvents/BrandIDs/text()

else $s//BrandIDs/text())

') AS BrandIDs

FROM @.xml.nodes('/State') AS Element(Val)

GO

BrandIDs

-

2698741

160603,160737

2001,2002,2003,2004,2005,2006

If an element is empty then it does not have any child nodes meaning you can check with e.g. BrandIDs[node()] for BrandIDs elements that are not empty.

So your query could be written as

Code Snippet

SELECT

Element.Val.query(

'for $s in self::node()

return

if (data(($s/StatsState/CurrentState/CurrentEvent)[1]) = "MarketSize")

then $s/StatsState/CurrentState/MarketSize/BrandIDs/text()

else (

if (data(($s/StatsState/CurrentState/CurrentEvent)[1]) != "MarketSize")

then $s/StatsState/CurrentState/OtherEvents/BrandIDs/text()

else $s//BrandIDs/text())

') AS BrandIDs

FROM @.xml.nodes('/State[.//*/BrandIDs[node() and not(parent::AlternativeState)]]') AS Element(Val)

|||

Hi marton,

Thanks once more for helping me out here. Your proposed solution does solve my problem. Is there any way that perhaps you could use the 'where' clause in FLWOR to apply the same condition? I actually have a requirement to use @.xml.nodes('/State'). I do have different set of FLWOR queries to read values for different nodes and for each the root node is always /State and I would need to combine all of them in one statement. So preferably I would like to keep the nodes clause pointing to root.

Hope you get my point.

thanks again

|||The problem is that the nodes methods shreds the xml variable into rows that you then query with the query method. So for the original example you got four rows in the result set as the nodes method yields four rows, independent of the query applied later to the each row. If you want to eliminate nodes to not yield rows at all then I think it as to be done with the nodes method.|||

Hi Martin,

Thanks for clarification. I understand your point.

I actually works with xml where each of the node goes to its own relational table and I wanted to have only one select statement where each xml row is read only once and I get all of the values for nodes by specifying any business rules within FLWOR there. Hence I hesitate to specify any specific node such as BrandIDs in nodes() because it wouldn't leave an option for me to work with other nodes. I think I would have to use function for each node and call them from my select statement.

Many thanks

How to editing XML file through script tack in SSIS (Integration Service) 2005

Please help me with editing a XML file through script tack in SSIS (Integration Service) 2005

Thank you

Here are some articles to start with:

http://www.microsoft.com/technet/prodtechnol/sql/2005/intro2is.mspx
http://sqljunkies.com/WebLog/knight_reign/default.aspx

Monday, March 19, 2012

How to editing XML file through script tack in SSIS (Integration Service) 2005

Please help me with editing a XML file through script tack in SSIS (Integration Service) 2005

Thank you

Here are some articles to start with:

http://www.microsoft.com/technet/prodtechnol/sql/2005/intro2is.mspx
http://sqljunkies.com/WebLog/knight_reign/default.aspx

Wednesday, March 7, 2012

How to do XML Configuration With Different Connection Manager in SSIS

Hi

I want know how to config SSIS Package With different connection Manager.

Sample .

When Design time i gave The Connection Manager(Devlopement Server) Name : STG1.XXXSchema

Server Name STG.ssss

Password : xxxxx

I make the The XML configuration file .

after deploy the Package i want from Development Server to Production Server . so i will change the Package Config File Open wiht Notepad .

Server Name STG.qqq

Password :xxxxxx

after Edit Connection String I run the Package . It Always Taking Whatever igave the Connection String When Design time only .is not taking what connection string edit hte in the Package Config File. Please Any one give the Solution .

How we can Change the connection string in XML Config File .Whne I tested . It always taking what ever we given in the Desing Time .

Thanks & Regards,

Jeyakumar .M

The whole point of configurations is that it should work like this, changing the file, means that the new value is read.

Obvious things to check are that the config file is in the correct location and is being read. When you run a package, if it cannot find the config file, it will raise a warning event. Depending on how you execute this may not be visible, but you can easily turn on logging to ensure you do capture this information. What warning events do you get?

You can also check that the package is using configuration correctlyon development, by looking in the log. You shoudl see an OnInformation event like this-

The package is attempting to configure from the XML file "E:\MyConfigdtsConfig".

If you cannot see this on development, then there is obviously a problem with the way you have setup the configuration to start with.

|||

Hi thanks for your reply message. Hi i need help from yourside. how to enable the Log or how to view the log. can you send me the Detail . what ever ur previuos answer . how can i view the log. or how to create the log and see the information .

Thanks & Regards,

Jeyakumar.M

How to do XML Configuration With Different Connection Manager in SSIS

Hi

I want know how to config SSIS Package With different connection Manager.

Sample .

When Design time i gave The Connection Manager(Devlopement Server) Name : STG1.XXXSchema

Server Name STG.ssss

Password : xxxxx

I make the The XML configuration file .

after deploy the Package i want from Development Server to Production Server . so i will change the Package Config File Open wiht Notepad .

Server Name STG.qqq

Password :xxxxxx

after Edit Connection String I run the Package . It Always Taking Whatever igave the Connection String When Design time only .is not taking what connection string edit hte in the Package Config File. Please Any one give the Solution .

How we can Change the connection string in XML Config File .Whne I tested . It always taking what ever we given in the Desing Time .

Thanks & Regards,

Jeyakumar .M

The whole point of configurations is that it should work like this, changing the file, means that the new value is read.

Obvious things to check are that the config file is in the correct location and is being read. When you run a package, if it cannot find the config file, it will raise a warning event. Depending on how you execute this may not be visible, but you can easily turn on logging to ensure you do capture this information. What warning events do you get?

You can also check that the package is using configuration correctlyon development, by looking in the log. You shoudl see an OnInformation event like this-

The package is attempting to configure from the XML file "E:\MyConfigdtsConfig".

If you cannot see this on development, then there is obviously a problem with the way you have setup the configuration to start with.

|||

Hi thanks for your reply message. Hi i need help from yourside. how to enable the Log or how to view the log. can you send me the Detail . what ever ur previuos answer . how can i view the log. or how to create the log and see the information .

Thanks & Regards,

Jeyakumar.M

How to do with xml file -> schema file (funcion in . NET)

I use a BulkLoad to import file.xml to my base MS Server 2000.
To import this xml file I need schema file. Mayby you know how to do this
file mechanicy f.g. mayby somebody have some script in .net who generate
this schema.
for any help Thanks
======== My xml file =================================
<ROOT>
<Customers>
<CustomerId>5555</CustomerId>
<CompanyName>Jagoda1</CompanyName>
<City>NY</City>
</Customers>
<Customers>
<CustomerId>0200</CustomerId>
<CompanyName>Tom Johnston</CompanyName>
<City>LA</City>
</Customers>
<Customers>
<CustomerId>199</CustomerId>
<CompanyName>Institute of Art</CompanyName>
</Customers>
</ROOT>
=================================================
My schema . How to do this schema mechanicy? Becouse in this time I must do
this schema ofcourse writing.
============================== MY Schema file ===============
<?xml version="1.0" ?>
<Schema xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:dt="urn:schemas-microsoft-com:xml:datatypes"
xmlns:sql="urn:schemas-microsoft-com:xml-sql" >
<ElementType name="CustomerId" dt:type="int" />
<ElementType name="CompanyName" dt:type="string" />
<ElementType name="City" dt:type="string" />
<ElementType name="ROOT" sql:is-constant="1">
<element type="Customers" />
</ElementType>
<ElementType name="Customers" sql:relation="Customer">
<element type="CustomerId" sql:field="CustomerId" />
<element type="CompanyName" sql:field="CompanyName" />
<element type="City" sql:field="City" />
</ElementType>
</Schema>
================================================== ======
Do you have any idea ?
Sorry for my english
Luk
ljag@.wp.pl
Hi
couple of options:
1. http://apps.gotdotnet.com/xmltools/xsdinference/
2. look at the (Select) 'FOR XML' options with SQL Srvr (some options can
gen schema)
3. if you don't have VS.NET, probably your best (freebie) is XML Fox
(XML/XSD Editor). (Only 1 I could find that would actually load in the XML
files I work with most of the time. (30+ MB) This includes DreamWeaver,
VS.NET, Eclipse, JBuilder, etc.)
4. if you have VS.NET, open your XML file and there's a 'create Schema'
option, under the XML Menu option
Rob
"Szaki" wrote:

> I use a BulkLoad to import file.xml to my base MS Server 2000.
> To import this xml file I need schema file. Mayby you know how to do this
> file mechanicy f.g. mayby somebody have some script in .net who generate
> this schema.
> for any help Thanks
> ======== My xml file =================================
> <ROOT>
> <Customers>
> <CustomerId>5555</CustomerId>
> <CompanyName>Jagoda1</CompanyName>
> <City>NY</City>
> </Customers>
> <Customers>
> <CustomerId>0200</CustomerId>
> <CompanyName>Tom Johnston</CompanyName>
> <City>LA</City>
> </Customers>
> <Customers>
> <CustomerId>199</CustomerId>
> <CompanyName>Institute of Art</CompanyName>
> </Customers>
> </ROOT>
> =================================================
> My schema . How to do this schema mechanicy? Becouse in this time I must do
> this schema ofcourse writing.
> ============================== MY Schema file ===============
> <?xml version="1.0" ?>
> <Schema xmlns="urn:schemas-microsoft-com:xml-data"
> xmlns:dt="urn:schemas-microsoft-com:xml:datatypes"
> xmlns:sql="urn:schemas-microsoft-com:xml-sql" >
> <ElementType name="CustomerId" dt:type="int" />
> <ElementType name="CompanyName" dt:type="string" />
> <ElementType name="City" dt:type="string" />
> <ElementType name="ROOT" sql:is-constant="1">
> <element type="Customers" />
> </ElementType>
> <ElementType name="Customers" sql:relation="Customer">
> <element type="CustomerId" sql:field="CustomerId" />
> <element type="CompanyName" sql:field="CompanyName" />
> <element type="City" sql:field="City" />
> </ElementType>
> </Schema>
> ================================================== ======
>
> Do you have any idea ?
> Sorry for my english
> --
> Luk
> ljag@.wp.pl
>
>
|||Thanks
Uytkownik "RobKaratzas" <RobKaratzas@.discussions.microsoft.com> napisa w
wiadomoci news:A489D834-8451-4E04-B489-FEFACB3E6CEB@.microsoft.com...[vbcol=seagreen]
> Hi
> couple of options:
> 1. http://apps.gotdotnet.com/xmltools/xsdinference/
> 2. look at the (Select) 'FOR XML' options with SQL Srvr (some options can
> gen schema)
> 3. if you don't have VS.NET, probably your best (freebie) is XML Fox
> (XML/XSD Editor). (Only 1 I could find that would actually load in the XML
> files I work with most of the time. (30+ MB) This includes DreamWeaver,
> VS.NET, Eclipse, JBuilder, etc.)
> 4. if you have VS.NET, open your XML file and there's a 'create Schema'
> option, under the XML Menu option
> Rob
> "Szaki" wrote:
this[vbcol=seagreen]
do[vbcol=seagreen]