Viewing 15 posts - 18,721 through 18,735 (of 18,923 total)
I actually thaught over my answer and realised you could simply add 1 trigger (instead of 2) like so :
CREATE TRIGGER [trTest_IO_IUD] ON [dbo].[Test]
INSTEAD OF INSERT, DELETE
AS
SET...
January 5, 2005 at 11:16 am
Steve, why do you preffer my first option?
Is it because you can send back an error message or because you have less code to maintain, maybe some other reason?
January 5, 2005 at 11:12 am
Please answer this so we can help you :
Do you want to drop existing columns from the table?
or
Do you want to delete information in certain columns?
or
Do you want to...
January 5, 2005 at 11:04 am
What exactly are you trying to accomplish in this sub. And what lines are you trying to keep and in what table?
January 5, 2005 at 9:51 am
Well it's one of 2 ways.
In the instead of insert trigger, you simply don't insert the rows in the table and return an error message saying no row can be...
January 5, 2005 at 9:49 am
That works... just be sure you remember the password you set there, cause it's a pain in the ass if you forget it.
January 5, 2005 at 8:21 am
This is as set based solution for the same probleme.
I've tested it's speed and it goes 2 to 10 times faster than the original script depending on the length of...
January 5, 2005 at 7:50 am
You'd need something like this :
CREATE PROCEDURE [dbo].[ProcTest]
AS
Exec dbo.Proc1
Exec dbo.Proc2
GO
Proc2 will execute once proc1 is done running.
January 5, 2005 at 6:44 am
I would think so.. try this
set @cmd = 'USE DELTEKCP' + char(13) + char(10) + 'GO' + char(13) + char(10) + 'sp_grantdbaccess ' + @loginame + ', ' +...
January 4, 2005 at 2:42 pm
Can you explain why set is better than select.
I've already run tests and the speed is exactly the same.
The only difference is when you use :
Select @v1 = 1,...
January 4, 2005 at 2:32 pm
CREATE TRIGGER [trTableA_Update] ON [dbo].[tableA]
FOR UPDATE
AS
SET NOCOUNT ON
If Update (ColName_That_Causes_Audit)
begin
Insert into TableB (Field1, Field2...) Select Field1, Field2... from Inserted
end
January 4, 2005 at 12:52 pm
Brian I can't find any case where your solution doesn't work... let me know if you find any but I don't see that hapenning.
Nice trick.
January 4, 2005 at 11:38 am
I'd use Frank's suggestion as it is operation based and not conversion based (much faster on large sets).
January 4, 2005 at 9:51 am
check this link from sybase's site
they use top 7 just like in sql server... maybe you can search more on their site :
January 4, 2005 at 9:49 am
I've just read the books online and you need pretty high rights to execute this command (db_owner or db_ddladmin), contrary to what Steve suggested.
Maybe you can write a stored proc...
January 4, 2005 at 7:53 am
Viewing 15 posts - 18,721 through 18,735 (of 18,923 total)