Showing posts with label drop. Show all posts
Showing posts with label drop. Show all posts

Thursday, March 8, 2012

[newbie] Execute SQL task bypassed, why ?

Hi!

I meet a strange behaviour which is probably caused by my SSIS newbie nature.

I have a Execute SQL Task, used to drop and create some temporary tables. It works when invoked manually.

I have chained a Data Flow Task behind, but when I launch the whole process, although the Execute SQL tasks goes green, it is not executed (then the Data Flow fails because the required tables are missing).

Would anyone have any hint on why the execute sql task seems to be bypassed ?

kind regards

Thibaut

hi Thibaut,

how odd! Have you defined a log file for your package? If so, what kind of info is providing to you?

|||

Is that a package that you strated from scratch? If not; make sure there is not an expression or package configuration that changes the SQL Statement or the connection strings. If you are getting green on the SQL task I bet the object is actually being created, perhaps in the wrong side (server, schema, DB, etc)

Rafael Salas

|||I am now restarting the package from scratch, and making it configurable ("keeping it in the dark"). I'll report back if I meet the same issue again.

thanks!|||Hi!

I finally found out what is happening. The Data flow task is using a XML source to load the data into tables which are created by the Execute SQL task.

The XML source was trying to validate the schema provided at run time against tables which are not created yet... I just disabled the validation on the XML source and everything went fine.

thanks for all the replies.

cheers!

Thibaut

Monday, February 13, 2012

[2005] How do I script out all indexes?

Hello,
we are using Sql Server 2005 Managament Studio.
Can someone tell me how I can script out all DROP/CREATE INDEXES for a particular database?
We only want to script out the INDEXES, not the tables.
Please advise.
Thanks.
`LeYou can try using a (free) tool I wrote, called scriptdb.exe.

It scripts out all objects (including indexes). The script for each object is created in a separate file. It would be a simple matter to alter the tool so it only scripts the indexes (the source is available so you could do it yourself). Or you can just run it as is and script out all the objects, and throw away what you don't want if all you care about are indexes.

You can get it here: http://www.elsasoft.org/tools.htm

Alternatively, in SSMS, you could try using the Generate Scripts Wizard for this, but it won't do both drop and create at the same time. only drop OR create. not both.

Hope this helps!|||Thanks for the offer, but my company has a policy against 3rd party executables.

As for Sql Server Management Studio, I cannot seem to find anyplace to script out ONLY the indexes.

Are there other suggestions?

`Le|||you appear to be right, GSW won't script the index separate from the table.

even if you have a policy against 3rd party executables, you can still use scriptdb since I posted the source code.

Just build it yourself using VS or csc.exe and then it's *your* executable ;)