Viewing 15 posts - 6,181 through 6,195 (of 8,755 total)
Quick thought, each statement will execute regardless of the success of other statements in the dynamic code, hence errors and transactions must be explicitly handled, consider this example
😎
USE tempdb;
GO
IF OBJECT_ID(N'dbo.TBL_TRAN_TEST')...
February 7, 2015 at 3:00 am
Lynn Pettis (2/6/2015)
Eirikur Eiriksson (2/6/2015)
Lynn Pettis (2/6/2015)
Eirikur Eiriksson (2/6/2015)
Lynn Pettis (2/6/2015)
Eirikur Eiriksson (2/6/2015)
Lynn Pettis (12/12/2014)
(To the tune 100 Bottles of Beer on the Wall)
......
February 7, 2015 at 2:36 am
Sean Lange (2/6/2015)
Eirikur Eiriksson (2/6/2015)
Sean Lange (2/6/2015)
Sioban Krzywicki (2/6/2015)
Lynn Pettis (2/6/2015)
Eirikur Eiriksson (2/6/2015)
Lynn Pettis (2/6/2015)
Eirikur Eiriksson (2/6/2015)
Lynn Pettis (12/12/2014)
(To the tune 100 Bottles of...
February 7, 2015 at 2:35 am
For completeness, a SQL Server 2012 and later running total using a window function method
😎
USE tempdb;
GO
IF OBJECT_ID(N'dbo.Test') IS NOT NULL DROP TABLE dbo.Test;
/*SqlServer 2012+*/
CREATE TABLE dbo.Test(
[Week] [int] NOT NULL,
[Count]...
February 7, 2015 at 2:32 am
Quick question, how do the tables relate to each other, cannot see anything obvious at the first glance?
😎
February 7, 2015 at 2:27 am
Srl832 (2/6/2015)
<shortMessage>Fail to insert Adventureworks.inc.humanresourceslog into database SqlException: Login failed...
February 7, 2015 at 2:09 am
What bothers me here is the fact that this a fairly large heap, makes any kind of batch/portioning effort very costly, any chance that you can change the table to...
February 6, 2015 at 1:50 pm
Sean Lange (2/6/2015)
Sioban Krzywicki (2/6/2015)
Lynn Pettis (2/6/2015)
Eirikur Eiriksson (2/6/2015)
Lynn Pettis (2/6/2015)
Eirikur Eiriksson (2/6/2015)
Lynn Pettis (12/12/2014)
(To the tune 100 Bottles of Beer on the Wall)
......
February 6, 2015 at 1:42 pm
Sean Lange (2/6/2015)
Eirikur Eiriksson (2/6/2015)
February 6, 2015 at 1:33 pm
Sioban Krzywicki (2/6/2015)
Lynn Pettis (2/6/2015)
Eirikur Eiriksson (2/6/2015)
Lynn Pettis (2/6/2015)
Eirikur Eiriksson (2/6/2015)
Lynn Pettis (12/12/2014)
(To the tune 100 Bottles of Beer on the Wall)
... Mark one...
February 6, 2015 at 1:27 pm
Lynn Pettis (2/6/2015)
Eirikur Eiriksson (2/6/2015)
Lynn Pettis (2/6/2015)
Eirikur Eiriksson (2/6/2015)
Lynn Pettis (12/12/2014)
(To the tune 100 Bottles of Beer on the Wall)
... Mark one off, 78...
February 6, 2015 at 1:23 pm
Just out of curiosity, in this case wouldn't a filter do the job, something like WHERE XX <> '' or WHERE LEN(XX) > 0 or even better, WHERE XX >...
February 6, 2015 at 12:55 pm
Further on Sean's answer, here is the "hard way" (don't worry, the server does the work:-D) of doing a running total on SQL Server 2008 and earlier
😎
USE tempdb;
GO
IF OBJECT_ID(N'dbo.Test') IS...
February 6, 2015 at 12:49 pm
Lynn Pettis (2/6/2015)
Eirikur Eiriksson (2/6/2015)
Lynn Pettis (12/12/2014)
(To the tune 100 Bottles of Beer on the Wall)
... Mark one off, 78 days to go on...
February 6, 2015 at 12:34 pm
Lynn Pettis (12/12/2014)
(To the tune 100 Bottles of Beer on the Wall)
... Mark one off, 78 days to go on the calendar. 78...
February 6, 2015 at 11:49 am
Viewing 15 posts - 6,181 through 6,195 (of 8,755 total)