Monday, January 21, 2008

SQL1092N "" does not have the authority to perform the requested



First you need to make sure do you have SYSADM_GROUP setup

get dbm cfg

Probably you may want to update your SYSADM_GROUP to one of your Security group.
The command will be like this

update dbm cfg SYSADM_GROUP DB2ADMIN

http://publib.boulder.ibm.com/infocenter/db2v7luw/index.jsp?topic=/com.ibm.db2v7.doc/db2c4/db2c458.htm

If you are using Windows make sure you add your user Id back to the group of DB2ADMIN.

After that do a DB2STOP and START and retry your operation again. 

Sunday, January 20, 2008

Delete all data in all tables

-- disable referential integrity
EXEC sp_MSForEachTable 'ALTER TABLE ? NOCHECK CONSTRAINT ALL'
GO

EXEC sp_MSForEachTable 'DELETE FROM ?'
GO

-- enable referential integrity again
EXEC sp_MSForEachTable 'ALTER TABLE ? CHECK CONSTRAINT ALL'
GO

wow ...
Thanks for the tips from Adam

http://sqljunkies.com/WebLog/roman/archive/2006/03/03/18386.aspx