Showing posts with label hihow. Show all posts
Showing posts with label hihow. Show all posts

Friday, March 30, 2012

How do I make use of begin transaction and commit transaction in SSIS.

Hi

How do I make use of begin transaction and commit transaction in SSIS.

As am not able to commit changes due to certain update commands I want to explicitly write begin and commit statements. but when i make use of begin and commit in OLEDB commnad stage it throws an error as follows:

Hresult:0x80004005

descriptionTongue Tiedyntax error or access violation.

its definately not an syntax error as i executed it in sql server. also when i use it in execute sql task out side the dataflow container it doesnt throw any error but still this task doesnt serve my purpose of saving/ commiting update chanages in the database.

Thanks,

Prashant

Take a look at this:

http://www.sqlservercentral.com/columnists/jthomson/transactionsinsqlserver2005integrationservices.asp

Basically, if you want the scope of your transaction to be bigger than a single Execute SQL task, you need to define your transactions declaratively through the way you build your packages. The key is the TransactionOption property of containers, which include packages, Sequence containers and the "invisible" TaskHost container that wraps each task. This property works much like transactions did in COM+ and MTS, so if you've done work there it should look at least a little familiar.

|||

thanks mattew, the paper was very useful

But I used a different way to achieve my purpose.

I used same connection manager for all Execute SQL tasks with RetainSameConnection = True.

Thanks,

Prash

Friday, February 24, 2012

How do I drop indexes?

Hi
How do I drop all the indexes in a database in one go?
Thanks in advance
HWrite a cursor that loops over sysindexes and for each index executes the DR
OP INDEX command. Make
sure that you exclude indid 0 and 255. Also, for indexes created with a PRIM
ARY KEY and UNIQUE
constraint, you need to execute ALTER TABLE ... DROP CONSTRAINT instead of D
ROP INDEX.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"h" <anonymous@.discussions.microsoft.com> wrote in message
news:1d5cc01c45434$42f34bd0$a301280a@.phx
.gbl...
> Hi
> How do I drop all the indexes in a database in one go?
> Thanks in advance
> H|||Hi,
I have wrote a script to do this, please login to MSDN and have a look. This
script will generate
This stored procedure will be useful to generate scripts for below
index categories for DROP as well as CREATE . Probably u can use the DROP
part.
a. Clustered Index associated with a Primary key constraint
b. Non Clustered Index associated with a primary key constraint
c. Non Clustered Index associated with a Unique Key constraint
d. Normal Clustered Index
e. Normal unique Clustered Index
f. Normal Non Clustered Index
g. Normal unique Non Clustered Index
http://www.microsoft.com/india/msdn/articles/196.aspx?
Thanks
Hari
MCDBA
"h" <anonymous@.discussions.microsoft.com> wrote in message
news:1d5cc01c45434$42f34bd0$a301280a@.phx
.gbl...
> Hi
> How do I drop all the indexes in a database in one go?
> Thanks in advance
> H

How do I drop indexes?

Hi
How do I drop all the indexes in a database in one go?
Thanks in advance
H
Write a cursor that loops over sysindexes and for each index executes the DROP INDEX command. Make
sure that you exclude indid 0 and 255. Also, for indexes created with a PRIMARY KEY and UNIQUE
constraint, you need to execute ALTER TABLE ... DROP CONSTRAINT instead of DROP INDEX.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"h" <anonymous@.discussions.microsoft.com> wrote in message
news:1d5cc01c45434$42f34bd0$a301280a@.phx.gbl...
> Hi
> How do I drop all the indexes in a database in one go?
> Thanks in advance
> H
|||Hi,
I have wrote a script to do this, please login to MSDN and have a look. This
script will generate
This stored procedure will be useful to generate scripts for below
index categories for DROP as well as CREATE . Probably u can use the DROP
part.
a. Clustered Index associated with a Primary key constraint
b. Non Clustered Index associated with a primary key constraint
c. Non Clustered Index associated with a Unique Key constraint
d. Normal Clustered Index
e. Normal unique Clustered Index
f. Normal Non Clustered Index
g. Normal unique Non Clustered Index
http://www.microsoft.com/india/msdn/articles/196.aspx?
Thanks
Hari
MCDBA
"h" <anonymous@.discussions.microsoft.com> wrote in message
news:1d5cc01c45434$42f34bd0$a301280a@.phx.gbl...
> Hi
> How do I drop all the indexes in a database in one go?
> Thanks in advance
> H