Showing posts with label application. Show all posts
Showing posts with label application. Show all posts

Friday, March 30, 2012

Import PARADOX Problems

Hello,

I've the following problem. I've to read out the data of a custom
application. I think (I'm not sure) this application is using a
Paradox DB to store it's information. I don't know it exactly cause
I'm not familar with paradox at all, but I've found files like *.db,
*.mb, *.px, *.xg*, *.yg* !!!
I need the infomation from this files to combine it with other data
stored in SQL 2000. I'm tried DTS to import the Data but I've got an
"Microsoft JET Database" Error telling me that the table could not be
found or that the table has not the asumed format. It depends on which
*.db File i try to open. Description: Error calling the OPENROWSET
method on the provider.

My Questions, are there some special drivers i need, not included in
MS MDAC Components or must I use a complete Databaseserver in the
Backgroud hosting the DB Files. My developer station has the custom
application NOT installed. The db files seems to have no password set.
I've got the same error when using MS Access to import the data. I
only set the path to the dictionary where the files are in but leave
username and password blank.

HOW TO GET THIS DATA OUT ?

Thank you

TonyTony,

Before wasting a lot more time, get a copy of Paradox and see if
you can open these files. If not, they probably aren't Paradox files.
The only evidence you give that these are unprotected Paradox files
is that they have Paradox extensions and "seem to have no password
set", whatever that means.

The evidence that they are not unprotected Paradox files seems
stronger - dts doesn't understand them.

I've used the Import/Export Data wizard with the Microsoft Driver
for Paradox successfully, but if you still think these may be Paradox
files, see if Paradox agrees with you.

-- Steve Kass
-- Drew University
-- Ref: 5F4FF6F4-815B-4EE8-AE48-5C556CF24104

TonyMontana wrote:
> Hello,
> I've the following problem. I've to read out the data of a custom
> application. I think (I'm not sure) this application is using a
> Paradox DB to store it's information. I don't know it exactly cause
> I'm not familar with paradox at all, but I've found files like *.db,
> *.mb, *.px, *.xg*, *.yg* !!!
> I need the infomation from this files to combine it with other data
> stored in SQL 2000. I'm tried DTS to import the Data but I've got an
> "Microsoft JET Database" Error telling me that the table could not be
> found or that the table has not the asumed format. It depends on which
> *.db File i try to open. Description: Error calling the OPENROWSET
> method on the provider.
> My Questions, are there some special drivers i need, not included in
> MS MDAC Components or must I use a complete Databaseserver in the
> Backgroud hosting the DB Files. My developer station has the custom
> application NOT installed. The db files seems to have no password set.
> I've got the same error when using MS Access to import the data. I
> only set the path to the dictionary where the files are in but leave
> username and password blank.
> HOW TO GET THIS DATA OUT ?
> Thank you
> Tony|||Hello Steve,

thanks for your help. I've found a bde installation and now i can
access the tables via the SQL Tool for BDE by Stefan Bodingh www.bodingh.se
so I can assume that the data is not encrypted and not currupt.
Nevertheless i can't
access them via ODBC or the MS PAradox driver. I've tried it on 2 machines.
Is the a command line tool out there which i can use to export the tables to
text [csv] Files? Pherhaps a special one for bde without so much
incompability as the ODBC connection seems to have.

regards

Tony

"Steve Kass" <skass@.drew.edu> schrieb im Newsbeitrag
news:yGt5b.27082$Om1.16634@.newsread2.news.atl.eart hlink.net...
> Tony,
> Before wasting a lot more time, get a copy of Paradox and see if
> you can open these files. If not, they probably aren't Paradox files.
> The only evidence you give that these are unprotected Paradox files
> is that they have Paradox extensions and "seem to have no password
> set", whatever that means.
> The evidence that they are not unprotected Paradox files seems
> stronger - dts doesn't understand them.
> I've used the Import/Export Data wizard with the Microsoft Driver
> for Paradox successfully, but if you still think these may be Paradox
> files, see if Paradox agrees with you.
> -- Steve Kass
> -- Drew University
> -- Ref: 5F4FF6F4-815B-4EE8-AE48-5C556CF24104
> TonyMontana wrote:
> > Hello,
> > I've the following problem. I've to read out the data of a custom
> > application. I think (I'm not sure) this application is using a
> > Paradox DB to store it's information. I don't know it exactly cause
> > I'm not familar with paradox at all, but I've found files like *.db,
> > *.mb, *.px, *.xg*, *.yg* !!!
> > I need the infomation from this files to combine it with other data
> > stored in SQL 2000. I'm tried DTS to import the Data but I've got an
> > "Microsoft JET Database" Error telling me that the table could not be
> > found or that the table has not the asumed format. It depends on which
> > *.db File i try to open. Description: Error calling the OPENROWSET
> > method on the provider.
> > My Questions, are there some special drivers i need, not included in
> > MS MDAC Components or must I use a complete Databaseserver in the
> > Backgroud hosting the DB Files. My developer station has the custom
> > application NOT installed. The db files seems to have no password set.
> > I've got the same error when using MS Access to import the data. I
> > only set the path to the dictionary where the files are in but leave
> > username and password blank.
> > HOW TO GET THIS DATA OUT ?
> > Thank you
> > Tony|||Tony,

I think you might find some people who know in a Paradox
newsgroup. I'm not sure why the MS driver doesn't work.
It only lists Paradox versions up to 5.0, though, so perhaps
can't handle recent versions.

SK

Tony.Montana wrote:
> Hello Steve,
> thanks for your help. I've found a bde installation and now i can
> access the tables via the SQL Tool for BDE by Stefan Bodingh www.bodingh.se
> so I can assume that the data is not encrypted and not currupt.
> Nevertheless i can't
> access them via ODBC or the MS PAradox driver. I've tried it on 2 machines.
> Is the a command line tool out there which i can use to export the tables to
> text [csv] Files? Pherhaps a special one for bde without so much
> incompability as the ODBC connection seems to have.
> regards
> Tony
> "Steve Kass" <skass@.drew.edu> schrieb im Newsbeitrag
> news:yGt5b.27082$Om1.16634@.newsread2.news.atl.eart hlink.net...
>>Tony,
>>
>> Before wasting a lot more time, get a copy of Paradox and see if
>>you can open these files. If not, they probably aren't Paradox files.
>> The only evidence you give that these are unprotected Paradox files
>>is that they have Paradox extensions and "seem to have no password
>>set", whatever that means.
>>
>> The evidence that they are not unprotected Paradox files seems
>>stronger - dts doesn't understand them.
>>
>> I've used the Import/Export Data wizard with the Microsoft Driver
>>for Paradox successfully, but if you still think these may be Paradox
>>files, see if Paradox agrees with you.
>>
>>-- Steve Kass
>>-- Drew University
>>-- Ref: 5F4FF6F4-815B-4EE8-AE48-5C556CF24104
>>
>>TonyMontana wrote:
>>
>>>Hello,
>>>
>>>I've the following problem. I've to read out the data of a custom
>>>application. I think (I'm not sure) this application is using a
>>>Paradox DB to store it's information. I don't know it exactly cause
>>>I'm not familar with paradox at all, but I've found files like *.db,
>>>*.mb, *.px, *.xg*, *.yg* !!!
>>>I need the infomation from this files to combine it with other data
>>>stored in SQL 2000. I'm tried DTS to import the Data but I've got an
>>>"Microsoft JET Database" Error telling me that the table could not be
>>>found or that the table has not the asumed format. It depends on which
>>>*.db File i try to open. Description: Error calling the OPENROWSET
>>>method on the provider.
>>>
>>>My Questions, are there some special drivers i need, not included in
>>>MS MDAC Components or must I use a complete Databaseserver in the
>>>Backgroud hosting the DB Files. My developer station has the custom
>>>application NOT installed. The db files seems to have no password set.
>>>I've got the same error when using MS Access to import the data. I
>>>only set the path to the dictionary where the files are in but leave
>>>username and password blank.
>>>
>>>HOW TO GET THIS DATA OUT ?
>>>
>>>Thank you
>>>
>>>Tony
>>|||Steve,

I am almost sure the Microsoft stuff read only to what are called LEVEL 5
databases (basically Paradox Version 5 and below). There was Paradox 7, 9,
and 10. Which I think are LEVEL 7 databases. Probably what happend was
that the developer put some field types that are only supported in LEVEL 7
and up.

Oscar...
"Steve Kass" <skass@.drew.edu> wrote in message
news:mpN5b.30725$Om1.4521@.newsread2.news.atl.earth link.net...
> Tony,
> I think you might find some people who know in a Paradox
> newsgroup. I'm not sure why the MS driver doesn't work.
> It only lists Paradox versions up to 5.0, though, so perhaps
> can't handle recent versions.
> SK
> Tony.Montana wrote:
> > Hello Steve,
> > thanks for your help. I've found a bde installation and now i can
> > access the tables via the SQL Tool for BDE by Stefan Bodingh
www.bodingh.se
> > so I can assume that the data is not encrypted and not currupt.
> > Nevertheless i can't
> > access them via ODBC or the MS PAradox driver. I've tried it on 2
machines.
> > Is the a command line tool out there which i can use to export the
tables to
> > text [csv] Files? Pherhaps a special one for bde without so much
> > incompability as the ODBC connection seems to have.
> > regards
> > Tony
> > "Steve Kass" <skass@.drew.edu> schrieb im Newsbeitrag
> > news:yGt5b.27082$Om1.16634@.newsread2.news.atl.eart hlink.net...
> >>Tony,
> >>
> >> Before wasting a lot more time, get a copy of Paradox and see if
> >>you can open these files. If not, they probably aren't Paradox files.
> >> The only evidence you give that these are unprotected Paradox files
> >>is that they have Paradox extensions and "seem to have no password
> >>set", whatever that means.
> >>
> >> The evidence that they are not unprotected Paradox files seems
> >>stronger - dts doesn't understand them.
> >>
> >> I've used the Import/Export Data wizard with the Microsoft Driver
> >>for Paradox successfully, but if you still think these may be Paradox
> >>files, see if Paradox agrees with you.
> >>
> >>-- Steve Kass
> >>-- Drew University
> >>-- Ref: 5F4FF6F4-815B-4EE8-AE48-5C556CF24104
> >>
> >>TonyMontana wrote:
> >>
> >>>Hello,
> >>>
> >>>I've the following problem. I've to read out the data of a custom
> >>>application. I think (I'm not sure) this application is using a
> >>>Paradox DB to store it's information. I don't know it exactly cause
> >>>I'm not familar with paradox at all, but I've found files like *.db,
> >>>*.mb, *.px, *.xg*, *.yg* !!!
> >>>I need the infomation from this files to combine it with other data
> >>>stored in SQL 2000. I'm tried DTS to import the Data but I've got an
> >>>"Microsoft JET Database" Error telling me that the table could not be
> >>>found or that the table has not the asumed format. It depends on which
> >>>*.db File i try to open. Description: Error calling the OPENROWSET
> >>>method on the provider.
> >>>
> >>>My Questions, are there some special drivers i need, not included in
> >>>MS MDAC Components or must I use a complete Databaseserver in the
> >>>Backgroud hosting the DB Files. My developer station has the custom
> >>>application NOT installed. The db files seems to have no password set.
> >>>I've got the same error when using MS Access to import the data. I
> >>>only set the path to the dictionary where the files are in but leave
> >>>username and password blank.
> >>>
> >>>HOW TO GET THIS DATA OUT ?
> >>>
> >>>Thank you
> >>>
> >>>Tony
> >sql

import of multiple CSV files in one MS SQL table

Hi all,

I have de following application to do :

I receive several .csv files from another application in a determined folder
of my PC.

Those files are named with the format log1.csv logs2.csv logs...
The number of file is variable but the internal format is always : time_sec;level
So the files content a field that may be used as unique key in the target database.

I'm trying to build a DTS package that should import periodically
all the CSV's present in the folder and then destroy them if done
successfully.

Apparently its not so simple than I supposed. I have always to give the name
of the table I want to import.

any idea?"Laurent" <autplc@.hotmail.com> wrote in message
news:e8bac87e.0411100552.5af177ca@.posting.google.c om...
> I receive several .csv files from another application in a determined
folder
> of my PC.
> Those files are named with the format log1.csv logs2.csv logs...
> The number of file is variable but the internal format is always :
time_sec;level
> So the files content a field that may be used as unique key in the target
database.
>
> I'm trying to build a DTS package that should import periodically
> all the CSV's present in the folder and then destroy them if done
> successfully.

Two Options:

Option 1:
Rename the file to a temporary name (in an ActiveX task) and use the
temporary name for the Data Pump

Option 2:
Use a Dynamic Properties Task to change the Data Source Name in the Data
Pump Task.

Regards,
Jim

Wednesday, March 28, 2012

Import MDB File

I have a current Access 03 application that has a 3 tables that I would like to import, can this be done?

Davids Learning

You can't import mdb file to Sql server. but for alternative you can import data from acces 03 to sql server. the 1st, you must make new database & table (same with mdb file).

You can do, right click your db file in database manager, and then click import data. Please follow instruction from Sql......

Thanks

Jebat

import large field from SSIS

Hi,

I am making a SSIS package that imports data from a application using a custom ODBC driver. The field in the application is set to be a "longvarchar" type field and can be from 2 characters to 2MB of data.

I've created a ODBC data connection in the SSIS package and use a "DataReader Source" to read the data I need. The sql statement is very simple

Select log from tablename

When I try to run the SSIS package with that statement it just goes to yellow on the DataReader Source and stops. It stays like that until I stop it. If I select other fields except for that field it works fine. Also I've been able to get it to succeed getting the log field if I select a log record that's not too big. The largest one I've been able to get is 800 characters, but I got one with 2500 characters that just stops on yellow.

In the Progress log the last line says:

[DTS.Pipeline] Information: Execute phase is beginning.

Does anyone have any ideas on how to resolve this?
Have you check the ValidateMetadeta properties of data source Is there any warning message appear in you data reader ?|||I've tried both with having the ValidateMetaData option to false and true but it doesn't make any difference. There is no error/warning messages in the progress log and I don't know of any other places to look for error messages.

This is really starting to annoy me, but this is the only way we can get the data out of that system so I need this to work...
|||

Hi,

DataReaderSrc is not particularly efficient about dealing with BLOB data, such as DT_NTEXT or DT_IMAGE columns. It may be that it is just being slow...

Unfortunately, DataReaderSrc does not utilize the perf counters for BLOB bytes read -- this is a known issue that is planned to be fixed in a future release. If you look at perfmon while the package is running, what's happening with the CPU and memory usage?

mark

|||Thanks for your answer. When looking at the perfmon and the task manager while running the package I was a bit surprised.
First of in the perfmon the Memory object is steady on 0, the Physical Disk object is going up and down from 0 to 20 and then there is the occasional spike up to 100.
Then there is the processor object which stays at around 50 constantly. Looking at the task manager the process: "DtsDebugHost.exe" is staying at 50% CPU and using 30.976 K memory. Is this normal when executing a package?

I was thinking too that it might just be slow. But I changed my query to only select 1 record based on the id of the record and it still stays on for 20 min+ (I stopped it after that). If I select a record that got less data in the BLOB field then it completes within 10 seconds.

My development server is a Intel Xeon dual 3.6 GHz with 3 GB memory so I don't think our server is good enough Smile

If the future fix will fix this issue that will be good enough, because I sort of told people that we have to find a different way to create the reports.
|||

The "future fix" I spoke of was just to add the performance counters to DataReaderSrc, which would help diagnose issues like this one.

I will try to set up a similar scenario here to see if I can reproduce the behaviour you are seeing.

thanks

Mark

|||

Hi Josh,

I created a package with a datareader source, and used connections of the type:

.NET Providers\SqlClient Data Provider

.NET Providers\Odbc Data Provider

In both cases, i was able to read 20 Mb of TEXT data in a second or two.

Is it possible for you to try using a different driver/provider?

Can you try using some other application with your driver/provider to see if you can read the data or if you have the same problem?

thanks

Mark

import large field from SSIS

Hi,

I am making a SSIS package that imports data from a application using a custom ODBC driver. The field in the application is set to be a "longvarchar" type field and can be from 2 characters to 2MB of data.

I've created a ODBC data connection in the SSIS package and use a "DataReader Source" to read the data I need. The sql statement is very simple

Select log from tablename

When I try to run the SSIS package with that statement it just goes to yellow on the DataReader Source and stops. It stays like that until I stop it. If I select other fields except for that field it works fine. Also I've been able to get it to succeed getting the log field if I select a log record that's not too big. The largest one I've been able to get is 800 characters, but I got one with 2500 characters that just stops on yellow.

In the Progress log the last line says:

[DTS.Pipeline] Information: Execute phase is beginning.

Does anyone have any ideas on how to resolve this?
Have you check the ValidateMetadeta properties of data source Is there any warning message appear in you data reader ?|||I've tried both with having the ValidateMetaData option to false and true but it doesn't make any difference. There is no error/warning messages in the progress log and I don't know of any other places to look for error messages.

This is really starting to annoy me, but this is the only way we can get the data out of that system so I need this to work...
|||

Hi,

DataReaderSrc is not particularly efficient about dealing with BLOB data, such as DT_NTEXT or DT_IMAGE columns. It may be that it is just being slow...

Unfortunately, DataReaderSrc does not utilize the perf counters for BLOB bytes read -- this is a known issue that is planned to be fixed in a future release. If you look at perfmon while the package is running, what's happening with the CPU and memory usage?

mark

|||Thanks for your answer. When looking at the perfmon and the task manager while running the package I was a bit surprised.
First of in the perfmon the Memory object is steady on 0, the Physical Disk object is going up and down from 0 to 20 and then there is the occasional spike up to 100.
Then there is the processor object which stays at around 50 constantly. Looking at the task manager the process: "DtsDebugHost.exe" is staying at 50% CPU and using 30.976 K memory. Is this normal when executing a package?

I was thinking too that it might just be slow. But I changed my query to only select 1 record based on the id of the record and it still stays on for 20 min+ (I stopped it after that). If I select a record that got less data in the BLOB field then it completes within 10 seconds.

My development server is a Intel Xeon dual 3.6 GHz with 3 GB memory so I don't think our server is good enough Smile

If the future fix will fix this issue that will be good enough, because I sort of told people that we have to find a different way to create the reports.
|||

The "future fix" I spoke of was just to add the performance counters to DataReaderSrc, which would help diagnose issues like this one.

I will try to set up a similar scenario here to see if I can reproduce the behaviour you are seeing.

thanks

Mark

|||

Hi Josh,

I created a package with a datareader source, and used connections of the type:

.NET Providers\SqlClient Data Provider

.NET Providers\Odbc Data Provider

In both cases, i was able to read 20 Mb of TEXT data in a second or two.

Is it possible for you to try using a different driver/provider?

Can you try using some other application with your driver/provider to see if you can read the data or if you have the same problem?

thanks

Mark

Monday, March 26, 2012

Import from MySQL db adds padding in CHAR (Text) fields

I'm moving a small application from a MySQL db to MSSQL2K and using the Import feature of SQL2K. The db in question is simple, only three tables, mostly text (CHAR) fields. The problem is that when I examine the field contents I find that the unused cha
racter positions within the fields have been padded with trailing spaces. (Example: original 10 char field containing "ABC" now contains "ABC ". Application not happy. I've tried a number of options in the Import wizard (ansi padding etc) and it
seems to have had no effect. Any ideas? Solutions? KB articles?
Thanks for ANY help.
-J
By definition, a char(10) is always padded with spaces up to the length of the datatype. This is why we call
char a fixed length datatype. If you want a variable length datatype, use varchar.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"JManton" <anonymous@.discussions.microsoft.com> wrote in message
news:D89560CC-AAAB-459C-A039-8073C17EB2ED@.microsoft.com...
> I'm moving a small application from a MySQL db to MSSQL2K and using the Import feature of SQL2K. The db in
question is simple, only three tables, mostly text (CHAR) fields. The problem is that when I examine the
field contents I find that the unused character positions within the fields have been padded with trailing
spaces. (Example: original 10 char field containing "ABC" now contains "ABC ". Application not happy.
I've tried a number of options in the Import wizard (ansi padding etc) and it seems to have had no effect.
Any ideas? Solutions? KB articles?
> Thanks for ANY help.
> -J
|||That was it. I guess there are a few diffs between MySQL and MSSQL. I also had to tweak the recordID field and use IDENTITY attribute. Thanks for the quick reply and on-the-mark-help.
-J

Import from MySQL db adds padding in CHAR (Text) fields

I'm moving a small application from a mysql db to MSSQL2K and using the Impo
rt feature of SQL2K. The db in question is simple, only three tables, mostl
y text (CHAR) fields. The problem is that when I examine the field contents
I find that the unused cha
racter positions within the fields have been padded with trailing spaces. (E
xample: original 10 char field containing "ABC" now contains "ABC ".
Application not happy. I've tried a number of options in the Import wizar
d (ansi padding etc) and it
seems to have had no effect. Any ideas? Solutions? KB articles?
Thanks for ANY help.
-JBy definition, a char(10) is always padded with spaces up to the length of t
he datatype. This is why we call
char a fixed length datatype. If you want a variable length datatype, use va
rchar.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"JManton" <anonymous@.discussions.microsoft.com> wrote in message
news:D89560CC-AAAB-459C-A039-8073C17EB2ED@.microsoft.com...
> I'm moving a small application from a mysql db to MSSQL2K and using the Import fea
ture of SQL2K. The db in
question is simple, only three tables, mostly text (CHAR) fields. The probl
em is that when I examine the
field contents I find that the unused character positions within the fields
have been padded with trailing
spaces. (Example: original 10 char field containing "ABC" now contains "ABC
". Application not happy.
I've tried a number of options in the Import wizard (ansi padding etc) and i
t seems to have had no effect.
Any ideas? Solutions? KB articles?
> Thanks for ANY help.
> -J|||That was it. I guess there are a few diffs between mysql and MSSQL. I also
had to tweak the recordID field and use IDENTITY attribute. Thanks for the
quick reply and on-the-mark-help.
-J

Import from MySQL db adds padding in CHAR (Text) fields

I'm moving a small application from a MySQL db to MSSQL2K and using the Import feature of SQL2K. The db in question is simple, only three tables, mostly text (CHAR) fields. The problem is that when I examine the field contents I find that the unused character positions within the fields have been padded with trailing spaces. (Example: original 10 char field containing "ABC" now contains "ABC ". Application not happy. I've tried a number of options in the Import wizard (ansi padding etc) and it seems to have had no effect. Any ideas? Solutions? KB articles?
Thanks for ANY help.
-JBy definition, a char(10) is always padded with spaces up to the length of the datatype. This is why we call
char a fixed length datatype. If you want a variable length datatype, use varchar.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"JManton" <anonymous@.discussions.microsoft.com> wrote in message
news:D89560CC-AAAB-459C-A039-8073C17EB2ED@.microsoft.com...
> I'm moving a small application from a MySQL db to MSSQL2K and using the Import feature of SQL2K. The db in
question is simple, only three tables, mostly text (CHAR) fields. The problem is that when I examine the
field contents I find that the unused character positions within the fields have been padded with trailing
spaces. (Example: original 10 char field containing "ABC" now contains "ABC ". Application not happy.
I've tried a number of options in the Import wizard (ansi padding etc) and it seems to have had no effect.
Any ideas? Solutions? KB articles?
> Thanks for ANY help.
> -J

import from excel to SQL Server - can it be more efficient ?

Hello All,

Iam new to the world of ASP .Net. Right now iam building an application that will IMPORT about 5,000 records from an Excel spreadsheet to a table in MS SQL Server. Right now the code works correctly, but i feel it is not efficient and takes a little bit of more time in doing the import. Could you guys throw some light on how i can make the code run more faster ? Someone suggested me that i can use DataAdapter and update the table in the database thru an update method available with it. I dont know how to do it? Could anyone share with me a snippet of code that does this ?

Here is my code:

Private Sub ProcessRecords()
Dim ds2 As New DataSet
' readExcelSheet is a user-defined function that reads a spreadsheet and returns a DataSet object
ds2 = readExcelSheet("C:\Inetpub\wwwroot\Project1\Book2.xls", "SELECT * FROM [Sheet1$]")
Dim myConnection As SqlConnection = Connection() ' user-defined function that returns a SQLConnection object
myConnection.Open()
Dim strSQL As String = "insert_member" ' stored procedure that inserts records
Dim myCommand As New SqlCommand(strSQL, myConnection)
myCommand.CommandType = CommandType.StoredProcedure
myCommand.Parameters.Add("@.salutation", SqlDbType.NVarChar)
myCommand.Parameters.Add("@.firstname", SqlDbType.NVarChar)
myCommand.Parameters.Add("@.lastname", SqlDbType.NVarChar)
myCommand.Parameters.Add("@.company", SqlDbType.NVarChar)

Dim i, j As Integer
Response.Write(Date.Now() & "<br>")
For i = 0 To ds2.Tables("Members").Rows.Count() - 1
myCommand.Parameters("@.salutation").Value = ds2.Tables("Members").Rows(i).Item("sal")
myCommand.Parameters("@.firstname").Value = ds2.Tables("Members").Rows(i).Item("firstname")
myCommand.Parameters("@.lastname").Value = ds2.Tables("Members").Rows(i).Item("lastname")
myCommand.Parameters("@.company").Value = ds2.Tables("Members").Rows(i).Item("company")
j = myCommand.ExecuteNonQuery()
If (j > 0) Then
Response.Write("Record Inserted - " & i + 1 & "<br>")
End If
Next
Response.Write(Date.Now() & "<br>")
myConnection.Close()
End Sub

Please reply soon.
Thank You.can you show us the readExcelObject class?

i got this unspecified exception when trying to connect to an excel file:

System.Data.OleDb.OleDbException: Unspecified error at System.Data.OleDb.OleDbConnectionInternal.InitializeProvider() at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnection conn, OleDbConnectionString constr) at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object providerInfo, DbConnectionBase owningObject) at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnectionBase owningConnection, DbConnectionPoolGroup poolGroup) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnectionBase owningConnection) at System.Data.ProviderBase.DbConnectionClosed.Open(DbConnectionBase outerConnection) at System.Data.ProviderBase.DbConnectionBase.Open() at ASP.excel1_aspx.LoadExcelIntoDS() in c:\excel_dev\excel1.aspx:line 25

<%@. Page language="c#" %>
<%@. Import Namespace="System.Runtime"%>
<%@. Import Namespace="System"%>
<%@. Import Namespace="System.Data"%>
<%@. Import Namespace="System.Data.OleDb"%
<script runat=server>
void Page_Load(Object src, EventArgs e)
{
LoadExcelIntoDS();
}
void LoadExcelIntoDS()
{
OleDbConnection MyConnection = new OleDbConnection();
try
{
String conn = "Provider=Microsoft.Jet.OLEDB.4.0;";
conn += @."Data Source=C:\excel_dev\demo_banc.xls;";
conn += "Extended Properties=Excel 8.0;";
MyConnection = new OleDbConnection(conn);
MyConnection.Open();
}
catch(ArgumentException ae)
{
Response.Write(ae.ToString() + "<BR>");
}
catch(OleDbException e)
{
String err_msg = "";
for (int i = 0; i < e.Errors.Count; i++)
err_msg += "------<br>Index #" + i + "<br>Message: " + e.Errors[i].Message + "<br>NativeError: " + e.Errors[i].NativeError + "<br>Source: " + e.Errors[i].Source + "<br>SQLState: " + e.Errors[i].SQLState + "<br>";
Response.Write(err_msg + "<br>");
Response.Write(e.ToString() + "<BR>");
}
catch(Exception e)
{
Response.Write(e.ToString() + "<br>");
}
finally
{
MyConnection.Close();
}
}|||solved.

pls refer to:

http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=314899

Friday, March 23, 2012

Import flat file into SQL Server 2005 Express

I am new to SQL Server, and migrating part of an Access application to
SSE. I am trying to insert a comma delimited file into SSE 2005. I am
able to run a BULK INSERT statement on a simple file, specifying the
field (,) and row (\n) terminators. I can also do the same with a
format file.

Here is the problem. My csv file has 185 columns, with a mixture of
datatypes. Sometimes, a text field will contain the field delimiter as
part of the string. In this case (and only in this case) there will be
double quotes around the string to indicate that the comma is part of
the field, and not a delimiter.

Is there any way to indicate that there is a text delimiter that is
only present some of the time?

If not, any suggestions on getting the data into SSE?

Many thanks for your input.

Cheryl(cabrenner@.optonline.net) writes:

Quote:

Originally Posted by

I am new to SQL Server, and migrating part of an Access application to
SSE. I am trying to insert a comma delimited file into SSE 2005. I am
able to run a BULK INSERT statement on a simple file, specifying the
field (,) and row (\n) terminators. I can also do the same with a
format file.
>
Here is the problem. My csv file has 185 columns, with a mixture of
datatypes. Sometimes, a text field will contain the field delimiter as
part of the string. In this case (and only in this case) there will be
double quotes around the string to indicate that the comma is part of
the field, and not a delimiter.


So a file could look like this:

2,34,Enter Sandman,Pat Boone
9,34,Zabadak,"Dave, Dee, Dozy, Mich & Tich"
8,981,"Rebel, Rebel",David Bowie

There is now way to get BULK INSERT to handle this file in that shape.
If I were faced with this file, I would write Perl script that replaced
the commas outside the "" with a different delimiter and then removed the
"". And it would not be trivial.

Most other people would probably try to write a package in Integration
Services, but I have never used Integration Services myself. And for your
part - SQL Express does not come with Integration Services, I believe.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||In message <Xns98B096E86FA00Yazorman@.127.0.0.1>, Erland Sommarskog
<esquel@.sommarskog.sewrites

Quote:

Originally Posted by

(cabrenner@.optonline.net) writes:

Quote:

Originally Posted by

>I am new to SQL Server, and migrating part of an Access application to
>SSE. I am trying to insert a comma delimited file into SSE 2005. I am
>able to run a BULK INSERT statement on a simple file, specifying the
>field (,) and row (\n) terminators. I can also do the same with a
>format file.
>>
>Here is the problem. My csv file has 185 columns, with a mixture of
>datatypes. Sometimes, a text field will contain the field delimiter as
>part of the string. In this case (and only in this case) there will be
>double quotes around the string to indicate that the comma is part of
>the field, and not a delimiter.


>
>So a file could look like this:
>
2,34,Enter Sandman,Pat Boone
9,34,Zabadak,"Dave, Dee, Dozy, Mich & Tich"
8,981,"Rebel, Rebel",David Bowie
>
>There is now way to get BULK INSERT to handle this file in that shape.
>If I were faced with this file, I would write Perl script that replaced
>the commas outside the "" with a different delimiter and then removed the
>"". And it would not be trivial.
>
>Most other people would probably try to write a package in Integration
>Services, but I have never used Integration Services myself. And for your
>part - SQL Express does not come with Integration Services, I believe.


Two things to add, both useful options if the amount of data is small.
First, the import filters in MS Access are better than those in SQL
Server. If the data will fit into an Access table that might just do the
trick. Second, spreadsheets have more flexible parsing options than
databases. It may be possible to load the data into a spreadsheet. That
allows different algorithms to be applied to different rows.

Lastly, text files can be opened and read by VBA code in any of the
office languages, or any of the .NET languages. Either could be used,
but writing code to cope with all of the possible options may take time.

--
Bernard Peek
back in search of cognoscenti|||Erland Sommarskog (esquel@.sommarskog.se) writes:

Quote:

Originally Posted by

So a file could look like this:
>
2,34,Enter Sandman,Pat Boone
9,34,Zabadak,"Dave, Dee, Dozy, Mich & Tich"
8,981,"Rebel, Rebel",David Bowie
>
There is now way to get BULK INSERT to handle this file in that shape.
If I were faced with this file, I would write Perl script that replaced
the commas outside the "" with a different delimiter and then removed the
"". And it would not be trivial.


In addition to Bernard's post, is not Excel able to read that format?
In such case open in Except, and save as a tab-delimited file and importing
that should be a breeze. (Assuming, of course, there are no tabs in the
data!)

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Thank you both for your suggestions. Yes, I was thinking that BULK
INSERT was not going to be able to handle this. I had thought about
dumping the file into an Access table first, but the file could be very
large (200,000+ rows). I am going to try the Excel spreadsheet idea.

Erland Sommarskog wrote:

Quote:

Originally Posted by

Erland Sommarskog (esquel@.sommarskog.se) writes:

Quote:

Originally Posted by

So a file could look like this:

2,34,Enter Sandman,Pat Boone
9,34,Zabadak,"Dave, Dee, Dozy, Mich & Tich"
8,981,"Rebel, Rebel",David Bowie

There is now way to get BULK INSERT to handle this file in that shape.
If I were faced with this file, I would write Perl script that replaced
the commas outside the "" with a different delimiter and then removed the
"". And it would not be trivial.


>
In addition to Bernard's post, is not Excel able to read that format?
In such case open in Except, and save as a tab-delimited file and importing
that should be a breeze. (Assuming, of course, there are no tabs in the
data!)
>
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
>
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

|||(cabrenner@.optonline.net) writes:

Quote:

Originally Posted by

Thank you both for your suggestions. Yes, I was thinking that BULK
INSERT was not going to be able to handle this. I had thought about
dumping the file into an Access table first, but the file could be very
large (200,000+ rows). I am going to try the Excel spreadsheet idea.


200000+ rows? Then Access is probably a better bet. Doesn't Excel stop
at 65536 rows?

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Erland Sommarskog wrote:

Quote:

Originally Posted by

(cabrenner@.optonline.net) writes:

Quote:

Originally Posted by

>Thank you both for your suggestions. Yes, I was thinking that BULK
>INSERT was not going to be able to handle this. I had thought about
>dumping the file into an Access table first, but the file could be very
>large (200,000+ rows). I am going to try the Excel spreadsheet idea.


>
200000+ rows? Then Access is probably a better bet. Doesn't Excel stop
at 65536 rows?


I think the latest version of Excel may have a higher row limit - which
only increases the tendency of newbies to misuse Excel as a "database".|||You are correct - Excel has a limit on the number of rows. I thought
about that after I sent the reply. So now I am looking at Access.

Here is my next question. I want to use OPENROWSET in a procedure to
get the data from Access into SSE. My code looks something like this:

INSERT INTO sse_table1 Select GFF.*
FROM OPENROWSET(
'Microsoft.Jet.OLEDB.4.0',
'path to mdb';'admin';'',
'Select * FROM access_table1
) as GFF

This works great. However, the location of the access database is only
known at runtime. I can pass the path as a parameter to the stored
procedure, but using it as a variable in OPENROWSET fails. Code looks
like this

CREATE PROCEDURE [dbo].[spImportBillingFile]
@.strTableLocation varchar(255),
@.btSuccess bit OUTPUT
AS
BEGIN

DECLARE @.strConnect varchar(255)
SET @.strConnect = @.strTableLocation

INSERT INTO tbl_ups_eInvoice_tmpData Select GFF.*
FROM OPENROWSET(
'Microsoft.Jet.OLEDB.4.0',
' + @.strConnect + ';'admin';'',
'Select * FROM tbl_ups_eInvoice_tmpData'
) as GFF

Set @.btSuccess = 1

END

Does OPENROWSET not allow a variable to be used?

Thanks again for the help.

Ed Murphy wrote:

Quote:

Originally Posted by

Erland Sommarskog wrote:
>

Quote:

Originally Posted by

(cabrenner@.optonline.net) writes:

Quote:

Originally Posted by

Thank you both for your suggestions. Yes, I was thinking that BULK
INSERT was not going to be able to handle this. I had thought about
dumping the file into an Access table first, but the file could be very
large (200,000+ rows). I am going to try the Excel spreadsheet idea.


200000+ rows? Then Access is probably a better bet. Doesn't Excel stop
at 65536 rows?


>
I think the latest version of Excel may have a higher row limit - which
only increases the tendency of newbies to misuse Excel as a "database".

|||(cabrenner@.optonline.net) writes:

Quote:

Originally Posted by

INSERT INTO tbl_ups_eInvoice_tmpData Select GFF.*
FROM OPENROWSET(
'Microsoft.Jet.OLEDB.4.0',
' + @.strConnect + ';'admin';'',
'Select * FROM tbl_ups_eInvoice_tmpData'
) as GFF
>
Set @.btSuccess = 1
>
END
>
Does OPENROWSET not allow a variable to be used?


No. Either you have to use dynamic SQL, or define a linked server on the
fly. The former is probably simpler. Look at
http://www.sommarskog.se/dynamic_sql.html#OPENQUERY for a similar example
on how to deal with the nested strings.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Thanks for all the info - I figured out how to use the dynamic sql.

Erland Sommarskog wrote:

Quote:

Originally Posted by

(cabrenner@.optonline.net) writes:

Quote:

Originally Posted by

INSERT INTO tbl_ups_eInvoice_tmpData Select GFF.*
FROM OPENROWSET(
'Microsoft.Jet.OLEDB.4.0',
' + @.strConnect + ';'admin';'',
'Select * FROM tbl_ups_eInvoice_tmpData'
) as GFF

Set @.btSuccess = 1

END

Does OPENROWSET not allow a variable to be used?


>
No. Either you have to use dynamic SQL, or define a linked server on the
fly. The former is probably simpler. Look at
http://www.sommarskog.se/dynamic_sql.html#OPENQUERY for a similar example
on how to deal with the nested strings.
>
>
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
>
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

sql

Wednesday, March 21, 2012

Import Excel Spreadsheet Data into SQL Server Database Table Using SqlBulkCopy

Hi, I'm a Student, and since a few months ago I'm learning JAVA. I'm creating an application to call and compare times. For this I create in Excel a time table which is quite big and it would be a lot of typing work to input one by one the data in each cell in SQL Server, considering that I have to create 8 more tables. I was able to retreive the data from excel usin the JXL API of JAVA but it doesn't give all the funtions to perform math operations as JDBC. That's why I need to move the tables from Excel to SQL.

I found this sitehttp://davidhayden.com/blog/dave/archive/2006/05/31/2976.aspx which gives a code to do so, but I guess that some heathers are missing or maybe I don't know which compiler to use to run that code, I would like you help to identify which compiler use to run that code or if there is some vital piece of code missing.

// Connection String to Excel Workbookstring excelConnectionString=@."Provider=Microsoft
.Jet.OLEDB.4.0;Data Source=Book1.xls;Extended
Properties=""Excel 8.0;HDR=YES;""";// Create Connection to Excel Workbookusing (OleDbConnection connection=
new OleDbConnection(excelConnectionString)){ OleDbCommand command=new OleDbCommand
("Select ID,Data FROM [Data$]", connection); connection.Open();// Create DbDataReader to Data Worksheetusing (DbDataReader dr= command.ExecuteReader()) {// SQL Server Connection Stringstring sqlConnectionString="Data Source=.;
Initial Catalog=Test;Integrated Security=True";// Bulk Copy to SQL Serverusing (SqlBulkCopy bulkCopy=
new SqlBulkCopy(sqlConnectionString)) { bulkCopy.DestinationTableName="ExcelData"; bulkCopy.WriteToServer(dr); } }}

On the other hand in this forum I that someelse use that link but implements a totally different code which I'm not able to compile alsohttp://forums.asp.net/p/1110412/2057095.aspx#2057095. It seems this code works as I was able to read, but I do not know which language is used.

Dim excelConnectionStringAsString ="Provider=Microsoft .Jet.OLEDB.4.0;Data Source=Book1.xls;Extended Properties=""Excel 8.0;HDR=YES;"""

' Using

Dim connectionAs OleDbConnection =New OleDbConnection(excelConnectionString)

Try

Dim commandAs OleDbCommand =New OleDbCommand("Select ID,Data FROM [Data$]", connection)

connection.Open()

' Using

Dim drAs DbDataReader = command.ExecuteReader

Try

Dim sqlConnectionStringAsString = WebConfigurationManager.ConnectionStrings("CampaignEnterpriseConnectionString").ConnectionString

' Using

Dim bulkCopyAs SqlBulkCopy =New SqlBulkCopy(sqlConnectionString)

Try

bulkCopy.DestinationTableName =

"ExcelData"

bulkCopy.WriteToServer(dr)

Finally

CType(bulkCopy, IDisposable).Dispose()

EndTry

Finally

CType(dr, IDisposable).Dispose()

EndTry

Finally

CType(connection, IDisposable).Dispose()

EndTry

Catch exAs Exception

EndTry

The Compilers I have are: Eclipse, Netbeans, MS Visual C++ Express Edition and MS Visual C# Express Edition. In MS Visual C++

Thanks for your help.

Regads,

Robert.

Hi,

From your description, it seems that you want to connect to your EXCEL table by OLDEB from your application, right?

If so, you can build your connection string in the following way, and create the oledbcommand object to execute your query statement.

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=ExcelFilePath;Extended Properties="Excel 8.0;HDR=Yes;IMEX=1";
string SQLQuery = "SELECT * FROM [sheet1$]".
// excel worksheet name followed by a "$" and wrapped in "[" "]" brackets.

For details, see:

http://support.microsoft.com/kb/326548 (Excel Part)

Besides, If your application runs in 64-bit mode, all of the components it uses must also be 64-bit. There is no 64-bit Jet OLE DB Provider, so you get the message described. You would receive a similar error when trying to connect to a database using OLE DB or ODBC if there is no 64-bit version of the specified OLE DB provider or ODBC driver.

http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=123311

Thanks.

|||

if you really would like be sure that your import is successfully, do not use OLE DB or any other tolls to export your data from excel. Just use excel to export data to any common format like DBase, ACCESS, flat file and next import it to place you want. It will save you a lot of problems because the best tool to read Excel data is Excel itself and do not use other tools to do it. do not use SQL server SSIS also, it use OLE DB and does not work correctly with some excel shits.

import excel file to SQL server

Hi all,
I am trying to import excel file to SQL server using web application. I have been browsing all day long trying to get some helps but I found none that really solves my problem. :(
I am aware that I can use DTS in SQL server, however I want to build a web application for it. I can upload the file on the server, my problem is I want to load the data in excel file dynamically; I will need to create a table in the server dynamically everytime I import an excel file.
Please help!!!
Thanks
IrmaHi tinybunny,
Best solution will be
Create table dynamically at application end
and the through DTS transform the data from excel file to table.
You must follow steps to perform this.
Step 1. Create table dynamically at application end.
Step 2. Then pass the dynamically table name and excel file name from application to DTS through dynamic variables.
You have to create stored procedure for this
CREATE Procedure DtsRun
/* Param List */
@.ServerName varchar(30),
@.UserName varchar(30),
@.Password varchar(30),
@.DtsName varchar(250),
@.FileN varchar(200), --File name for excel
@.TblName varchar(200) --Datatable name


AS
DECLARE @.ERROR int -- For Hold Error Number
DECLARE @.CMD varchar(1000) -- Dts Run Command
DECLARE @.DtsPassword varchar(30)
BEGIN
-- Set as No Error
SET @.ERROR = 0

BEGIN
-- With Globle Variable
SET @.CMD ='dtsrun /S '+@.ServerName+' /U '+@.UserName+' /P '+@.Password+' /N'+@.DtsName +' /A strFileName:8='+ @.FileN ' /A strFileName:8='+ @.TblName
--print @.CMD

END

EXECUTE @.ERROR = master..xp_cmdshell @.CMD


END

RETURN @.ERROR
GO
This way you will be passing values to DTS.
Step 3.Create DTS package .
Create dynamic variables for table name and excel file
and then transform data from excel to data table.

|||Hi Nitish,
Thanks a lot for your reply. THAT'S A SUPER GREAT HELP!.. I will give it a try and see if I can get it right...|||Nitish..
I have a question... on step 1, you said that I have to create the table at application end...
The problem is how can I know the column names and the column types (string, int, etc) in excel files since every excel file can have different structure?
Your reply is much appreciated...
Irma|||Excel from version XP/2003 is tabular you can run a query on it but it uses Access SQL not SQL Server version. Hope this helps.|||

Dear Gift,

Thanks for your kind reply. However, I am doing a project right now, and I have to import an excel file to SQL Server for this project. Also, I am new to DTS SQL Server, do you have any recommendations of a good article on how to create a DTS package that would transform excel file to SQL server?
Your help is greatlky appreciated.

|||

Try these links for all your options and I think there is a complete Excel Asp.net solution in the last link from Microsoft. Hope this helps.

http://www.sqldts.com/default.aspx?243

http://www.dotnetjohn.com/articles.aspx?articleid=54
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_xl2003_ta/html/Office_Excel_XML_Toolbox.asp
http://blogs.msdn.com/vsto2/

|||Thank you Gift!!!

Import excel data into sql table

Hi!

I have to develop an application for transfering data from an excel file into a sql table.The excel file is uploaded to a server.The database(and the table) is on another server.At first,I used openrowset for transferring data to the table.My sql command looked like this(in my asp page):

SQLstr = "SELECT * INTO dbo.shopping_TSR FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database="+Server.MapPath("upload/tmb2.xls")+";hdr=yes', 'SELECT * FROM [Sheet1$]')"

I kept getting this error:

[Microsoft][ODBC SQL Server Driver][SQL Server]OLE DB error trace [OLE/DB Provider 'Microsoft.Jet.OLEDB.4.0'IDBInitialize::Initialize returned 0x80004005: The provider did not give any information about the error.]

After reading a few articles,I think the cause of my error is that the excel file is uploaded into the folder where the asp script is located.I have 2 servers : one running the asp scripts and one containing the database.

Is my error generated by the fact that the excel file is on a different server than the sql server?How could I make this work?

Have you had a look at SSIS (Integration Services) if you're using SQL 2005 or DTS if you're using SQL2000. You can use the Excel Connection Manager. Can your Excel file be accessed by the SQL Server through a share?

|||I'm using SQL Server 2000.I want to automatize the process(so that the users don't have to install SQL server).After reading a few articles,I think I have a problem with the access rights on the SQL Server.Can u confirm me that?sql

Monday, March 19, 2012

Import database from access

Hi
I am develop a project with .net in windows application.my source of the
database set in access I want to working with WMSDE and I need to import the
database under the access to database in WMSDE first Is it passible?
If yes, how can I do this.
Thanks for who refer to my question
doesn't access have an upsizing wizard in it ?
"amos hchmon" <amoshchmon@.discussions.microsoft.com> wrote in message
news:91853F12-5194-4D31-891F-0C5EAFC16E94@.microsoft.com...
> Hi
> I am develop a project with .net in windows application.my source of the
> database set in access I want to working with WMSDE and I need to import
> the
> database under the access to database in WMSDE first Is it passible?
> If yes, how can I do this.
> Thanks for who refer to my question

Import database from access

Hi
I am develop a project with .net in windows application.my source of the
database set in access I want to working with WMSDE and I need to import the
database under the access to database in WMSDE first Is it passible?
If yes, how can I do this.
Thanks for who refer to my questiondoesn't access have an upsizing wizard in it ?
"amos hchmon" <amoshchmon@.discussions.microsoft.com> wrote in message
news:91853F12-5194-4D31-891F-0C5EAFC16E94@.microsoft.com...
> Hi
> I am develop a project with .net in windows application.my source of the
> database set in access I want to working with WMSDE and I need to import
> the
> database under the access to database in WMSDE first Is it passible?
> If yes, how can I do this.
> Thanks for who refer to my question|||you can import the access via SQL Servers import function in the EMC.

Import database from access

Hi
I am develop a project with .net in windows application.my source of the
database set in access I want to working with WMSDE and I need to import th
e
database under the access to database in WMSDE first Is it passible?
If yes, how can I do this.
Thanks for who refer to my questiondoesn't access have an upsizing wizard in it ?
"amos hchmon" <amoshchmon@.discussions.microsoft.com> wrote in message
news:91853F12-5194-4D31-891F-0C5EAFC16E94@.microsoft.com...
> Hi
> I am develop a project with .net in windows application.my source of the
> database set in access I want to working with WMSDE and I need to import
> the
> database under the access to database in WMSDE first Is it passible?
> If yes, how can I do this.
> Thanks for who refer to my question

import data properly from csv file.

I need to extract data from a csv file, validate it, and populate other
tables with that data for a multi user web application.
I am importing a csv file via linked servers as follows:
EXEC('SELECT * into ##temptbl FROM '+@.linked_server + '...['+@.file + '#' +
@.extension + ']')
Once data gets into ##temptbl then I do proper validation and populate other
tables.
This will not work if there are other users importing the file as well
because of global temp table ##temptbl.
Do I create a separate physical table to populate and delete based on
certain criteria for that user?
I tried using table variable inside the dynamic sql but did not work. So my
best bet for now is
to have a physical table, populate it for certain criteria, do validation,
and populate other permanent tables. After
successful population I would go ahead and delete rows this temporary
staging for certain criteria.
Does this make sense or this approach stinks?
TIA...I would really appreciate if any guru/expert could address this.
TIA...
"sqlster" wrote:

> I need to extract data from a csv file, validate it, and populate other
> tables with that data for a multi user web application.
> I am importing a csv file via linked servers as follows:
> EXEC('SELECT * into ##temptbl FROM '+@.linked_server + '...['+@.file + '#' +
> @.extension + ']')
> Once data gets into ##temptbl then I do proper validation and populate oth
er
> tables.
> This will not work if there are other users importing the file as well
> because of global temp table ##temptbl.
> Do I create a separate physical table to populate and delete based on
> certain criteria for that user?
> I tried using table variable inside the dynamic sql but did not work. So m
y
> best bet for now is
> to have a physical table, populate it for certain criteria, do validation,
> and populate other permanent tables. After
> successful population I would go ahead and delete rows this temporary
> staging for certain criteria.
> Does this make sense or this approach stinks?
> TIA...

Monday, March 12, 2012

import data from Text Files into SQL Server...?

Hi,
i wanna develop an web-database application with ASP.NET,C#, SQL server 2000.
i already have some data whichs been in text format(text file) and now, i want to import the same into my database.
the problem is, the text file has got many line breaks and also its not well formated to import it using DTS.
Can any one help me out in importing the same.
thanks in advance

Hello Kiran,
There is no way to transform the text file if it is not formatted and inconsistent.
Only thing you can do is to make it consistent at application end and then passes it to DTS package.
|||Try this link see if you can use BCP (bulk copy) with DTS. Hope this helps.
http://www.sqldts.com/default.aspx?237|||Hi,
Thanks for the response.
Even i think i need to format the text in the front end, before actually using the DTS.And thus formatted one can be easily imported.Well i gonna try that, but the probs is , even if i want to format it in the front end, the same cant be generalized to all, since each of them gonna have there own format.
any more ideas are always welcome

Import Data from SPSS (Statistical Package for the Social Sciences

hi to everyone. I'm developing a web application using C#.NET and MS SQL
Server 2000 database backend. But the user wants to transfer a huge data
from his SPSS application because it will take large amount of time to input
each of the item. My question is: Is there a way to import data from SPSS
application to the database using MS SQL Server 2000.
Specifications:
Import Data From a data file (SPSS Standard Version 11.0.0)
Hope you'll reply as soon as possible. You idea will greatly help me.
Thank you and God Bless.Hi
If this information is in a reasonably formatted file you can use BULK
INSERT command, DTS or the BCP utility to import the information. This can
be scheduled as a job and you can archive the file once loaded.
There is plenty of information on BULK INSERT, DTS and BCP in Books Online,
also check out http://www.sqldts.com/ for more DTS articles such as
http://www.sqldts.com/default.aspx?231
and http://www.sqldts.com/default.aspx?246
You will need some method of loading the data file onto your server or
somewhere accessable from the server. It may be necessary to hold the data
in a staging table(s) if it requires additional work before loading into
your destination table(s).
John
"rolly-hubport" <rollyhubport@.discussions.microsoft.com> wrote in message
news:231A4F51-B185-44D8-AE52-730275EC3C21@.microsoft.com...
> hi to everyone. I'm developing a web application using C#.NET and MS SQL
> Server 2000 database backend. But the user wants to transfer a huge data
> from his SPSS application because it will take large amount of time to
> input
> each of the item. My question is: Is there a way to import data from SPSS
> application to the database using MS SQL Server 2000.
> Specifications:
> Import Data From a data file (SPSS Standard Version 11.0.0)
>
> Hope you'll reply as soon as possible. You idea will greatly help me.
> Thank you and God Bless.
>
>|||Hi,
If u will use BCP or Bulk insert u have to manually define the table
name.
use dts package tranfer data from one server to another and u have
option to select the tables.
hope this helps u
from
doller

Import data from Excel sheet to sql Database-asp.net 2.0

In admin tool of my application,i want to give facility to administrator that he can import
data from the Excel Sheet and can insert in sql database. for example...user id and password
that from excel sheet to user table in sql database.

how can i do this..please help me. it's urgent.

thanks

raj

Did you mean you want to customize the WebSite Admin Tool? Then why not using import/export wizard in SQL Management Studio to directly import data from excel file? I mean you can detach the database file under the app_data folder in VS2005 Solution Explorer and then attach the database in Management Studio, then you can use import/export wizard to transfer data easily. Some useful links:

How to: Attach a Database:http://msdn2.microsoft.com/en-us/library/ms190209.aspx

Import/Export Wizard:http://msdn2.microsoft.com/en-us/library/ms140052.aspx