Showing posts with label file. Show all posts
Showing posts with label file. Show all posts

Friday, March 30, 2012

how to insert only distinct values from a Flat File

I have to insert the Values from the Flat Files , My table structures have Primary keys , how do i insert only the distinct values into the table without the ERROR VIOLATION OF Primary Key already exists a record.

Dropping and Adding Relationships after insert is a way but doesnt serve the whole purpose is there a way we can eliminate duplicate records based on their Primary key before inserting them into the Database.

You can do a lookup against your target table. Redirect the error output and send these rows to a sql destination for the target table (i.e. if the lookup didn't find it, it is a new row)

See the following thread...

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1211340&SiteID=1|||

Sort transformation has a check box that allows you to eliminate duplicates; another approach could be to use a agregation transformation.|||Thanks for the Quick Solutions i will do that and come back with the feedback, what about the performance which one is better the sort or Aggregates using group by or Lookup|||Are there duplicate primary key's in your flat file? If so you will need to go with either the aggregate or sort solutions (I may have misread your question, the lookup will find any primary keys already in the table before you start to insert your new records). I don't know which of these will be more effecient for you, but you can always try them both out for a few test runs and see for yourself as it will often depend on environment and data being loaded as to which will come out ahead.|||

The Lookup approach will not detect duplicates within the batch being processed. You would need to change it to no-cache mode. Sort and aggregation transformation should be give you about the same performance. In general the no-cache lookup, sort or aggregation approach are not great from the performance standpoint; but that would depend on many factors; so test and measure yourself.

Sort/aggregation transformation cache the full set of rows in RAM; so if the volume of data to be de-duplicated is huge; the system could run out of memory.

An alternative could be to use an staging table and then let the DB engine to do the dedup work. (e.g. http://rafael-salas.blogspot.com/2007/04/remove-duplicates-using-t-sql-rank.html )|||

I got to filter out the distinct values using aggregate transformation but i am unsure baout how to get all the columns into the output ... as the Aggregate is returning only the columns used to get the distinct on the Primary Keys.

|||There are two fundamentals being discussed in this thread. We've yet to get the crucial question answered though:

Are you trying to dedupe the source data before going into the destination table, or are you trying to prevent duplicate records from getting inserted (unique data from the source, but not necessarily all unique in the destination) and hence raising a primary key violation?

Deduping the source data can be done with an aggregate or the sort transformations. You could also load the data into a staging table (as Rafael stated) and then run a SQL statement against that data (select DISTINCT perhaps). Using the techniques described in the thread linked to earlier, you can ensure that your data does not violate primary keys by using a lookup. Note that you may have to do a combination of all of the above.|||

Dev2624 wrote:

I got to filter out the distinct values using aggregate transformation but i am unsure baout how to get all the columns into the output ... as the Aggregate is returning only the columns used to get the distinct on the Primary Keys.

Use the sort transformation instead.|||I am trying to Prevent the Duplicate Records from getting inserted . i am working on it will post back with the results. Thanks!!!sql

Wednesday, March 28, 2012

How to insert a xml file in sql server database using asp.net?

hii,

i want to insert a xml file into the sql server using asp.net.can sm1 help me wth d coding part?What server version you use?

In 2005 - there is XML datatype and almost unlimited size of XML.

In 2000 - for character datatype you limited to 8000 characters unless you are going to use text datatype.sql

Monday, March 26, 2012

How to insert a column in Excel by using OleDB

Hi all, I need to add a new column in an excel file, as I jus know the
query to add a new row in excel.
string strCom = "INSERT INTO [Sheet1$] (Name, ID)" +
" values ('"+name+"', '"+id+"')";
Anyone know the query to add a new column? Thankz...
Message posted via http://www.webservertalk.comYou might try the ALTER TABLE command. Not sure if it will work for a
linked Excel file, but it's standard SQL DDL to modify your table
structure - including adding a column.
"yaya via webservertalk.com" <forum@.webservertalk.com> wrote in message
news:15cfdd8a8a734a3e87f06370bc769573@.SQ
webservertalk.com...
> Hi all, I need to add a new column in an excel file, as I jus know the
> query to add a new row in excel.
> string strCom = "INSERT INTO [Sheet1$] (Name, ID)" +
> " values ('"+name+"', '"+id+"')";
> Anyone know the query to add a new column? Thankz...
> --
> Message posted via http://www.webservertalk.com|||Ya...but I duno the syntax of the ALTER TABLE....I have tried
string strCom = " ALTER TABLE [Sheet1$] ADD COLUMN Phone INTEGER ";
but it doesn't seems to work...can you please give an example of the Alter
Table SQL? Thankx...
Message posted via http://www.webservertalk.com|||> string strCom = " ALTER TABLE [Sheet1$] ADD COLUMN Phone INTEGER ";
In SQL Server, you should omit COLUMN. I don't know if this will work with
Excel:
string strCom = " ALTER TABLE [Sheet1$] ADD Phone INTEGER ";
Hope this helps.
Dan Guzman
SQL Server MVP
"yaya via webservertalk.com" <forum@.webservertalk.com> wrote in message
news:14c9b951bfd14ffc93557f7c6d03b877@.SQ
webservertalk.com...
> Ya...but I duno the syntax of the ALTER TABLE....I have tried
> string strCom = " ALTER TABLE [Sheet1$] ADD COLUMN Phone INTEGER ";
> but it doesn't seems to work...can you please give an example of the
> Alter
> Table SQL? Thankx...
> --
> Message posted via http://www.webservertalk.com|||I'm using C# with OleDB, here is my code
========================================
===============================
string strCon = " Provider = Microsoft.Jet.OLEDB.4.0 ; Data Source = " +
fileName + ";Extended Properties=Excel 8.0" ; ;
OleDbConnection myConn = new OleDbConnection(strCon);
OleDbDataAdapter myCommand = new OleDbDataAdapter();
string strCom1 = " ALTER TABLE [Sheet1$] ADD Phone INTEGER ";
myCommand.SelectCommand = new OleDbCommand(strCom1, myConn);
myConn.Open();
myCommand.Fill (myDataSet, "[Sheet1$]");
myConn.Close();
========================================
===============================
I got an error of "Invalid operation"...anyway, it works fine with
UPDATE, SELECT and INSERT except ALTER TABLE...anything wrong with the
ALTER TABLE syntax?
Message posted via http://www.webservertalk.com|||As I said, I'm not even sure ALTER TABLE is supported when accessing XLS
files via OLEDB. That was just something to try based on standard SQL DDL.
Here's a link that has a tip, although they say it's a little complex:
http://www.eggheadcafe.com/ng/micro...490.asp

"yaya via webservertalk.com" <forum@.webservertalk.com> wrote in message
news:f1abb60e1ec74c2da572c3318607e310@.SQ
webservertalk.com...
> I'm using C# with OleDB, here is my code
> ========================================
===============================
> string strCon = " Provider = Microsoft.Jet.OLEDB.4.0 ; Data Source = " +
> fileName + ";Extended Properties=Excel 8.0" ; ;
> OleDbConnection myConn = new OleDbConnection(strCon);
> OleDbDataAdapter myCommand = new OleDbDataAdapter();
> string strCom1 = " ALTER TABLE [Sheet1$] ADD Phone INTEGER ";
> myCommand.SelectCommand = new OleDbCommand(strCom1, myConn);
> myConn.Open();
> myCommand.Fill (myDataSet, "[Sheet1$]");
> myConn.Close();
> ========================================
===============================
> I got an error of "Invalid operation"...anyway, it works fine with
> UPDATE, SELECT and INSERT except ALTER TABLE...anything wrong with the
> ALTER TABLE syntax?
> --
> Message posted via http://www.webservertalk.com|||> anything wrong with the ALTER TABLE syntax?
This syntax is valid for Microsoft SQL Server. I don't know what syntax Jet
expects or if it is even possible to add a column to an existing sheet using
the Jet OleDb provider
You might try posting your question to the OleDb forum.
Hope this helps.
Dan Guzman
SQL Server MVP
"yaya via webservertalk.com" <forum@.webservertalk.com> wrote in message
news:f1abb60e1ec74c2da572c3318607e310@.SQ
webservertalk.com...
> I'm using C# with OleDB, here is my code
> ========================================
===============================
> string strCon = " Provider = Microsoft.Jet.OLEDB.4.0 ; Data Source = " +
> fileName + ";Extended Properties=Excel 8.0" ; ;
> OleDbConnection myConn = new OleDbConnection(strCon);
> OleDbDataAdapter myCommand = new OleDbDataAdapter();
> string strCom1 = " ALTER TABLE [Sheet1$] ADD Phone INTEGER ";
> myCommand.SelectCommand = new OleDbCommand(strCom1, myConn);
> myConn.Open();
> myCommand.Fill (myDataSet, "[Sheet1$]");
> myConn.Close();
> ========================================
===============================
> I got an error of "Invalid operation"...anyway, it works fine with
> UPDATE, SELECT and INSERT except ALTER TABLE...anything wrong with the
> ALTER TABLE syntax?
> --
> Message posted via http://www.webservertalk.com|||"yaya via webservertalk.com" <forum@.webservertalk.com> wrote in message
news:15cfdd8a8a734a3e87f06370bc769573@.SQ
webservertalk.com...
> Hi all, I need to add a new column in an excel file, as I jus know the
> query to add a new row in excel.
> string strCom = "INSERT INTO [Sheet1$] (Name, ID)" +
> " values ('"+name+"', '"+id+"')";
> Anyone know the query to add a new column? Thankz...
>
are you forced to use "oledb"?
object automation is very flexible way of interfacing excel:
set oxls=createobject("excel.application")
set owbk=oxls.workbooks.open("mytable.xls")
set owsht=owbk.activesheet
owsht.activecell.entirecolumn.insert
...
with such object you may use any construct supported by excel macro.|||Thanks for the suggestion, so how could I know wherether the ALTER TABLE is
supported or not?
Message posted via http://www.webservertalk.com|||Ops...I just saw the ODBC and JDBC...may I know where is the OleDB forum ?
Thankz.
Message posted via http://www.webservertalk.com

How to input and output simultaneously in SQL 2005 Express?

I want to process data of an old VS6 project in VisualStudio2005.
First part is done. With SQL Management Studio I created the database file 'dbTest4' and attached it to SQL 2005 Express server (.\SQLEXPRESS).
Then I recoded the VS6_C++ project feeding its data into the database file using the ConnectionString:
"Provider='sqloledb';Data Source='.';Initial Catalog='dbTest4';Integrated Security='SSPI')"
Until here its working fine.

Assecond part I want to catch these data with VisualStudio2005 for processing there.
In VisualStudio 2005 I created a Windows Application as new project added the database file 'dbTest4' as data source, waited two minutes till VisualStudio2005 had created the DataGridTools bound to the tabbles of my database file and dropped a grid tool on to the surface of the new Form.
Great, within 5 minutes I had created a working database solution without writing a single line of code and it worked well. Starting the new build exe as standlolone it showed the data of my database file in a nice grid view.
But it worked as standolone only. When I tried to combine both parts one part was blockedalways producing error messages as ' ..error 32 (The process cannot access the file because it is being used by another process.) while attempting to open the file '...\dbTest4'.

Does anybody know
how to get this input/output combination running
or is ist impossible to reach my target with SQL 2005 Express?

After reading through Roger Wolters November 2005 article SQL Server 2005 Express Edition User Instances and some hours of testing I came to the conclusion:
When using Visual Studio not exclusively but simultaneously with other clients as SQLcmd, SQL Managent Studio or what else, as shown in my screenshot 325 you should consider to
set 'User Instance=False'
if you are struck by connection problems.
For details you are welcome to visit my sreenshot folder. By clicking the numbered screenshots, enlarging them and using your browsers back button you can follow a detailed installation and see why, where and how to set 'User Instance=False'.
Martin

Friday, March 23, 2012

How to increase the data file size?

Hi All,

Is it possible to increase the data file size in SQL Server 2005 Express edition?

If yes then how?

Thanks,

Varun

Hi Varun

If you have MSSQL Management Studio installed then from there select Database's properties > Files

There you can setup initial maximum size for Data and Log file.

Thanks,

How to include the date as part of the log file name...

Hello to all,
I'm using SQL Server agent to perform some schedule jobs.
I have it setup so that it will write to an result output
file (Jobs Steps -> Advanced -> Output file:
The problem is that I would like to name this output file
such as 'result%date%.log' where %date% is the current
date so that I can get a seperate log file each day.
Does anyone know how to do this ? %date% does not work.
Thanks in advance.
KinKin:
The way I have it up is that I do archiving of these output log files every
day as a separate job. In the archiving process I copy the files and add
date to the filename as follows:
declare @.cmd sysname
declare @.var sysname
set @.var = convert(varchar(11),getdate(),112)
--add date to file and archive
set @.cmd = 'copy e:\Logs\DBMaintenance\*.* e:\Logs\Archive_Logs\*' + @.var +
'.txt'
exec master..xp_cmdshell @.cmd
"Kin" <ninka_2000@.yahoo.com> wrote in message
news:017501c34fa8$212552a0$a301280a@.phx.gbl...
> Hello to all,
> I'm using SQL Server agent to perform some schedule jobs.
> I have it setup so that it will write to an result output
> file (Jobs Steps -> Advanced -> Output file:
> The problem is that I would like to name this output file
> such as 'result%date%.log' where %date% is the current
> date so that I can get a seperate log file each day.
> Does anyone know how to do this ? %date% does not work.
> Thanks in advance.
> Kin|||I'm not sure that there is a direct way to do that in SQL Agent. You could
always build you're own backup log command and execute that directly. Also,
you could simply let the job name it what it wants, and then add a step that
uses xp_cmdshell to rename the file.
--
Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"Kin" <ninka_2000@.yahoo.com> wrote in message
news:017501c34fa8$212552a0$a301280a@.phx.gbl...
> Hello to all,
> I'm using SQL Server agent to perform some schedule jobs.
> I have it setup so that it will write to an result output
> file (Jobs Steps -> Advanced -> Output file:
> The problem is that I would like to name this output file
> such as 'result%date%.log' where %date% is the current
> date so that I can get a seperate log file each day.
> Does anyone know how to do this ? %date% does not work.
> Thanks in advance.
> Kin|||>--Original Message--
>Hello to all,
>I'm using SQL Server agent to perform some schedule
jobs.
>I have it setup so that it will write to an result output
>file (Jobs Steps -> Advanced -> Output file:
>The problem is that I would like to name this output file
>such as 'result%date%.log' where %date% is the current
>date so that I can get a seperate log file each day.
>Does anyone know how to do this ? %date% does not work.
>Thanks in advance.
>Kin
>.
>

How to include SSIS into install file?

I've already read many topics that was asked about SSIS runtime, but for my purposes I didn't find satisfied answer

Our clients don't use SQL Server for their data. But we anyway used DTS packages for transfering data between client DBes. Only thing that we needed to install was DTS dlls.

What will I need to do now to use old DTS and new SSIS packages on these clients?

Can someone to help me?|||

See my reply to your post on the SSC forum

-Jamie

|||Unlike DTS, SSIS is not redistributable. You need SQL license for every machine where SSIS runs (you may develop and debug SSIS packages using just Tools install).|||

Michael Entin SSIS wrote:

Unlike DTS, SSIS is not redistributable. You need SQL license for every machine where SSIS runs (you may develop and debug SSIS packages using just Tools install).

So, Do I have to install SSIS runtime on each 500-1000 single computers of our company's clients?

And what type of license do we need for this?

Or maybe I don't understand something how it works. What we need that every user of our clients will be able to run SSIS packages to copy/backup data from Server on his own computer or remote(Server) computer itself. It depends on where this user want to see this copied data. Maybe for this puporses there is some feather of SSIS that I still don't know. Another thing - type of DBes may be diffrent on Server and on client computers.

|||

In an ideal world you would have a single package. You would loop 500 times (or however many you need) changing the connection string each time appropriately.

If you have a different RDBMS on each source system though this will probably not be possible because the metadata will most likely change. If every one of the 500 clients has the same schema on the same RDBMS then it is theoretically possible. And certainly alot easier than installing SSIS on 500 machines (and having to do it all over again when machines are upgraded).

Might I suggest you change your architecture to a proper client/server one? Have a centralised server that contains all the data and the clients connect to get their own data.

-Jamie

|||Company clients are real estate agencies. Each agency has many agents in the field who need copied DB on their computers which most of the time disconnected from the Server. So, they need the smart client on their computers. After they update data about properties they will copy updated data from their client to the Server using DTS. Usually local computer has Access DB, and MySql or MSDE (now we want instead it SQL Express) on Server. So, how exactly do we have to change architecture? More easier I think still to work with DTS and wait for distributable SSIS runtime or something like this.|||

Instead of pushing data up to the server have you considered pulling data from the clients instead?

That way the package(s) fire centrally so you only need 1 license.

-Jamie

|||

Jamie Thomson wrote:

Instead of pushing data up to the server have you considered pulling data from the clients instead?

That way the package(s) fire centrally so you only need 1 license.

Do you meen that each client will send request to Server to start pulling or pushing data on this client computer DB using SSIS or DTS packages which are located on Server itself?

May be it will be effective solution. If we don't find easier way without changing architecture to use SSIS we'll use this solution.

Thank you.

|||

Yep. That's exactly what I mean.

Strictly speaking you can't execute a SSIS package sitting on another server. There is a way around it though. You can set up a SQL Agent job on that remote server to run teh package and then execute that job from wherever you like.

-Jamie

|||

Jamie Thomson wrote:

Yep. That's exactly what I mean.

Strictly speaking you can't execute a SSIS package sitting on another server. There is a way around it though. You can set up a SQL Agent job on that remote server to run teh package and then execute that job from wherever you like.

Yes, I have already read about it. I hope we'll find something else, not so complicated as changing architecture.

But anyway thank you for your answers.

sql

Wednesday, March 21, 2012

How to include SSIS into install file?

I've already read many topics that was asked about SSIS runtime, but for my purposes I didn't find satisfied answer

Our clients don't use SQL Server for their data. But we anyway used DTS packages for transfering data between client DBes. Only thing that we needed to install was DTS dlls.

What will I need to do now to use old DTS and new SSIS packages on these clients?

Can someone to help me?|||

See my reply to your post on the SSC forum

-Jamie

|||Unlike DTS, SSIS is not redistributable. You need SQL license for every machine where SSIS runs (you may develop and debug SSIS packages using just Tools install).|||

Michael Entin SSIS wrote:

Unlike DTS, SSIS is not redistributable. You need SQL license for every machine where SSIS runs (you may develop and debug SSIS packages using just Tools install).

So, Do I have to install SSIS runtime on each 500-1000 single computers of our company's clients?

And what type of license do we need for this?

Or maybe I don't understand something how it works. What we need that every user of our clients will be able to run SSIS packages to copy/backup data from Server on his own computer or remote(Server) computer itself. It depends on where this user want to see this copied data. Maybe for this puporses there is some feather of SSIS that I still don't know. Another thing - type of DBes may be diffrent on Server and on client computers.

|||

In an ideal world you would have a single package. You would loop 500 times (or however many you need) changing the connection string each time appropriately.

If you have a different RDBMS on each source system though this will probably not be possible because the metadata will most likely change. If every one of the 500 clients has the same schema on the same RDBMS then it is theoretically possible. And certainly alot easier than installing SSIS on 500 machines (and having to do it all over again when machines are upgraded).

Might I suggest you change your architecture to a proper client/server one? Have a centralised server that contains all the data and the clients connect to get their own data.

-Jamie

|||Company clients are real estate agencies. Each agency has many agents in the field who need copied DB on their computers which most of the time disconnected from the Server. So, they need the smart client on their computers. After they update data about properties they will copy updated data from their client to the Server using DTS. Usually local computer has Access DB, and MySql or MSDE (now we want instead it SQL Express) on Server. So, how exactly do we have to change architecture? More easier I think still to work with DTS and wait for distributable SSIS runtime or something like this.|||

Instead of pushing data up to the server have you considered pulling data from the clients instead?

That way the package(s) fire centrally so you only need 1 license.

-Jamie

|||

Jamie Thomson wrote:

Instead of pushing data up to the server have you considered pulling data from the clients instead?

That way the package(s) fire centrally so you only need 1 license.

Do you meen that each client will send request to Server to start pulling or pushing data on this client computer DB using SSIS or DTS packages which are located on Server itself?

May be it will be effective solution. If we don't find easier way without changing architecture to use SSIS we'll use this solution.

Thank you.

|||

Yep. That's exactly what I mean.

Strictly speaking you can't execute a SSIS package sitting on another server. There is a way around it though. You can set up a SQL Agent job on that remote server to run teh package and then execute that job from wherever you like.

-Jamie

|||

Jamie Thomson wrote:

Yep. That's exactly what I mean.

Strictly speaking you can't execute a SSIS package sitting on another server. There is a way around it though. You can set up a SQL Agent job on that remote server to run teh package and then execute that job from wherever you like.

Yes, I have already read about it. I hope we'll find something else, not so complicated as changing architecture.

But anyway thank you for your answers.

Monday, March 19, 2012

How to import XML file into SQL.

I want to import XML file as the '@.doc' value when I execute 'sp_xml_preparedocument', many thanks!Check out this article:

http://gridviewguy.com/ArticleDetails.aspx?articleID=76

How to import this schema and file into SQL with bulkload

Hi,
I have been given the following file that includes both the schema and the
XML data. It is about 6MB so I just show the start and the end of the file
<START SCHEMA SECTION>
<?xml version = "1.0" encoding="Windows-1252" standalone="yes"?>
<VFPData xml:space="preserve">
<xsd:schema id="VFPData" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="VFPData" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="lotdata" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:attribute name="lh_recno" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="8"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="lh_refno" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="8"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="lh_seqno" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="8"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="lh_ltype" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="3"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="bh_stowloc" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="20"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
</xsd:choice>
<xsd:anyAttribute namespace="http://www.w3.org/XML/1998/namespace"
processContents="lax"/>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<END SCHEMA SECTION>
<DATA SECTION>
<lotdata lh_recno=" 91870" lh_refno=" 91870" lh_seqno="230 "
lh_ltype="CLP" lh_code=" 4993" lh_sale="M33 " lh_season="04"
lh_schdate="2005-02-17" lh_sroom="ROOM2 " lh_csect="ODD "
lh_gsect="ODDS" lh_catflg="false" lh_source=" " lh_aucent=" "
lh_chgdate="2005-02-15T08:44:57" lh_catpage="298" lh_porg="ESMQ "
lh_selorg="ESMQ " lh_relorg="AWLQ " lh_storg="AWLQ " lh_stcent="Q "
lh_sdate=" - - " lh_sldate=" - - T : : " lh_sorg=" "
lh_psorg=" " lh_qsch1=" " lh_qsch2=" "
lh_catsym="BN " lh_wstate="GRSY " lh_grsyflg="true" lh_packin="STD "
lh_bales="3" lh_tbales="3" lh_rnetkg="465.00" lh_rtare="6.00"
lh_pprice="0.0" lh_pbasis=" " lh_pclnkg="0.00" lh_pybasis=" "
lh_pcurr=" " lh_pcurate="0.000000" lh_sprice="0.0" lh_sbasis=" "
lh_sclnkg="0.00" lh_rprice="0.0" lh_rbasis=" " lh_saleout=" "
lh_verify=" " lh_ppsch="20.10" lh_pcalbas="$/BALE" lh_wtx="PAID " lh_comm="
" lh_intcomm=" " lh_tsycodc=" " lh_typec="
" lh_typflgc="false" lh_tsycod1="IDS" lh_type1="XLF5E.40
" lh_typflg1="false" lh_tsycod2=" " lh_type2="
" lh_typflg2="false" lh_tsycod3=" " lh_type3="
" lh_typflg3="false" lh_tsycod4=" " lh_type4="
" lh_typflg4="false" lh_typeq=" "
lh_fghtchg="0.00" lh_fghtrbt="5.96" lh_delbas="DND " lh_delcent=" "
lh_scode=" " ct_netkg="465.00" ct_sampkg="0.00" ct_type1="PTC "
ct_prefx1="3" ct_code1="07454266" ct_suffx1="B" ct_chk1="7" ct_lab1="AWTA "
ct_wbase="62.39" ct_mic="24.3" ct_mictype=" " ct_afmic="0.0" ct_lsmic="24.3"
ct_lssdm="5.6" ct_lscvm="23.0" ct_lscomft="88.2" ct_ofmic="0.0"
ct_ofsdm="0.0" ct_ofcvm="0.0" ct_ofcomft="0.0" ct_vmb="1.40" ct_hh="0.0"
ct_vm1="0.2000" ct_vm2="1.2000" ct_vm3="0.0000" ct_yld1="72.00"
ct_ytyp1="SDRY1" ct_clkg1="0.00" ct_yld2="76.40" ct_ytyp2="SCD17"
ct_clkg2="0.00" ct_yld3="73.50" ct_ytyp3="JCS " ct_clkg3="0.00"
ct_yld4="69.80" ct_ytyp4="ACARB" ct_clkg4="0.00" ct_minmic="0.0"
ct_maxmic="0.0" ct_minvmb="0.0" ct_maxvmb="0.0" ct_fctwb="0.00"
ct_fctvmb="0.00" ct_fcthh="0.00" ct_fctmic="0.000000" ct_rtst1="NORM "
ct_reiss1=" " ct_type2=" " ct_prefx2=" " ct_code2=" "
ct_suffx2=" " ct_chk2=" " ct_lab2=" " ct_slen="0" ct_slencv="0"
ct_str="0" ct_minlen="0" ct_maxlen="0" ct_minstr="0" ct_maxstr="0"
ct_pobt="0" ct_pobm="0" ct_pobb="0" ct_haut="0" ct_ehaut="0.0" ct_lstype="
" ct_lsecur="false" ct_type3=" " ct_prefx3=" " ct_code3=" "
ct_suffx3=" " ct_chk3=" " ct_lab3=" " ct_colx="0.0" ct_coly="0.0"
ct_colz="0.0" ct_ecolyz="0.0" ct_colyz="0.0" ct_mincolx="0.0"
ct_maxcolx="0.0" ct_mincoly="0.0" ct_maxcoly="0.0" ct_mincolz="0.0"
ct_maxcolz="0.0" ct_minclyz="0.0" ct_maxclyz="0.0" ct_reiss3=" "
ct_cvh="0.0" ct_noil="0.0" ct_dark="N" bh_brandp="SR/COR
" bh_descp="AAALM " bh_area="N28 " bh_stowloc="
"/>
</VFPData>
<END DATA SECTION>
As you can see from the data, I have left out lots of fields to fit in post.
Anyway, we want to do a bulk load of this data, but none of the schema
sections look like examples on the web where you can setup 'sql:' options
for the field names etc.. In fact this XML/schema file don't look like
anything I have seen on the web. I guess it is just a bit more complex than
usual.
So would I be able do a bulkload with this data?
I have cut out the schema and pasted into another file but I don't know
where to go next as the file looks so different from others I have seen.
Can anyone help me with some options on how to use these files for a bulk
load?
TIA
Nathan
Hi Nathan,
my suggestion:
DId you design a database (inclusive tables and relations) already? If NOT,
do this...
(maybe with the help of XMLSpy ... export xml data to database...)
then
Take your XML Datafile, open it with XMLSpy (Enterprise Edition in
evaluation version available), and go through:
--> Convert --> Create XML schema from DB structure
Now you have mapping-schema. ToDo: Add the missing relationships
like...
<xs:annotation>
<xs:appinfo>
<sql:relationship name="name"
parent="Table" parent-key="Table_ID"
child="RelatedTable" child-key="Table_ID"/>
</xs:appinfo>
</xs:annotation>
...
then, add the sql:is-constant for your root-element like ...
<xs:element name="ROOT" sql:is-constant="1">
and your mapping schema is complete.
Regards
SUsanne
"Nathan Simpson" wrote:

> Hi,
> I have been given the following file that includes both the schema and the
> XML data. It is about 6MB so I just show the start and the end of the file
> <START SCHEMA SECTION>
> <?xml version = "1.0" encoding="Windows-1252" standalone="yes"?>
> <VFPData xml:space="preserve">
> <xsd:schema id="VFPData" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
> <xsd:element name="VFPData" msdata:IsDataSet="true">
> <xsd:complexType>
> <xsd:choice maxOccurs="unbounded">
> <xsd:element name="lotdata" minOccurs="0" maxOccurs="unbounded">
> <xsd:complexType>
> <xsd:attribute name="lh_recno" use="required">
> <xsd:simpleType>
> <xsd:restriction base="xsd:string">
> <xsd:maxLength value="8"/>
> </xsd:restriction>
> </xsd:simpleType>
> </xsd:attribute>
> <xsd:attribute name="lh_refno" use="required">
> <xsd:simpleType>
> <xsd:restriction base="xsd:string">
> <xsd:maxLength value="8"/>
> </xsd:restriction>
> </xsd:simpleType>
> </xsd:attribute>
> <xsd:attribute name="lh_seqno" use="required">
> <xsd:simpleType>
> <xsd:restriction base="xsd:string">
> <xsd:maxLength value="8"/>
> </xsd:restriction>
> </xsd:simpleType>
> </xsd:attribute>
> <xsd:attribute name="lh_ltype" use="required">
> <xsd:simpleType>
> <xsd:restriction base="xsd:string">
> <xsd:maxLength value="3"/>
> </xsd:restriction>
> </xsd:simpleType>
> </xsd:attribute>
> <xsd:attribute name="bh_stowloc" use="required">
> <xsd:simpleType>
> <xsd:restriction base="xsd:string">
> <xsd:maxLength value="20"/>
> </xsd:restriction>
> </xsd:simpleType>
> </xsd:attribute>
> </xsd:complexType>
> </xsd:element>
> </xsd:choice>
> <xsd:anyAttribute namespace="http://www.w3.org/XML/1998/namespace"
> processContents="lax"/>
> </xsd:complexType>
> </xsd:element>
> </xsd:schema>
> <END SCHEMA SECTION>
> <DATA SECTION>
> <lotdata lh_recno=" 91870" lh_refno=" 91870" lh_seqno="230 "
> lh_ltype="CLP" lh_code=" 4993" lh_sale="M33 " lh_season="04"
> lh_schdate="2005-02-17" lh_sroom="ROOM2 " lh_csect="ODD "
> lh_gsect="ODDS" lh_catflg="false" lh_source=" " lh_aucent=" "
> lh_chgdate="2005-02-15T08:44:57" lh_catpage="298" lh_porg="ESMQ "
> lh_selorg="ESMQ " lh_relorg="AWLQ " lh_storg="AWLQ " lh_stcent="Q "
> lh_sdate=" - - " lh_sldate=" - - T : : " lh_sorg=" "
> lh_psorg=" " lh_qsch1=" " lh_qsch2=" "
> lh_catsym="BN " lh_wstate="GRSY " lh_grsyflg="true" lh_packin="STD "
> lh_bales="3" lh_tbales="3" lh_rnetkg="465.00" lh_rtare="6.00"
> lh_pprice="0.0" lh_pbasis=" " lh_pclnkg="0.00" lh_pybasis=" "
> lh_pcurr=" " lh_pcurate="0.000000" lh_sprice="0.0" lh_sbasis=" "
> lh_sclnkg="0.00" lh_rprice="0.0" lh_rbasis=" " lh_saleout=" "
> lh_verify=" " lh_ppsch="20.10" lh_pcalbas="$/BALE" lh_wtx="PAID " lh_comm="
> " lh_intcomm=" " lh_tsycodc=" " lh_typec="
> " lh_typflgc="false" lh_tsycod1="IDS" lh_type1="XLF5E.40
> " lh_typflg1="false" lh_tsycod2=" " lh_type2="
> " lh_typflg2="false" lh_tsycod3=" " lh_type3="
> " lh_typflg3="false" lh_tsycod4=" " lh_type4="
> " lh_typflg4="false" lh_typeq=" "
> lh_fghtchg="0.00" lh_fghtrbt="5.96" lh_delbas="DND " lh_delcent=" "
> lh_scode=" " ct_netkg="465.00" ct_sampkg="0.00" ct_type1="PTC "
> ct_prefx1="3" ct_code1="07454266" ct_suffx1="B" ct_chk1="7" ct_lab1="AWTA "
> ct_wbase="62.39" ct_mic="24.3" ct_mictype=" " ct_afmic="0.0" ct_lsmic="24.3"
> ct_lssdm="5.6" ct_lscvm="23.0" ct_lscomft="88.2" ct_ofmic="0.0"
> ct_ofsdm="0.0" ct_ofcvm="0.0" ct_ofcomft="0.0" ct_vmb="1.40" ct_hh="0.0"
> ct_vm1="0.2000" ct_vm2="1.2000" ct_vm3="0.0000" ct_yld1="72.00"
> ct_ytyp1="SDRY1" ct_clkg1="0.00" ct_yld2="76.40" ct_ytyp2="SCD17"
> ct_clkg2="0.00" ct_yld3="73.50" ct_ytyp3="JCS " ct_clkg3="0.00"
> ct_yld4="69.80" ct_ytyp4="ACARB" ct_clkg4="0.00" ct_minmic="0.0"
> ct_maxmic="0.0" ct_minvmb="0.0" ct_maxvmb="0.0" ct_fctwb="0.00"
> ct_fctvmb="0.00" ct_fcthh="0.00" ct_fctmic="0.000000" ct_rtst1="NORM "
> ct_reiss1=" " ct_type2=" " ct_prefx2=" " ct_code2=" "
> ct_suffx2=" " ct_chk2=" " ct_lab2=" " ct_slen="0" ct_slencv="0"
> ct_str="0" ct_minlen="0" ct_maxlen="0" ct_minstr="0" ct_maxstr="0"
> ct_pobt="0" ct_pobm="0" ct_pobb="0" ct_haut="0" ct_ehaut="0.0" ct_lstype="
> " ct_lsecur="false" ct_type3=" " ct_prefx3=" " ct_code3=" "
> ct_suffx3=" " ct_chk3=" " ct_lab3=" " ct_colx="0.0" ct_coly="0.0"
> ct_colz="0.0" ct_ecolyz="0.0" ct_colyz="0.0" ct_mincolx="0.0"
> ct_maxcolx="0.0" ct_mincoly="0.0" ct_maxcoly="0.0" ct_mincolz="0.0"
> ct_maxcolz="0.0" ct_minclyz="0.0" ct_maxclyz="0.0" ct_reiss3=" "
> ct_cvh="0.0" ct_noil="0.0" ct_dark="N" bh_brandp="SR/COR
> " bh_descp="AAALM " bh_area="N28 " bh_stowloc="
> "/>
> </VFPData>
> <END DATA SECTION>
> As you can see from the data, I have left out lots of fields to fit in post.
> Anyway, we want to do a bulk load of this data, but none of the schema
> sections look like examples on the web where you can setup 'sql:' options
> for the field names etc.. In fact this XML/schema file don't look like
> anything I have seen on the web. I guess it is just a bit more complex than
> usual.
> So would I be able do a bulkload with this data?
> I have cut out the schema and pasted into another file but I don't know
> where to go next as the file looks so different from others I have seen.
> Can anyone help me with some options on how to use these files for a bulk
> load?
> TIA
> Nathan
>
>
|||Sorry, you don't have to open your XML datafile...
You can create the schema from your database without it
"susanne" wrote:
[vbcol=seagreen]
> Hi Nathan,
> my suggestion:
> DId you design a database (inclusive tables and relations) already? If NOT,
> do this...
> (maybe with the help of XMLSpy ... export xml data to database...)
> then
> Take your XML Datafile, open it with XMLSpy (Enterprise Edition in
> evaluation version available), and go through:
> --> Convert --> Create XML schema from DB structure
> Now you have mapping-schema. ToDo: Add the missing relationships
> like...
> <xs:annotation>
> <xs:appinfo>
> <sql:relationship name="name"
> parent="Table" parent-key="Table_ID"
> child="RelatedTable" child-key="Table_ID"/>
> </xs:appinfo>
> </xs:annotation>
> ...
> then, add the sql:is-constant for your root-element like ...
> <xs:element name="ROOT" sql:is-constant="1">
> and your mapping schema is complete.
> Regards
> SUsanne
>
> "Nathan Simpson" wrote:

How to import this schema and file into SQL with bulkload

Hi,
I have been given the following file that includes both the schema and the
XML data. It is about 6MB so I just show the start and the end of the file
<START SCHEMA SECTION>
<?xml version = "1.0" encoding="Windows-1252" standalone="yes"?>
<VFPData xml:space="preserve">
<xsd:schema id="VFPData" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="VFPData" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="lotdata" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:attribute name="lh_recno" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="8"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="lh_refno" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="8"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="lh_seqno" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="8"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="lh_ltype" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="3"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="bh_stowloc" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="20"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
</xsd:choice>
<xsd:anyAttribute namespace="http://www.w3.org/XML/1998/namespace"
processContents="lax"/>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<END SCHEMA SECTION>
<DATA SECTION>
<lotdata lh_recno=" 91870" lh_refno=" 91870" lh_seqno="230 "
lh_ltype="CLP" lh_code=" 4993" lh_sale="M33 " lh_season="04"
lh_schdate="2005-02-17" lh_sroom="ROOM2 " lh_csect="ODD "
lh_gsect="ODDS" lh_catflg="false" lh_source=" " lh_aucent=" "
lh_chgdate="2005-02-15T08:44:57" lh_catpage="298" lh_porg="ESMQ "
lh_selorg="ESMQ " lh_relorg="AWLQ " lh_storg="AWLQ " lh_stcent="Q "
lh_sdate=" - - " lh_sldate=" - - T : : " lh_sorg=" "
lh_psorg=" " lh_qsch1=" " lh_qsch2=" "
lh_catsym="BN " lh_wstate="GRSY " lh_grsyflg="true" lh_packin="STD "
lh_bales="3" lh_tbales="3" lh_rnetkg="465.00" lh_rtare="6.00"
lh_pprice="0.0" lh_pbasis=" " lh_pclnkg="0.00" lh_pybasis=" "
lh_pcurr=" " lh_pcurate="0.000000" lh_sprice="0.0" lh_sbasis=" "
lh_sclnkg="0.00" lh_rprice="0.0" lh_rbasis=" " lh_saleout=" "
lh_verify=" " lh_ppsch="20.10" lh_pcalbas="$/BALE" lh_wtx="PAID " lh_comm="
" lh_intcomm=" " lh_tsycodc=" " lh_typec="
" lh_typflgc="false" lh_tsycod1="IDS" lh_type1="XLF5E.40
" lh_typflg1="false" lh_tsycod2=" " lh_type2="
" lh_typflg2="false" lh_tsycod3=" " lh_type3="
" lh_typflg3="false" lh_tsycod4=" " lh_type4="
" lh_typflg4="false" lh_typeq=" "
lh_fghtchg="0.00" lh_fghtrbt="5.96" lh_delbas="DND " lh_delcent=" "
lh_scode=" " ct_netkg="465.00" ct_sampkg="0.00" ct_type1="PTC "
ct_prefx1="3" ct_code1="07454266" ct_suffx1="B" ct_chk1="7" ct_lab1="AWTA "
ct_wbase="62.39" ct_mic="24.3" ct_mictype=" " ct_afmic="0.0" ct_lsmic="24.3"
ct_lssdm="5.6" ct_lscvm="23.0" ct_lscomft="88.2" ct_ofmic="0.0"
ct_ofsdm="0.0" ct_ofcvm="0.0" ct_ofcomft="0.0" ct_vmb="1.40" ct_hh="0.0"
ct_vm1="0.2000" ct_vm2="1.2000" ct_vm3="0.0000" ct_yld1="72.00"
ct_ytyp1="SDRY1" ct_clkg1="0.00" ct_yld2="76.40" ct_ytyp2="SCD17"
ct_clkg2="0.00" ct_yld3="73.50" ct_ytyp3="JCS " ct_clkg3="0.00"
ct_yld4="69.80" ct_ytyp4="ACARB" ct_clkg4="0.00" ct_minmic="0.0"
ct_maxmic="0.0" ct_minvmb="0.0" ct_maxvmb="0.0" ct_fctwb="0.00"
ct_fctvmb="0.00" ct_fcthh="0.00" ct_fctmic="0.000000" ct_rtst1="NORM "
ct_reiss1=" " ct_type2=" " ct_prefx2=" " ct_code2=" "
ct_suffx2=" " ct_chk2=" " ct_lab2=" " ct_slen="0" ct_slencv="0"
ct_str="0" ct_minlen="0" ct_maxlen="0" ct_minstr="0" ct_maxstr="0"
ct_pobt="0" ct_pobm="0" ct_pobb="0" ct_haut="0" ct_ehaut="0.0" ct_lstype="
" ct_lsecur="false" ct_type3=" " ct_prefx3=" " ct_code3=" "
ct_suffx3=" " ct_chk3=" " ct_lab3=" " ct_colx="0.0" ct_coly="0.0"
ct_colz="0.0" ct_ecolyz="0.0" ct_colyz="0.0" ct_mincolx="0.0"
ct_maxcolx="0.0" ct_mincoly="0.0" ct_maxcoly="0.0" ct_mincolz="0.0"
ct_maxcolz="0.0" ct_minclyz="0.0" ct_maxclyz="0.0" ct_reiss3=" "
ct_cvh="0.0" ct_noil="0.0" ct_dark="N" bh_brandp="SR/COR
" bh_descp="AAALM " bh_area="N28 " bh_stowloc="
"/>
</VFPData>
<END DATA SECTION>
As you can see from the data, I have left out lots of fields to fit in post.
Anyway, we want to do a bulk load of this data, but none of the schema
sections look like examples on the web where you can setup 'sql:' options
for the field names etc.. In fact this XML/schema file don't look like
anything I have seen on the web. I guess it is just a bit more complex than
usual.
So would I be able do a bulkload with this data?
I have cut out the schema and pasted into another file but I don't know
where to go next as the file looks so different from others I have seen.
Can anyone help me with some options on how to use these files for a bulk
load?
TIA
NathanHi Nathan,
my suggestion:
DId you design a database (inclusive tables and relations) already? If NOT,
do this...
(maybe with the help of XMLSpy ... export xml data to database...)
then
Take your XML Datafile, open it with XMLSpy (Enterprise Edition in
evaluation version available), and go through:
--> Convert --> Create XML schema from DB structure
Now you have mapping-schema. ToDo: Add the missing relationships
like...
<xs:annotation>
<xs:appinfo>
<sql:relationship name="name"
parent="Table" parent-key="Table_ID"
child="RelatedTable" child-key="Table_ID"/>
</xs:appinfo>
</xs:annotation>
...
then, add the sql:is-constant for your root-element like ...
<xs:element name="ROOT" sql:is-constant="1">
and your mapping schema is complete.
Regards
SUsanne
"Nathan Simpson" wrote:

> Hi,
> I have been given the following file that includes both the schema and the
> XML data. It is about 6MB so I just show the start and the end of the file
> <START SCHEMA SECTION>
> <?xml version = "1.0" encoding="Windows-1252" standalone="yes"?>
> <VFPData xml:space="preserve">
> <xsd:schema id="VFPData" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
> <xsd:element name="VFPData" msdata:IsDataSet="true">
> <xsd:complexType>
> <xsd:choice maxOccurs="unbounded">
> <xsd:element name="lotdata" minOccurs="0" maxOccurs="unbounded">
> <xsd:complexType>
> <xsd:attribute name="lh_recno" use="required">
> <xsd:simpleType>
> <xsd:restriction base="xsd:string">
> <xsd:maxLength value="8"/>
> </xsd:restriction>
> </xsd:simpleType>
> </xsd:attribute>
> <xsd:attribute name="lh_refno" use="required">
> <xsd:simpleType>
> <xsd:restriction base="xsd:string">
> <xsd:maxLength value="8"/>
> </xsd:restriction>
> </xsd:simpleType>
> </xsd:attribute>
> <xsd:attribute name="lh_seqno" use="required">
> <xsd:simpleType>
> <xsd:restriction base="xsd:string">
> <xsd:maxLength value="8"/>
> </xsd:restriction>
> </xsd:simpleType>
> </xsd:attribute>
> <xsd:attribute name="lh_ltype" use="required">
> <xsd:simpleType>
> <xsd:restriction base="xsd:string">
> <xsd:maxLength value="3"/>
> </xsd:restriction>
> </xsd:simpleType>
> </xsd:attribute>
> <xsd:attribute name="bh_stowloc" use="required">
> <xsd:simpleType>
> <xsd:restriction base="xsd:string">
> <xsd:maxLength value="20"/>
> </xsd:restriction>
> </xsd:simpleType>
> </xsd:attribute>
> </xsd:complexType>
> </xsd:element>
> </xsd:choice>
> <xsd:anyAttribute namespace="http://www.w3.org/XML/1998/namespace"
> processContents="lax"/>
> </xsd:complexType>
> </xsd:element>
> </xsd:schema>
> <END SCHEMA SECTION>
> <DATA SECTION>
> <lotdata lh_recno=" 91870" lh_refno=" 91870" lh_seqno="230 "
> lh_ltype="CLP" lh_code=" 4993" lh_sale="M33 " lh_season="04"
> lh_schdate="2005-02-17" lh_sroom="ROOM2 " lh_csect="ODD "
> lh_gsect="ODDS" lh_catflg="false" lh_source=" " lh_aucent=" "
> lh_chgdate="2005-02-15T08:44:57" lh_catpage="298" lh_porg="ESMQ "
> lh_selorg="ESMQ " lh_relorg="AWLQ " lh_storg="AWLQ " lh_stcent="Q "
> lh_sdate=" - - " lh_sldate=" - - T : : " lh_sorg=" "
> lh_psorg=" " lh_qsch1=" " lh_qsch2=" "
> lh_catsym="BN " lh_wstate="GRSY " lh_grsyflg="true" lh_packin="STD "
> lh_bales="3" lh_tbales="3" lh_rnetkg="465.00" lh_rtare="6.00"
> lh_pprice="0.0" lh_pbasis=" " lh_pclnkg="0.00" lh_pybasis=" "
> lh_pcurr=" " lh_pcurate="0.000000" lh_sprice="0.0" lh_sbasis=" "
> lh_sclnkg="0.00" lh_rprice="0.0" lh_rbasis=" " lh_saleout=" "
> lh_verify=" " lh_ppsch="20.10" lh_pcalbas="$/BALE" lh_wtx="PAID " lh_comm
="
> " lh_intcomm=" " lh_tsycodc=" " lh_typec="
> " lh_typflgc="false" lh_tsycod1="IDS" lh_type1="XLF5E.40
> " lh_typflg1="false" lh_tsycod2=" " lh_type2="
> " lh_typflg2="false" lh_tsycod3=" " lh_type3="
> " lh_typflg3="false" lh_tsycod4=" " lh_type4="
> " lh_typflg4="false" lh_typeq=" "
> lh_fghtchg="0.00" lh_fghtrbt="5.96" lh_delbas="DND " lh_delcent=" "
> lh_scode=" " ct_netkg="465.00" ct_sampkg="0.00" ct_type1="PTC
"
> ct_prefx1="3" ct_code1="07454266" ct_suffx1="B" ct_chk1="7" ct_lab1="AWTA
"
> ct_wbase="62.39" ct_mic="24.3" ct_mictype=" " ct_afmic="0.0" ct_lsmic="24.
3"
> ct_lssdm="5.6" ct_lscvm="23.0" ct_lscomft="88.2" ct_ofmic="0.0"
> ct_ofsdm="0.0" ct_ofcvm="0.0" ct_ofcomft="0.0" ct_vmb="1.40" ct_hh="0.0"
> ct_vm1="0.2000" ct_vm2="1.2000" ct_vm3="0.0000" ct_yld1="72.00"
> ct_ytyp1="SDRY1" ct_clkg1="0.00" ct_yld2="76.40" ct_ytyp2="SCD17"
> ct_clkg2="0.00" ct_yld3="73.50" ct_ytyp3="JCS " ct_clkg3="0.00"
> ct_yld4="69.80" ct_ytyp4="ACARB" ct_clkg4="0.00" ct_minmic="0.0"
> ct_maxmic="0.0" ct_minvmb="0.0" ct_maxvmb="0.0" ct_fctwb="0.00"
> ct_fctvmb="0.00" ct_fcthh="0.00" ct_fctmic="0.000000" ct_rtst1="NORM "
> ct_reiss1=" " ct_type2=" " ct_prefx2=" " ct_code2=" "
> ct_suffx2=" " ct_chk2=" " ct_lab2=" " ct_slen="0" ct_slencv="0"
> ct_str="0" ct_minlen="0" ct_maxlen="0" ct_minstr="0" ct_maxstr="0"
> ct_pobt="0" ct_pobm="0" ct_pobb="0" ct_haut="0" ct_ehaut="0.0" ct_lstype="
> " ct_lsecur="false" ct_type3=" " ct_prefx3=" " ct_code3="
"
> ct_suffx3=" " ct_chk3=" " ct_lab3=" " ct_colx="0.0" ct_coly="0.0"
> ct_colz="0.0" ct_ecolyz="0.0" ct_colyz="0.0" ct_mincolx="0.0"
> ct_maxcolx="0.0" ct_mincoly="0.0" ct_maxcoly="0.0" ct_mincolz="0.0"
> ct_maxcolz="0.0" ct_minclyz="0.0" ct_maxclyz="0.0" ct_reiss3=" "
> ct_cvh="0.0" ct_noil="0.0" ct_dark="N" bh_brandp="SR/COR
> " bh_descp="AAALM " bh_area="N28 " bh_stowloc="
> "/>
> </VFPData>
> <END DATA SECTION>
> As you can see from the data, I have left out lots of fields to fit in pos
t.
> Anyway, we want to do a bulk load of this data, but none of the schema
> sections look like examples on the web where you can setup 'sql:' options
> for the field names etc.. In fact this XML/schema file don't look like
> anything I have seen on the web. I guess it is just a bit more complex tha
n
> usual.
> So would I be able do a bulkload with this data?
> I have cut out the schema and pasted into another file but I don't know
> where to go next as the file looks so different from others I have seen.
> Can anyone help me with some options on how to use these files for a bulk
> load?
> TIA
> Nathan
>
>|||Sorry, you don't have to open your XML datafile...
You can create the schema from your database without it
"susanne" wrote:
> Hi Nathan,
> my suggestion:
> DId you design a database (inclusive tables and relations) already? If NOT
,
> do this...
> (maybe with the help of XMLSpy ... export xml data to database...)
> then
> Take your XML Datafile, open it with XMLSpy (Enterprise Edition in
> evaluation version available), and go through:
> --> Convert --> Create XML schema from DB structure
> Now you have mapping-schema. ToDo: Add the missing relationships
> like...
> <xs:annotation>
> <xs:appinfo>
> <sql:relationship name="name"
> parent="Table" parent-key="Table_ID"
> child="RelatedTable" child-key="Table_ID"/>
> </xs:appinfo>
> </xs:annotation>
> ...
> then, add the sql:is-constant for your root-element like ...
> <xs:element name="ROOT" sql:is-constant="1">
> and your mapping schema is complete.
> Regards
> SUsanne
>
> "Nathan Simpson" wrote:
>

How to import this file

I have a MS SQL 2000 Server and i wanna run a chat script whitch need SQL. I have a File which is called db.schema! I don`t know how to import these file into the DB. Can someone help me?
thxbcp?
DTS?
BULK INSERT?

Check out Books Online..|||Sorry i`m newbie! I don`t know what you mean.|||Do you have SQL Server client installed on your machine?

If you do, goo look those things up in the menu item called books online (BOL)

It's the SQL Server reference manual|||No i have only installed SQL 2000 Server!
I will install the client if there is no other way.|||Is it a desktop edition?

Even if it is, you'd have books online in your start menu...

I never work on the server though, except to do the install and monkey around with services, ect...|||No its the MSDN SQL Enterprise Server edition.|||OK, did you find books online yet?

Do you know what Enterprise Manager is?

How about Query Analyzer?|||I know what Enterprise Manager is. I can creat db`s and users. But i don`t know many morn things in MSSQL!|||Well go to Enterprise manager...

Open up a server

Right click on data transformation services

click on all tasks

Click import data

the wizard should do the work for you...|||No it want, i still have tried these way but the extension .schema is not supported!|||What kind of file is it?

can you view it with notepad?

just change the extension to text|||yes i can. I try it tomorrow as a text file.|||It didn`t work after i rename this file to .txt!

I will post the code in the File here:

# db.schema
# SQL database schemas and initial test data
# $Id: db.schema,v 1.48.2.1 2003/08/06 10:41:26 letreo Exp $

#
# Dumping data for table 'poc_user_account'
#

DROP TABLE IF EXISTS poc_user_account;
CREATE TABLE poc_user_account (
USER varchar(255) NOT NULL,
PASSWORD varchar(255),
CONFIRM_CODE char(32),
DISABLED int NOT NULL DEFAULT '0',
PRIMARY KEY (USER)
) TYPE=MyISAM;
ALTER TABLE poc_user_account ADD PASSWORD_NEW varchar(255);

#
# Test users in alphabetical order of family names
#

INSERT INTO poc_user_account (USER,PASSWORD,PASSWORD_NEW,DISABLED) VALUES ('mirko','giese','30ebe4d47a2a1661f9d04f84d80466c1 ',0);
INSERT INTO poc_user_account (USER,PASSWORD,PASSWORD_NEW,DISABLED) VALUES ('frerk','meyer','b6273c0ba3ae37a4d3d1c6b084797f2e ',0);
INSERT INTO poc_user_account (USER,PASSWORD,PASSWORD_NEW,DISABLED) VALUES ('michael','oertel','fe0d21a59c0f5ba4e4860d83641c8 4e8',0);
INSERT INTO poc_user_account (USER,PASSWORD,DISABLED) VALUES ('operator','',0);

#
# Dumping data for table 'poc_user_groups'
#

DROP TABLE IF EXISTS poc_user_groups;
CREATE TABLE poc_user_groups (
NAME varchar(255) NOT NULL,
MEMBER text,
PRIMARY KEY (NAME)
) TYPE=MyISAM;

#
# Groups
#

INSERT INTO poc_user_groups VALUES ('chatter',NULL);
INSERT INTO poc_user_groups VALUES ('operator','a:2:{i:0;s:8:"operator";i:1;s:5:"Admin";}');
INSERT INTO poc_user_groups VALUES ('moderator',NULL);
INSERT INTO poc_user_groups VALUES ('vip',NULL);

#
# Dumping data for table 'poc_user_data'
#

DROP TABLE IF EXISTS poc_user_data;
CREATE TABLE poc_user_data (
NICK char(32) NOT NULL,
USER char(255) NOT NULL,
NAME char(255) NOT NULL,
THEME char(25) NOT NULL DEFAULT '',
BIRTHDAY date NOT NULL,
GENDER char(1) NOT NULL DEFAULT '',
EMAIL char(255),
PRIVATE_INVITED char(32) NOT NULL DEFAULT '',
HIDE_EMAIL char(1) NOT NULL DEFAULT '1',
PICTURE_URL varchar(255),
HOMEPAGE_URL varchar(255),
INTERESTS text,
MOTTO text,
ICQ_NUMBER int NOT NULL DEFAULT '0',
AIM_NICKNAME char(30) NOT NULL DEFAULT '',
YIM_NICKNAME char(30) NOT NULL DEFAULT '',
COLOR char(6) DEFAULT '000000',
ONLINE char(1),
LAST_CHANNEL char(32),
ADVICE char(5) default 'quiet',
SCROLLSPEED int,
FRIENDS text,
GRADE char(20) NOT NULL DEFAULT 'GRADE_ROOKIE',
REGTIME datetime,
LAST_ACTIVE_TIME datetime,
ONLINE_TIME int NOT NULL DEFAULT '0',
LINES_PER_DAY double,
LOGINS_PER_DAY double,
DAYS_REGISTERED integer,
LAST_HOST char(50),
LAST_IP char(15),
LAST_USER_AGENT char(100),
LAST_SESSIONID char(35),
LAST_REFERER char(100),
MISC text,
TMP_INSTANCE text NOT NULL DEFAULT '',
PRIMARY KEY (NICK),
KEY (USER)
) TYPE=MyISAM;

#
# Test users in alphabetical order of family names
#

INSERT INTO poc_user_data (NICK,USER,NAME,BIRTHDAY,EMAIL,COLOR,REGTIME) VALUES ("operator","operator","The Operator",'1969-03-24',"me@.here.net","003300","1999-12-31 23:59:59");
INSERT INTO poc_user_data (NICK,USER,NAME,BIRTHDAY,EMAIL,COLOR,REGTIME) VALUES ("superman","mirko","Mirko Giese",'1971-02-29',"mirko@.giese.de","66AACC","2000-12-31 23:59:59");
INSERT INTO poc_user_data (NICK,USER,NAME,BIRTHDAY,EMAIL,COLOR,REGTIME) VALUES ("tux","frerk","Frerk Meyer",'1967-06-24',"frerk@.meyer.de","AACC66","1998-12-31 23:59:59");
INSERT INTO poc_user_data (NICK,USER,NAME,BIRTHDAY,EMAIL,COLOR,REGTIME) VALUES ("micha","michael","Michael Oertel",'1969-03-24',"michael@.oertel.de","CCAA66","1999-12-31 23:59:59");

#
# Dumping data for table 'poc_user_notes'
#

DROP TABLE IF EXISTS poc_user_notes;
CREATE TABLE poc_user_notes (
NICKNAME varchar(32) NOT NULL,
ABOUT varchar(32) NOT NULL,
NOTE text,
PRIMARY KEY (NICKNAME,ABOUT),
KEY (NICKNAME,ABOUT)
) TYPE=MyISAM;

#
# Dumping data for table 'poc_channels'
#

DROP TABLE IF EXISTS poc_channels;
CREATE TABLE poc_channels (
NAME char(32) NOT NULL,
PASSWORD char(12),
MESSAGE char(255),
MAX_LINE_NUMBER int NOT NULL,
CUR_LINE_NUMBER int NOT NULL,
START datetime,
STOP datetime,
TYPE int NOT NULL DEFAULT '0',
INVITED text,
ORDER_IDX int,
PRIMARY KEY (NAME),
KEY (NAME)
) TYPE=MyISAM;

#
# Default channel data
#

INSERT INTO poc_channels(NAME,MAX_LINE_NUMBER,CUR_LINE_NUMBER, TYPE,ORDER_IDX) VALUES ('default',50,0,0,0);
INSERT INTO poc_channels(NAME,MAX_LINE_NUMBER,CUR_LINE_NUMBER, TYPE,ORDER_IDX) VALUES ('moderation',50,0,1,1);

#
# Dumping data for table 'poc_line_buffer'
#

DROP TABLE IF EXISTS poc_line_buffer;
CREATE TABLE poc_line_buffer (
NAME char(32) NOT NULL,
LINE_0 text,
LINE_1 text,
LINE_2 text,
LINE_3 text,
LINE_4 text,
LINE_5 text,
LINE_6 text,
LINE_7 text,
LINE_8 text,
LINE_9 text,
LINE_10 text,
LINE_11 text,
LINE_12 text,
LINE_13 text,
LINE_14 text,
LINE_15 text,
LINE_16 text,
LINE_17 text,
LINE_18 text,
LINE_19 text,
LINE_20 text,
LINE_21 text,
LINE_22 text,
LINE_23 text,
LINE_24 text,
LINE_25 text,
LINE_26 text,
LINE_27 text,
LINE_28 text,
LINE_29 text,
LINE_30 text,
LINE_31 text,
LINE_32 text,
LINE_33 text,
LINE_34 text,
LINE_35 text,
LINE_36 text,
LINE_37 text,
LINE_38 text,
LINE_39 text,
LINE_40 text,
LINE_41 text,
LINE_42 text,
LINE_43 text,
LINE_44 text,
LINE_45 text,
LINE_46 text,
LINE_47 text,
LINE_48 text,
LINE_49 text,
PRIMARY KEY (NAME),
KEY (NAME)
) TYPE=MyISAM;

#
# Default channel data
#

INSERT INTO poc_line_buffer (NAME) VALUES ('default');
INSERT INTO poc_line_buffer (NAME) VALUES ('moderation');

#
# Dumping data for table 'poc_mails'
#

DROP TABLE IF EXISTS poc_mails;
CREATE TABLE poc_mails (
SENDER char(25) NOT NULL,
TIME char(19) NOT NULL,
RECIPIENT char(25) NOT NULL,
MAIL text,
TRASHED_BY_SENDER int NOT NULL DEFAULT '0',
TRASHED_BY_RECIPIENT int NOT NULL DEFAULT '0',
PRIMARY KEY (SENDER,RECIPIENT,TIME),
KEY (SENDER),
KEY (RECIPIENT)
) TYPE=MyISAM;

#
# Dumping data for table 'poc_hits'
#

DROP TABLE IF EXISTS poc_hits;
CREATE TABLE poc_hits (
USER char(25) NOT NULL,
USERPAGE int NOT NULL DEFAULT '0',
LINE int NOT NULL DEFAULT '0',
BANN int NOT NULL DEFAULT '0',
LOGIN int NOT NULL DEFAULT '0',
PRIMARY KEY (USER),
KEY (USER)
) TYPE=MyISAM;

DROP TABLE IF EXISTS poc_banned_users;
CREATE TABLE poc_banned_users (
USER varchar(25) NOT NULL,
TIME_BANNED datetime NOT NULL DEFAULT '2000-12-31 23:59:59',
BANNED_FOR char(32) NOT NULL DEFAULT '',
PRIMARY KEY (USER,BANNED_FOR),
KEY (USER),
KEY (BANNED_FOR)
) TYPE=MyISAM;

DROP TABLE IF EXISTS poc_cache;
CREATE TABLE poc_cache (
ID char(255) NOT NULL,
MAX_AGE datetime,
CONTENT text,
PRIMARY KEY (ID),
KEY (ID)
) TYPE=MyISAM;

DROP TABLE IF EXISTS poc_guestbook;
CREATE TABLE poc_guestbook (
USER varchar(25) NOT NULL,
SENDER varchar(25) NOT NULL,
TIME int NOT NULL,
POST text,
PRIMARY KEY (SENDER,TIME),
KEY (USER,TIME)
) TYPE=MyISAM;|||This isn't something which you would import.

As its a script, you would open iSQL (Sql Query Analyser) onto the appropriate server/db. Open your script file (File/Open) and execute it. F5.

However, on a quick look at the script it doesn't look like MS SQL so immediately you're going to have problems.

You'll have to change the syntax from whatever SQL it is to that which MS SQL Server will understand.

Mark|||This script should work ond MSSQL 2000!|||Have you run it is query analyser ?

I did against SQL 2000 and it errors out all over the place.
For example the fieldname NAME is a keyword so its not allowed.

Anyhow, if what your saying is correct, then it should run, if its not,
what are the error messages you're getting ?

Where did you get the script from ?|||The script is form http://phpopenchat.org|||Its by default for MYSQL. It is open source.

You'll need to modify it for any other database, ie SQL Server.|||ooo this sucks. i can`t do that. but thx for your help|||try and change it to SQL Server, it won't be too difficult.

Run the script in pieces, this will make it easier to see the issues.

For example the drop table syntax is incorrect, so as you're trying to create the db object from scratch, you could just remove those lines.

Also the first table has a field called USER which SQL Server will not allow. However if you change it to USERNAME and do so with all of the other references to the field USER in the script, that error will go away.

Be careful though, as if you change the fieldnames, you'll also need to search through the PHP code for references there and change accordingly.

Below you'll find some work I did on the script for you. This script will run, but remember that USER is now USERNAME so this will require PHP code changes

I've changed the following:

- # to -- (comments)
- Commented out the DROP TABLES
- Rename USER to USERNAME
- Changed field types of double to integer (should be fine)
- Commented out script with KEY ( fieldname ) - note not PRIMARY KEY - (you need to look at creating new indexes in SQL Server for these)
- Double quotes with quotes (this may need to be changed back again by you, depending on how your SQL Server is setup)


-- db.schema
-- SQL database schemas and initial test data
-- $Id: db.schema,v 1.48.2.1 2003/08/06 10:41:26 letreo Exp $

--
-- Dumping data for table 'poc_user_account'
--

--DROP TABLE poc_user_account;
CREATE TABLE poc_user_account (
USERNAME varchar(255) NOT NULL,
PASSWORD varchar(255),
CONFIRM_CODE char(32),
DISABLED int NOT NULL DEFAULT '0',
PRIMARY KEY (USERNAME)
)
ALTER TABLE poc_user_account ADD PASSWORD_NEW varchar(255);

--
-- Test users in alphabetical order of family names
--

INSERT INTO poc_user_account (USERNAME,PASSWORD,PASSWORD_NEW,DISABLED) VALUES ('mirko','giese','30ebe4d47a2a1661f9d04f84d80466c1 ',0);
INSERT INTO poc_user_account (USERNAME,PASSWORD,PASSWORD_NEW,DISABLED) VALUES ('frerk','meyer','b6273c0ba3ae37a4d3d1c6b084797f2e ',0);
INSERT INTO poc_user_account (USERNAME,PASSWORD,PASSWORD_NEW,DISABLED) VALUES ('michael','oertel','fe0d21a59c0f5ba4e4860d83641c8 4e8',0);
INSERT INTO poc_user_account (USERNAME,PASSWORD,DISABLED) VALUES ('operator','',0);

--
-- Dumping data for table 'poc_user_groups'
--

--DROP TABLE poc_user_groups;
CREATE TABLE poc_user_groups (
NAME varchar(255) NOT NULL,
MEMBER text,
PRIMARY KEY (NAME)
)

--
-- Groups
--

INSERT INTO poc_user_groups VALUES ('chatter',NULL);
INSERT INTO poc_user_groups VALUES ('operator','a:2:{i:0;s:8:'operator';i:1;s:5:'Admi n';}');
INSERT INTO poc_user_groups VALUES ('moderator',NULL);
INSERT INTO poc_user_groups VALUES ('vip',NULL);

--
-- Dumping data for table 'poc_user_data'
--

--DROP TABLE poc_user_data;
CREATE TABLE poc_user_data (
NICK char(32) NOT NULL,
USERNAME char(255) NOT NULL,
NAME char(255) NOT NULL,
THEME char(25) NOT NULL DEFAULT '',
BIRTHDAY datetime NOT NULL,
GENDER char(1) NOT NULL DEFAULT '',
EMAIL char(255),
PRIVATE_INVITED char(32) NOT NULL DEFAULT '',
HIDE_EMAIL char(1) NOT NULL DEFAULT '1',
PICTURE_URL varchar(255),
HOMEPAGE_URL varchar(255),
INTERESTS text,
MOTTO text,
ICQ_NUMBER int NOT NULL DEFAULT '0',
AIM_NICKNAME char(30) NOT NULL DEFAULT '',
YIM_NICKNAME char(30) NOT NULL DEFAULT '',
COLOR char(6) DEFAULT '000000',
ONLINE char(1),
LAST_CHANNEL char(32),
ADVICE char(5) default 'quiet',
SCROLLSPEED int,
FRIENDS text,
GRADE char(20) NOT NULL DEFAULT 'GRADE_ROOKIE',
REGTIME datetime,
LAST_ACTIVE_TIME datetime,
ONLINE_TIME int NOT NULL DEFAULT '0',
LINES_PER_DAY integer,
LOGINS_PER_DAY integer,
DAYS_REGISTERED integer,
LAST_HOST char(50),
LAST_IP char(15),
LAST_USERNAME_AGENT char(100),
LAST_SESSIONID char(35),
LAST_REFERER char(100),
MISC text,
TMP_INSTANCE text NOT NULL DEFAULT '',
PRIMARY KEY (NICK)
--,
-- KEY (USERNAME)
)

--
-- Test users in alphabetical order of family names
--

INSERT INTO poc_user_data (NICK,USERNAME,NAME,BIRTHDAY,EMAIL,COLOR,REGTIME) VALUES ('operator','operator','The Operator','1969-03-24','me@.here.net','003300','1999-12-31 23:59:59');
INSERT INTO poc_user_data (NICK,USERNAME,NAME,BIRTHDAY,EMAIL,COLOR,REGTIME) VALUES ('superman','mirko','Mirko Giese','1967-06-24','mirko@.giese.de','66AACC','1998-12-31 23:59:59');
INSERT INTO poc_user_data (NICK,USERNAME,NAME,BIRTHDAY,EMAIL,COLOR,REGTIME) VALUES ('tux','frerk','Frerk Meyer','1967-06-24','frerk@.meyer.de','AACC66','1998-12-31 23:59:59');
INSERT INTO poc_user_data (NICK,USERNAME,NAME,BIRTHDAY,EMAIL,COLOR,REGTIME) VALUES ('micha','michael','Michael Oertel','1969-03-24','michael@.oertel.de','CCAA66','1999-12-31 23:59:59');

--
-- Dumping data for table 'poc_user_notes'
--

--DROP TABLE poc_user_notes;
CREATE TABLE poc_user_notes (
NICKNAME varchar(32) NOT NULL,
ABOUT varchar(32) NOT NULL,
NOTE text,
PRIMARY KEY (NICKNAME,ABOUT)
)

--
-- Dumping data for table 'poc_channels'
--

--DROP TABLE poc_channels;
CREATE TABLE poc_channels (
NAME char(32) NOT NULL,
PASSWORD char(12),
MESSAGE char(255),
MAX_LINE_NUMBER int NOT NULL,
CUR_LINE_NUMBER int NOT NULL,
START datetime,
STOP datetime,
TYPE int NOT NULL DEFAULT '0',
INVITED text,
ORDER_IDX int,
PRIMARY KEY (NAME)
)

--
-- Default channel data
--

INSERT INTO poc_channels(NAME,MAX_LINE_NUMBER,CUR_LINE_NUMBER, TYPE,ORDER_IDX) VALUES ('default',50,0,0,0);
INSERT INTO poc_channels(NAME,MAX_LINE_NUMBER,CUR_LINE_NUMBER, TYPE,ORDER_IDX) VALUES ('moderation',50,0,1,1);

--
-- Dumping data for table 'poc_line_buffer'
--

--DROP TABLE poc_line_buffer;
CREATE TABLE poc_line_buffer (
NAME char(32) NOT NULL,
LINE_0 text,
LINE_1 text,
LINE_2 text,
LINE_3 text,
LINE_4 text,
LINE_5 text,
LINE_6 text,
LINE_7 text,
LINE_8 text,
LINE_9 text,
LINE_10 text,
LINE_11 text,
LINE_12 text,
LINE_13 text,
LINE_14 text,
LINE_15 text,
LINE_16 text,
LINE_17 text,
LINE_18 text,
LINE_19 text,
LINE_20 text,
LINE_21 text,
LINE_22 text,
LINE_23 text,
LINE_24 text,
LINE_25 text,
LINE_26 text,
LINE_27 text,
LINE_28 text,
LINE_29 text,
LINE_30 text,
LINE_31 text,
LINE_32 text,
LINE_33 text,
LINE_34 text,
LINE_35 text,
LINE_36 text,
LINE_37 text,
LINE_38 text,
LINE_39 text,
LINE_40 text,
LINE_41 text,
LINE_42 text,
LINE_43 text,
LINE_44 text,
LINE_45 text,
LINE_46 text,
LINE_47 text,
LINE_48 text,
LINE_49 text,
PRIMARY KEY (NAME)
)

--
-- Default channel data
--

INSERT INTO poc_line_buffer (NAME) VALUES ('default');
INSERT INTO poc_line_buffer (NAME) VALUES ('moderation');

--
-- Dumping data for table 'poc_mails'
--

--DROP TABLE poc_mails;
CREATE TABLE poc_mails (
SENDER char(25) NOT NULL,
TIME char(19) NOT NULL,
RECIPIENT char(25) NOT NULL,
MAIL text,
TRASHED_BY_SENDER int NOT NULL DEFAULT '0',
TRASHED_BY_RECIPIENT int NOT NULL DEFAULT '0',
PRIMARY KEY (SENDER,RECIPIENT,TIME)
--,
-- KEY (SENDER),
-- KEY (RECIPIENT)
)

--
-- Dumping data for table 'poc_hits'
--

--DROP TABLE poc_hits;
CREATE TABLE poc_hits (
USERNAME char(25) NOT NULL,
USERPAGE int NOT NULL DEFAULT '0',
LINE int NOT NULL DEFAULT '0',
BANN int NOT NULL DEFAULT '0',
LOGIN int NOT NULL DEFAULT '0',
PRIMARY KEY (USERNAME)
)

--DROP TABLE poc_banned_users;
CREATE TABLE poc_banned_users (
USERNAME varchar(25) NOT NULL,
TIME_BANNED datetime NOT NULL DEFAULT '2000-12-31 23:59:59',
BANNED_FOR char(32) NOT NULL DEFAULT '',
PRIMARY KEY (USERNAME,BANNED_FOR)
--,
-- KEY (USERNAME),
-- KEY (BANNED_FOR)
)

--DROP TABLE poc_cache;
CREATE TABLE poc_cache (
ID char(255) NOT NULL,
MAX_AGE datetime,
CONTENT text,
PRIMARY KEY (ID)
)

--DROP TABLE poc_guestbook;
CREATE TABLE poc_guestbook (
USERNAME varchar(25) NOT NULL,
SENDER varchar(25) NOT NULL,
TIME int NOT NULL,
POST text,
PRIMARY KEY (SENDER,TIME)
--,
-- KEY (USERNAME,TIME)
)|||Thx a lot. But do you know a good chat script which use PHP and MSSQL? I think this would be much easier than your way :-)!|||afraid not :-)|||I use most of the time MySQL DB. Beceaus it`s much easier. But now i have the job to install a chat on a MSSQL DB and that sucks hard.|||The references to USER which need to be changed to USERNAME are most likely only going to be found in the .inc files and theres only a few of those.

If I was you, I'd spend just a couple of hours on this, run the sql script I gave you, then search and replace/change the USER PHP code references and then try the chat room :-)

how to import the database data from backup file ?

Hello,All:

I have two sql 2000 servers,one for production and the other is for backup server,I used the sql agent to create bakup daily in Sql server Enterprise Manager.

Now I want to import the backup data(generated by production server),I don't know how to do it.

Is it possible to do it ? anyone can give me a soluation ?

thanks in advanced!

->Open Enterprise manager of SQL Server 2000

-> Select Your Server

-> right click on your database

-> All Tasks -> Restore Database

-> Select from Device

-> click the button Select Devices

-> in the new window select Disk option

-> click add button

-> select your backup file in file name option

-> ok

->ok

->ok

How to import tables from other database

Hi there,

I am having difficulties in importing table from one sql server database file to another sql server database file.

A few months ago, I converted access file to ms sql express file. I had made many changes on the ms sql express file, however, the data in this file isn't the latest as the old system is still being used. Now, I want to deploy my new system, I need to import in necessary tables from the old system database, as well as, I want to retain the tables and data I created on the ms sql express file that I have been using so far for development and testing.

May I know how to import tables from other database? Just as in ms access where we can import tables from other access file. I'm using sql express 2005 and sql server management tool. Any advice/help is very much appreciated.

Thanks...

import you Access data to another database on the server and next write T-SQL statement which will move data from old structure to your new structure. If you have access to full SQL server version you can also try SQL SSIS import package but I think that T-SQL is more flexible in this case.|||

u can use this scripter ... http://www.sqlscripter.com/

using this u can create T-SQL ...

how to import MySql dump file?

Dear sir,
I got a file in the format of MySlq dump .sql file. It is about 120mb.
However should I import it into my MSDE database? I have MSDE in my XP pc,
but I do have a Enterprise manager on my PC as well.
Thanks.Hi
MySQL is not a Microsoft product. You need to load your MySQL dump into a
MySQL database installation. From there, you need to BCP or export the data
to MSDE.
A direct load is not possible.
Regards
Mike
"Guoqi Zheng" wrote:

> Dear sir,
> I got a file in the format of MySlq dump .sql file. It is about 120mb.
> However should I import it into my MSDE database? I have MSDE in my XP pc
,
> but I do have a Enterprise manager on my PC as well.
> Thanks.
>
>

Monday, March 12, 2012

How to import MySQL data into SQL2005 using wizard?

Hello everybody,

I'm a new SQL2005 user.
I'm

trying to import data from MySQL version 5x into my SQL2005 by wizard.

I created a DNS file and tested successfully using MySQL Connector/ODBC

v5.
Everthing seems fine but at the last step selecting data

source. The SQL2005 wizard forced me to choose using SQL command option

instead of selecting tables/views from a list. Anyone can tell me why?

My collegues faced the same case as they help me to find the reason.

I'm sure that there are a few source objetcts in MySQL source.

Any help will be appreciated!!!

khanhmy

Hi,

Unfortunately this is the limitation of the Import/Export Wizard in SQL 2005. It can't get table metadata for ADO.NET and ODBC sources, so the only way to use it with ADO.NET or ODBC sources is to type the SQL command.

We are looking at fixing this for next version.

Regards,

Michael.

How to import mysql data into SQL Server 2000 ?

Hi all,
I have a *.sql backup file, is there any method to import the backup into
SQL Server 2000 ? I cannot open it in the SQL Query Analyzer.
Thanks a lot !Hi,
That is actually a dump file of MYSQL. You cant use that in SQL Server
directly. Ways to transfer data from MYSQL to SQL server is given below:-
1. DTS
2. Generated comma seperated text file in MYSQL and use BCP IN / to load it.
Better and easiest option is to use DTS to copy data between
Thanks
Hari
MCDBA
<.> wrote in message news:OWZ8OZ5QEHA.2404@.TK2MSFTNGP09.phx.gbl...
> Hi all,
> I have a *.sql backup file, is there any method to import the backup into
> SQL Server 2000 ? I cannot open it in the SQL Query Analyzer.
> Thanks a lot !
>

How to import mysql data into SQL Server 2000 ?

Hi all,
I have a *.sql backup file, is there any method to import the backup into
SQL Server 2000 ? I cannot open it in the SQL Query Analyzer.
Thanks a lot !Hi,
That is actually a dump file of MYSQL. You cant use that in SQL Server
directly. Ways to transfer data from mysql to SQL server is given below:-
1. DTS
2. Generated comma seperated text file in mysql and use BCP IN / to load it.
Better and easiest option is to use DTS to copy data between
Thanks
Hari
MCDBA
<.> wrote in message news:OWZ8OZ5QEHA.2404@.TK2MSFTNGP09.phx.gbl...
> Hi all,
> I have a *.sql backup file, is there any method to import the backup into
> SQL Server 2000 ? I cannot open it in the SQL Query Analyzer.
> Thanks a lot !
>

How to import mysql data into SQL Server 2000 ?

Hi all,
I have a *.sql backup file, is there any method to import the backup into
SQL Server 2000 ? I cannot open it in the SQL Query Analyzer.
Thanks a lot !
Hi,
That is actually a dump file of MYSQL. You cant use that in SQL Server
directly. Ways to transfer data from MYSQL to SQL server is given below:-
1. DTS
2. Generated comma seperated text file in MYSQL and use BCP IN / to load it.
Better and easiest option is to use DTS to copy data between
Thanks
Hari
MCDBA
<.> wrote in message news:OWZ8OZ5QEHA.2404@.TK2MSFTNGP09.phx.gbl...
> Hi all,
> I have a *.sql backup file, is there any method to import the backup into
> SQL Server 2000 ? I cannot open it in the SQL Query Analyzer.
> Thanks a lot !
>

How to import in special character delimited text file by using SSIS ?

Hi,

I would like to know how to import in the custom delimited text file by using SSIS.

For example, instead by using tab or comma delimited, I use this character : '?'

The reason is the delimited format that SSIS provided is too common such as colon, semi colon, tab, comma and pipeline.

I have the data that the user also key in the pipeline there. So I am thinking to separate the field by using this special character, but cannot see if there is anyway to import in by using SSIS.

Please help to share the solution on this :

A?B?C
1?2?3

thanks

best regards,

Tanipar

You can import this as a single column and then use a script transform to cycle through your row and break it down into the appropriate columns. There are various examples of doing this relating to uneven / unbalanced / dynamic number of columns...

http://agilebi.com/cs/blogs/jwelch/archive/2007/05/07/handling-flat-files-with-varying-numbers-of-columns.aspx

|||I am a fan of the approach above Smile, but you can also just use a flat file connection manager. Go to the Columns page in the editor, and put the symbol into the Column Delimiter field. That works fine for me. The approach above is usually only necessary when dealing with flat files with missing columns or delimiters.|||Learn something new every day... I figured since it was a drop down that you could only use the values present, I didn't realize you could type there... Let's just say this approach is MUCH easier :-)