dbTalk Databases Forums  

DTS or Stored Procedure?

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss DTS or Stored Procedure? in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
dorkygrin
 
Posts: n/a

Default DTS or Stored Procedure? - 02-08-2010 , 10:38 AM






Somewhat noobish here with SQL. Have done some packages with DTS and
MSDE. Looking for some guidance on the following project:

Need to develop a weekly process to update a specific column in a
specific table in a SQL 2008 Express database. The column contains
full Employee Names. Destination field is called EmpNamePL and is
PrimaryKey and it does not accept nulls or duplicates.

Source: XLS or MDB

Destination Database Name: Personnel
Table Name: PL5
Column Name: Item (PK, varchar, no nulls)

I'm thinking DTS or Stored Procedure:

DTS:

1. Despite finding out that you cannot save DTS packages in SQL 2008
express, I got it to work with the DTS install that was made for SQL
2000 by using Legacy DTS.
2. Can get FullName field from XLS spreasheet.
3. Tried to insert that data to a column in a specific table. However,
I get errors that indicate no duplicates or nulls.

Question: Is there a statement that can be used in DTS to transform
the XLS to ensure there are no nulls or duplicates?

STORED PROCEDURE:
1. Not sure how to start here - Copy Fullname field from XLS or MDB
into the existing EmpNamePL?
2. Schedule a weekly execution of the Stored Procedure?

Thanks for any constructive comments.

Reply With Quote
  #2  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: DTS or Stored Procedure? - 02-08-2010 , 04:32 PM






dorkygrin (dorkygrin (AT) gmail (DOT) com) writes:
Quote:
Somewhat noobish here with SQL. Have done some packages with DTS and
MSDE. Looking for some guidance on the following project:

Need to develop a weekly process to update a specific column in a
specific table in a SQL 2008 Express database. The column contains
full Employee Names. Destination field is called EmpNamePL and is
PrimaryKey and it does not accept nulls or duplicates.
This sounds somewhat venturous to me. To be able to update a row,
you would need to correlate with the source. That is usually what
you use the primary key for. In this case you update the primary
key, so how do you now know what rows to update and with what?

Quote:
1. Despite finding out that you cannot save DTS packages in SQL 2008
express, I got it to work with the DTS install that was made for SQL
2000 by using Legacy DTS.
2. Can get FullName field from XLS spreasheet.
3. Tried to insert that data to a column in a specific table. However,
I get errors that indicate no duplicates or nulls.
DTS has been replaced by SQL Server Integration Services but SSIS does
not come with SQL Express. Since DTS is an old technology that probably
will go away with some later release, it seems better to built a solution
without DTS. One alternative is to use OPENROWSET and the Jet provide
to read the Excel files. I have never done this myself, so I cannot
give any examples, but Google should be able help you.

What is more problematic is if the data in the Excel file does not
conform with the business rules. You could read the data into a temp
table and perform some cleansing on. But given that it includes PK
data, I would be hesitent to accept errors at all...

Quote:
2. Schedule a weekly execution of the Stored Procedure?
SQL Express does not come with Agent, but you can schedule job with
Windows Task Scheduler. Use SQLCMD to execute your stored procedure.


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.