Hi,
In SQL Server,
does anybody provide the steps for create a Package for exporting the query results to Excel environment?
I just know that click the "Export", then choose the query file to export to Excel.
I want to know how to create the Package to export it.
Please let me know, thanks.1. Create new package
2. Connection from Connection menu (or right click)
* Add SQL server connection, specify the server name, authentication, and dbname
* Add Excel connection, specify the path where u want to place the excel file
3. Transform data task from Task menu (or right click)
* Add Transform data task, select the source and destination
* Double click the task
- Source tab : select the table/view or write down the query
- Destination tab : just click ok on create table script window (for sheet & column name)
- Transformation tab : Map the required columns
4. Save the DTS
5. Right click - Execute package or u can schedule it as job|||Question:
I created the package and execute the package, it works,
but, I got another problem, if I execute it for 2 times, the values will be output double in the same table,
eg.
1st execute:
Name:
Jim
Mary
2nd execute:
Name:
Jim
Mary
Jim
Mary
I want to execute the package which values will replace the previous file's values if the filename is same.
How should I do? Please let me know, thanks.|||em....i dunno how to delete data in excel destination file. but u can do it if the destination is ms access file, with additional task and workflow :
- Add a task (Execute SQL Task) as 1st step in the DTS
Existing connection : choose the ms access connection which was already created
SQL statement : DELETE * FROM <destination_tablename>
- Add on success workflow from above task to sql connection
Showing posts with label provide. Show all posts
Showing posts with label provide. Show all posts
Sunday, March 25, 2012
Thursday, March 22, 2012
Create a custom login.
Hi all,
I need an user to do the following tasks. What kind of login I could provide him and how do I give him rights to do them without providing hin the SA (sysadmin role) ?
Create Login
Create Database
Create Tables ( with Pks, Fks & Indexes)
Create Stored procedures
Create Functions ( table valued / scalar valued)
Insert Master data
Create Jobs
Execute Job for first time
Populate sample
Thanks in advance,
DBAnalyst
Refer to books online about database fixed roles for the steps you have asked such as:
1) db_accessadmin
2,3,4,5,6 & 7) db_owner
Subscribe to:
Posts (Atom)