views:

349

answers:

2

I dragged Execute t-sql statement task from toolbox. clicked new and created new connection. when i executed, it executed successfully. there was no db showing in con string.

i changed the connection string to point to new server of above in Connection tab. when i executed it, i recv errr

Description: Executing the query "DBCC SHRINKFILE (AppDB_log,300);" failed with the following error: "Could not locate file 'AppDB_log' for database 'master' in sys.database_files. The file either does not exist, or was dropped. ". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly. End Error

DBCC Shrinkdatabase command i am using.

+1  A: 

Try running the query directly in SSMS in the database where you think it will be run based on your connection. If it fails then it's probably a problem with the query (i.e. the data file really doesn't exist). If it succeeds then it's probably a problem with your connection.

If it's a problem with the connection, try running profiler on your server and see what pops up when you run the SSIS package.

Tom H.
USE <DB>GO BACKUP DB <>...................
ManishKumar1980
USE EXec SQL TASK
ManishKumar1980
A: 

Copuld it be a permissions problem? Do you have the rights to run the command on that database?

HLGEM
i have pemissions.
ManishKumar1980