Viewing 15 posts - 6,271 through 6,285 (of 8,761 total)
For completion, here is a SQL Server 2012 and later version using the window functions, roughly 3x faster than the 2005/2008 method
😎
USE tempdb;
GO
SET NOCOUNT ON;
declare @temp as table
(
ID int identity,
TS...
January 19, 2015 at 2:15 am
Further on twin.devil's reply, the cardinality (#) of the two tables indicates the action, if #inserted > 0 and #deleted =0 then "insert", if #inserted > 0 and #deleted >...
January 19, 2015 at 12:46 am
This is relatively easy to do on SQL Server 2012 and later, can you let us know which version you are on? Meanwhile here is a quick set based solution...
January 18, 2015 at 10:40 pm
Jeff Moden (1/17/2015)
January 17, 2015 at 8:06 am
Jeff Moden (1/16/2015)
Samuel Vella (1/16/2015)
Jeff Moden (1/15/2015)
No problem. Thank you very much for your efforts.
I have to admit that when it comes to SSIS, I get totally lost because...
January 17, 2015 at 4:38 am
smitty-1088185 (1/16/2015)
When the author choose to create the unique clustered index he excluded the PER.BusinessEntityID
columns and...
January 17, 2015 at 1:48 am
Quick thoughts, this trigger is supposed to copy the data being inserted into the dbo.Employee table into the dbo.EmployeeAudit table, catch error in the insert and roll back the transaction...
January 17, 2015 at 1:42 am
Jim Shaffer (1/16/2015)
January 16, 2015 at 11:09 pm
Still further on the subject, here is a table value function spawned by Lynn's function
😎
USE tempdb;
GO
create view dbo.MyNewID as
select newid() as NewIDValue;
go
CREATE FUNCTION dbo.ITVFN_DO_SHAKESPEARE
(
@BATCHSIZE INT...
January 16, 2015 at 2:27 pm
Jeff Moden (1/16/2015)
Eirikur Eiriksson (1/16/2015)
Jeff Moden (1/16/2015)
sqldriver (1/16/2015)
You guessed right on the seconds 🙂
"Lawyers" and their "billable hours"; we should all be so lucky.
Oh my word! That's bloody well...
January 16, 2015 at 2:14 pm
Stefan Krzywicki (1/16/2015)
Thanks, but there's a part I'm not sure I get. What's the
FROM T T1,T T2,T T3,T T4,T T5,T T6,T T7
for? How does that work?
The "seed" for the...
January 16, 2015 at 1:53 pm
Further on this, if you want more normal looking text then something like this might help
😎
DECLARE @BATCHSIZE INT = 255;
DECLARE @ROWCOUNT INT = 10000;
;WITH T(N) AS (SELECT N FROM...
January 16, 2015 at 1:48 pm
Quick alteration of the code, changed to set based double loop, the trick is to a add variations to the inner loop
😎
DECLARE @BATCHSIZE INT = 255;
DECLARE @ROWCOUNT INT =...
January 16, 2015 at 1:42 pm
Jeff Moden (1/16/2015)
sqldriver (1/16/2015)
You guessed right on the seconds 🙂
"Lawyers" and their "billable hours"; we should all be so lucky.
Oh my word! That's bloody well insane. :hehe: Do...
January 16, 2015 at 12:46 pm
Viewing 15 posts - 6,271 through 6,285 (of 8,761 total)