Wednesday, March 28, 2012
Importing text file
fit in here better.
Using VS.Net 2003 I built an ASP.Net Web application using
VB.Net. I connect to an SQL db(SQL Server 2000) and am setup to
write/read/edit data no problem. I'm having a problems with the following
scenario. Any help, advice, or if you could point me in the right direction
is highly appreciated.
1. The user clicks a button which opens the Find file dialogue box.
2. They navigate to the text(or possible dbf file) and click ok.
3. The a temp table is created and the text(dbf) file is imported
creating the temp table
4. A procedure is run the takes my active data(an existing table) and
archives(appends) that data to an archive table. Before this though the
data in the archive table needs to be deleted.
5. The data from my live table is deleted.
6. Data from my imported temp table is appended to the live table.
7. Temp table is deleted.
I read some stuff about DTS packages but I'm not real familiar with SQL
Server and don't know how exactly to call the DTS package from my
application and/or if DTS is actually the way to go. The text file is
delimited and contains field names that will map directly to my existing
tables. Not looking for a hand out so if you could get me pointed in the
right direction I'm not against doing more research, but at this time I'm
not exactly sure where to start. Thanks again for your time.Hi
The following web site has lots of information on DTS. There is also alot of
information in Books online (which can be downloaded from
http://www.microsoft.com/downloads/...&displaylang=en
if you don't have it!). You may also want to look up BCP or Bulk Insert as a
alternative method.
John
"Reggie" wrote:
> HI and TIA. I posted this to a vs.net NG but after looking thought it mig
ht
> fit in here better.
> Using VS.Net 2003 I built an ASP.Net Web application using
> VB.Net. I connect to an SQL db(SQL Server 2000) and am setup to
> write/read/edit data no problem. I'm having a problems with the following
> scenario. Any help, advice, or if you could point me in the right directi
on
> is highly appreciated.
> 1. The user clicks a button which opens the Find file dialogue box.
> 2. They navigate to the text(or possible dbf file) and click ok.
> 3. The a temp table is created and the text(dbf) file is imported
> creating the temp table
> 4. A procedure is run the takes my active data(an existing table) and
> archives(appends) that data to an archive table. Before this though the
> data in the archive table needs to be deleted.
> 5. The data from my live table is deleted.
> 6. Data from my imported temp table is appended to the live table.
> 7. Temp table is deleted.
> I read some stuff about DTS packages but I'm not real familiar with SQL
> Server and don't know how exactly to call the DTS package from my
> application and/or if DTS is actually the way to go. The text file is
> delimited and contains field names that will map directly to my existing
> tables. Not looking for a hand out so if you could get me pointed in the
> right direction I'm not against doing more research, but at this time I'm
> not exactly sure where to start. Thanks again for your time.
>
>|||John, Thanks very much for you quick response. I will look BOL some more.
You mention a website with lots of info but forgot the link. Take care!
Reggie
"John Bell" <jbellnewsposts@.h0tmail.com> wrote in message
news:4097B1F5-B1F6-434F-A14B-593AC227135F@.microsoft.com...
> Hi
> The following web site has lots of information on DTS. There is also alot
> of
> information in Books online (which can be downloaded from
> http://www.microsoft.com/downloads/...&displaylang=en
> if you don't have it!). You may also want to look up BCP or Bulk Insert as
> a
> alternative method.
> John
> "Reggie" wrote:
>|||Hi
Sorry anbout the missing link! http://www.sqldts.com/default.aspx?6
If you don't want the user to wait around for the file to load then you can
schedule your DTS package to run at intervals. Look at the looping example o
n
how to load all files in a given directory.
If you want to load immediately and know the destination file name, bulk
insert may also be an option. You may need use UNC addresses to get/put the
file into an accessible location.
John
"Reggie" wrote:
> John, Thanks very much for you quick response. I will look BOL some more
.
> You mention a website with lots of info but forgot the link. Take care!
> Reggie
> "John Bell" <jbellnewsposts@.h0tmail.com> wrote in message
> news:4097B1F5-B1F6-434F-A14B-593AC227135F@.microsoft.com...
>
>
Monday, March 26, 2012
Importing SQL2005 data into SQL2000
realized that our application which uses sql has a know bug in regards with
sql 2005 and we need to run sql 2000 instead until the bug is resolved. How
can we move our existing data from sql 2005 to sql2000.
Thanks.
news.microsoft.com wrote:
> We have a SQL 2005 server. After a few months in production, we have
> realized that our application which uses sql has a know bug in regards with
> sql 2005 and we need to run sql 2000 instead until the bug is resolved. How
> can we move our existing data from sql 2005 to sql2000.
> Thanks.
BCP, Integration Services or a Linked Server are three possibilities.
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
|||If there is no SQL 2005 specific changes on the table definitions and the
code (stored procedures/functions, or XML data types), you may have to script
all the objects (tables, views, stores procedures, etc.) and execute them in
SQL Server 2000. Then copy the data using SSIS or using BCP depending on how
big is the data to move.
Even is everything goes great, test it, test it again and then test more
before considering it your new production environment.
"news.microsoft.com" wrote:
> We have a SQL 2005 server. After a few months in production, we have
> realized that our application which uses sql has a know bug in regards with
> sql 2005 and we need to run sql 2000 instead until the bug is resolved. How
> can we move our existing data from sql 2005 to sql2000.
> Thanks.
>
>
Importing SQL2005 data into SQL2000
realized that our application which uses sql has a know bug in regards with
sql 2005 and we need to run sql 2000 instead until the bug is resolved. How
can we move our existing data from sql 2005 to sql2000.
Thanks.news.microsoft.com wrote:
> We have a SQL 2005 server. After a few months in production, we have
> realized that our application which uses sql has a know bug in regards with
> sql 2005 and we need to run sql 2000 instead until the bug is resolved. How
> can we move our existing data from sql 2005 to sql2000.
> Thanks.
BCP, Integration Services or a Linked Server are three possibilities.
--
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--|||If there is no SQL 2005 specific changes on the table definitions and the
code (stored procedures/functions, or XML data types), you may have to script
all the objects (tables, views, stores procedures, etc.) and execute them in
SQL Server 2000. Then copy the data using SSIS or using BCP depending on how
big is the data to move.
Even is everything goes great, test it, test it again and then test more
before considering it your new production environment.
"news.microsoft.com" wrote:
> We have a SQL 2005 server. After a few months in production, we have
> realized that our application which uses sql has a know bug in regards with
> sql 2005 and we need to run sql 2000 instead until the bug is resolved. How
> can we move our existing data from sql 2005 to sql2000.
> Thanks.
>
>sql
Importing SQL2005 data into SQL2000
realized that our application which uses sql has a know bug in regards with
sql 2005 and we need to run sql 2000 instead until the bug is resolved. How
can we move our existing data from sql 2005 to sql2000.
Thanks.news.microsoft.com wrote:
> We have a SQL 2005 server. After a few months in production, we have
> realized that our application which uses sql has a know bug in regards wit
h
> sql 2005 and we need to run sql 2000 instead until the bug is resolved. H
ow
> can we move our existing data from sql 2005 to sql2000.
> Thanks.
BCP, Integration Services or a Linked Server are three possibilities.
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--|||If there is no SQL 2005 specific changes on the table definitions and the
code (stored procedures/functions, or XML data types), you may have to scrip
t
all the objects (tables, views, stores procedures, etc.) and execute them in
SQL Server 2000. Then copy the data using SSIS or using BCP depending on how
big is the data to move.
Even is everything goes great, test it, test it again and then test more
before considering it your new production environment.
"news.microsoft.com" wrote:
> We have a SQL 2005 server. After a few months in production, we have
> realized that our application which uses sql has a know bug in regards wit
h
> sql 2005 and we need to run sql 2000 instead until the bug is resolved. H
ow
> can we move our existing data from sql 2005 to sql2000.
> Thanks.
>
>
Friday, March 23, 2012
Importing old data into asp_tables...?
I have created an application that uses the login, create, etc login components in .net. How hard is it to convert all my old users, passwords, usertypes into the new tables. It almost looks like I have to do them by hand and created a new guid(userid), along with the same guid in the aspnet_usersinroles and aspnet_Membership. Is there a script to do this programatically?
Hi,
You can use t-sql cursor to go record by record thru your old table and inserting to asp.net tables. The difficult part is passwords. I think it would be too difficult to decode and encode password in t-sql.
So, probably first import data and then use asp.net to re-encode passwords. As far as I know there are no utilities to do it automatically.
Monday, March 19, 2012
Importing DB2 ixf files into SQLServer 2000
Many thanksOriginally posted by shopper
Does anybody know of an application / tool that will allow me to import some DB2 ixf format files into a SQL Server 2000 database ?
Many thanks
Hello you can use FoxPro import and from there send it to SQL2000
my two cents
marcos oliva
Friday, February 24, 2012
Importing CVS to SQLServer 2005 in a web application
Importing CVS to SQLServer 2005 in a web application:
I need to import CSV file to a table. This is a .Net 2.0 web application running in the WebServer which has .Net 2.0 installed. SQL Server 2005 is a database in another machine. What are my options? Would SSIS work in WebServer if no database installed in that machine.
Thanks
>>.Importing CVS to SQLServer 2005 in a web application: << Do you mean CSV?
>>Would SSIS work in WebServer if no database installed in that machine.<< is SQL client and SQL Management studio was installed on the web server and you could log on to the web server.
>>What are my options? << You have specified if this is a on-off import or a regular job. One way of handling it would be to convert the csv to either a series in inserts to the table or calls to a stored procedure to do the job.
Sunday, February 19, 2012
Importing Access databases into SQL Server
I have a situation where an application needs to import data from
number of access mdb files on a daily bases. The file names change
every day. The data import is very straight forward:
insert into sql_table select * from acess_table
There are up to 8 tables in each access file and some access files will
have less. So the process needs to figure out which tables exist in
Access mdb file and import them whole into sql staging tables.
Any recommendations are appreciated.
ThanksIt probably depends where you're running the load process from - that's
not really clear (to me) from your comments. If you push the data from
Access, then presumably it's not a problem, because you know which
tables are in each database. If you need to pull from MSSQL, and the
Access database names are always the same, then you could create linked
servers to each one, and get the data that way.
If the Access database names change, and you don't know in advance how
many tables there will be in each one, then you'll need something more
flexible. Personally, I would probably use DTS to connect to each
database, query the metadata to get the table names (although I don't
know exactly how to do that - perhaps an Access group could give more
details), and then load the data dynamically. Or write a tool in Perl,
C# or whatever to dynamically export and import the data via flat files
or ADO.
Finally, one other option would be to convert your Access databases to
ADPs, so you would have the data in MSSQL already. But this may not be
possible or desirable in your situation.
If this doesn't help, I suggest you post some more specific details of
what you need to do.
Simon|||How are these Access files being created daily
with different names and more importantly why?
What kind of bizarre methodology would require
different-named Access files on a daily basis?
GeoSynch
<boblotz2001@.yahoo.com> wrote in message
news:1112217371.433176.279470@.f14g2000cwb.googlegr oups.com...
> Hi there,
> I have a situation where an application needs to import data from
> number of access mdb files on a daily bases. The file names change
> every day. The data import is very straight forward:
> insert into sql_table select * from acess_table
> There are up to 8 tables in each access file and some access files will
> have less. So the process needs to figure out which tables exist in
> Access mdb file and import them whole into sql staging tables.
> Any recommendations are appreciated.
> Thanks
Importing a SQL Database using SQLDMO.. URGENT HELP REQUIRED..
Server 2000 as my datatabase, and use SQLDMO to perform various functions
like Backup, Restore and copy. Now I want to create a new database from a
template database which I have backed up to a template.mdf file. Now I want
to create a new database, and then import the template file into the New
database.
Basically this is the steps that I need to follow.
1) Create Blank SQL Server Database - Can already do this.
2) Import Template database into new blank sql server database. - This is
where the problem occurs.
If there is an easier way of doing this then It will also be appreciated..
bascially If I can just specify the template file and say to the application
create me a new database from that file then it will also be fine.
Any help will be greatly appreciated!!if you'll be using the template many times
might as well do it in the model database
any thing you create will be patterned with the model databse
Jose de Jesus Jr. Mcp,Mcdba
Data Architect
Sykes Asia (Manila philippines)
MCP #2324787
"Db_Stuff" wrote:
> I have written an application in Microsoft Access. I'm currently using SQL
> Server 2000 as my datatabase, and use SQLDMO to perform various functions
> like Backup, Restore and copy. Now I want to create a new database from a
> template database which I have backed up to a template.mdf file. Now I wan
t
> to create a new database, and then import the template file into the New
> database.
> Basically this is the steps that I need to follow.
> 1) Create Blank SQL Server Database - Can already do this.
> 2) Import Template database into new blank sql server database. - This is
> where the problem occurs.
>
> If there is an easier way of doing this then It will also be appreciated..
> bascially If I can just specify the template file and say to the applicati
on
> create me a new database from that file then it will also be fine.
> Any help will be greatly appreciated!!
>|||I am still a beginner at this and I have only managed to get so far with the
help of various sources on the internet. I will be using the template
basically all the time to create a new database, but what do you mean I migh
t
as well do it in the Model Database..
thanks.
"Jose G. de Jesus Jr MCP, MCDBA" wrote:
> if you'll be using the template many times
> might as well do it in the model database
> any thing you create will be patterned with the model databse
>
> --
>
> Jose de Jesus Jr. Mcp,Mcdba
> Data Architect
> Sykes Asia (Manila philippines)
> MCP #2324787
>
> "Db_Stuff" wrote:
>|||the model database is the template database of sql server
--
Jose de Jesus Jr. Mcp,Mcdba
Data Architect
Sykes Asia (Manila philippines)
MCP #2324787
"Db_Stuff" wrote:
> I am still a beginner at this and I have only managed to get so far with t
he
> help of various sources on the internet. I will be using the template
> basically all the time to create a new database, but what do you mean I mi
ght
> as well do it in the Model Database..
> thanks.
>
> "Jose G. de Jesus Jr MCP, MCDBA" wrote:
>|||hi,
Db_Stuff wrote:
> I have written an application in Microsoft Access. I'm currently
> using SQL Server 2000 as my datatabase, and use SQLDMO to perform
> various functions like Backup, Restore and copy. Now I want to create
> a new database from a template database which I have backed up to a
> template.mdf file. Now I want to create a new database, and then
> import the template file into the New database.
Jose already introduced you the way new databases are created, actually a
"clone" of model system database...
if you want your application databases all inherit from your particular
template, why not just provide a backup of it and perform a restore
operation specifying a new database name and providing the WITH MOVE terms
to generate the relative physical files in the correct (and obviously
different) position?
BTW, I usually prefer all databases inherit from target model database and
create all required dbobjects via standard Transact-SQL scripts...
the best deployment article I ever read for programmers can be found at
http://msdn.microsoft.com/msdnmag/i...abaseinstaller/
..this kind of soulution takes care of appropriate versioning and successiv
e
database schema updates...
--
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.15.0 - DbaMgr ver 0.60.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply