Viewing 15 posts - 3,571 through 3,585 (of 8,761 total)
Piling on
๐
IF OBJECT_ID(N'dbo.TBL_SAMPLE_ACTIVITY_DATA') IS NOT NULL DROP TABLE dbo.TBL_SAMPLE_ACTIVITY_DATA;
CREATE TABLE dbo.TBL_SAMPLE_ACTIVITY_DATA
(
Workid INT IDENTITY(1,1) NOT NULL
...
May 23, 2016 at 8:02 am
jasona.work (5/19/2016)
yb751 (5/19/2016)
jasona.work (5/19/2016)
Brandie Tarvin (5/19/2016)
Greg Edwards-268690 (5/19/2016)
Brandie Tarvin (5/19/2016)
GilaMonster (5/19/2016)
Lynn Pettis (5/18/2016)
Found this on my Facebook newsfeed: https://www.packtpub.com/packt/offers/data-week-2016.
Oooh. Am very tempted to grab both the R and the Data...
May 19, 2016 at 1:32 pm
Brandie Tarvin (5/19/2016)
GilaMonster (5/19/2016)
Lynn Pettis (5/18/2016)
Found this on my Facebook newsfeed: https://www.packtpub.com/packt/offers/data-week-2016.
Oooh. Am very tempted to grab both the R and the Data bundles.
The free book yesterday (Machine Learning with...
May 19, 2016 at 6:15 am
GilaMonster (5/18/2016)
Eirikur Eiriksson (5/18/2016)
Nolock ignores the locks of others but still takes shared locks.No it doesn't.
Thanks again Gail for the correction :Whistling:
๐
May 18, 2016 at 2:04 pm
Avalin (5/18/2016)
May 18, 2016 at 9:04 am
Piling on
๐
-- this works
USE TEEST;
go
select object_id as GO
from sys.objects so
-- this doesn't
USE TEEST;
go
select object_id as
GO
from sys.objects so
The latter returns
Msg 102, Level 15, State 1, Line 10
Incorrect syntax near 'as'.
Msg...
May 17, 2016 at 10:17 am
dallas13 (5/17/2016)
Now we migrated to sql 2014 and we are getting...
May 17, 2016 at 10:05 am
SELECT
*
,(A)SUM(J.JourneyDistanceMiles)
,(B)SUM(J.JourneyTotalFuelUsed)*0.219969157
,(A)SUM(J.JourneyDistanceMiles) / NULLIF(((B)SUM(J.JourneyTotalFuelUsed)*0.219969157),0) as [MPG]
FROM tablename;
๐
May 17, 2016 at 9:46 am
If the divisor is zero then obviously the division is invalid, next thing for you is to check your data
๐
May 17, 2016 at 9:43 am
Then force NULL output if the divisor is 0
๐
SELECT
*
,(A)SUM(J.JourneyDistanceMiles)
,(B)SUM(J.JourneyTotalFuelUsed)*0.219969157
,(A)SUM(J.JourneyDistanceMiles) / NULLIF(((B)SUM(J.JourneyTotalFuelUsed)*0.219969157),0) as [(NEW COLUMN) A/B AS...
May 17, 2016 at 9:29 am
How about this?
๐
SELECT
*
,(A)SUM(J.JourneyDistanceMiles)
,(B)SUM(J.JourneyTotalFuelUsed)*0.219969157
,(A)SUM(J.JourneyDistanceMiles) / ((B)SUM(J.JourneyTotalFuelUsed)*0.219969157) as [(NEW COLUMN) A/B AS MPG]
FROM tablename
May 17, 2016 at 9:17 am
Lowell (5/16/2016)
I just got my MCSA after taking 70-463 Implementing a Data Warehouse in SQL Server 2012/2014.
I had set a mental...
May 16, 2016 at 9:31 am
GilaMonster (5/16/2016)
jasona.work (5/16/2016)
Last weekend, we had the windows of the house...
May 16, 2016 at 7:12 am
Solomon Rutzky (5/15/2016)
May 15, 2016 at 12:05 pm
Piling on on the CHAR(0), here are some of my favorites:
๐
SET NOCOUNT ON;
DECLARE @STR_WITH_ZERO_CHAR VARCHAR(20) = '123456789' + CHAR(0) + '1234567890';
-- CHARINDEX will not return the position of the CHAR(0)
SELECT...
May 15, 2016 at 10:54 am
Viewing 15 posts - 3,571 through 3,585 (of 8,761 total)