Viewing 15 posts - 1 through 15 (of 134 total)
Good article.
I find this type of wrong triggers in a lot of databases.
I also start with adding "set nocount on" at the start of each trigger.
Otherwise, an update/insert/delete statement also...
March 21, 2015 at 6:08 am
I changed the code and made it a stored procedure in my dba database.
I also added a filter to list only enabled jobs.
if object_id('dbo.usp_mailFailedJobs') is null exec('create procedure dbo.usp_mailFailedJobs as...
May 28, 2014 at 4:21 am
I have this version, and it does NOT support compression :
productversion:11.0.2383.0
productlevel:RTM
edition:Web Edition (64-bit)
September 25, 2013 at 7:30 am
I am still trying to make the script MS SQL 2012 compatible.
How can I send you the adapted script ?
April 12, 2013 at 1:09 pm
Awesome script, thanks a lot.
I wanted to try this on my server, but failed because my server uses collation 'Latin1_General_bin' ( case sensitive => also for object names ).
I changed...
April 12, 2013 at 8:19 am
You can easely resolve the "unique" problem by adding a distinct to the select top().
I tried this, and it works fine on SQL 2005. The distinct will not generate an...
August 13, 2010 at 9:38 am
[font="Courier New"]I suppose there is only 1 customer, and 1 or more subcustoerms. This query would do the job :
DECLARE @docHandle int
DECLARE @doc varchar(1000)
SET @doc ='
...
October 26, 2007 at 10:58 am
Here is an exemple : ( but 53 becomes AZ ?! )
create function dbo.fn_conv ( @number int )
returns varchar(3)
as
begin
-- next 2 variables could be parameters
declare @charset varchar(255)
declare @len int
set @charset...
February 13, 2007 at 12:30 am
Strange XML ... But you can do it like this :
SELECT *
FROM OPENXML (@docHandle, '/ShipmentHeader',2)
WITH (SettleFlag char(1) '@SettleFlag',
September 6, 2006 at 12:05 am
I use my stored procedure sp__droptable to test existance of a table ( also temp table ) and ropt it.
You can use sp__droptable '#tmp'.
Script to create the procedure ( in...
April 14, 2006 at 2:36 am
Do not forget that the inserted table can have multiple rows.
You should test this !
April 14, 2006 at 2:29 am
INTO : only for first select
UNION : If distinct is needed, do not use UNION ALL, but use UNION
Correct syntax is :
SELECT DISTINCT Column1 AS Name
INTO New_Table
FROM Old_Table
UNION
SELECT DISTINCT Column2 AS...
April 14, 2006 at 2:26 am
your demand is not very clear ( what is first? ), but this script could be a start :
set nocount on
go
use tempdb
go
if object_id('ori') is not null drop table ori
if object_id('TableA')...
April 13, 2006 at 5:37 am
When you need to convert back to datetime, you should also specify the style :
declare @d1 datetime
set @d1 = getdate()
select dateASchar = convert(varchar(10),@d1,103)
go
declare @d1 datetime
set @d1...
March 30, 2006 at 1:54 am
Try this ...
-- clean up : DO NOT RUN ON PRODUCTION DB : tables will be dropped !!
if db_name() = 'tempdb'
begin
declare @object_id int
set @object_id = object_id('dbo.fn_colsplit')
if @object_id is...
March 30, 2006 at 1:38 am
Viewing 15 posts - 1 through 15 (of 134 total)