Viewing 15 posts - 361 through 375 (of 475 total)
I suspect it may be a space within the number, for example this will cause the error
SELECT CAST('123 456' AS BIGINT)
If you want to compress this situation into a single...
April 11, 2013 at 5:58 pm
I may be barking up the wrong tree with this, but are you after
SELECT SUM(quantity)
FROM sale s
WHERE EXISTS (SELECT 1 FROM eval e WHERE s.email = e.email)
...
April 9, 2013 at 1:45 pm
Luis and Mr Magoo came up with much more elegant solutions than my ugly looking one. However I tried to produce a query that would show all editions (tournaments?)...
April 8, 2013 at 9:33 pm
You could also try something like
SELECT CASE WHEN LEN(p4.[name]) = 0 THEN p5.[name] ELSE p5.[name] + '\' + p4.[name] END AS server_instance_name
,p3.[name] [database_name]
,p4.[name] AS 'instance'
,p5.[name] AS 'server'
,p2.start_datetime
,p2.action_status
,p1.backup_type
,p2.utc_offset
,DATEDIFF(ss,p2.start_datetime,p2.end_datetime) AS 'duration'
,p2.uncompressed_KB
,p2.compressed_KB
FROM SQLsafeRepository.dbo.backup_sets...
April 4, 2013 at 4:20 pm
It looks like you have a syntax error with the query that you posted with on before the member table
Select * from Util U
Left Outer join ON Member m
on U.A=m.A
AND...
March 27, 2013 at 12:17 am
Hi
A good article for crosstabs is http://www.sqlservercentral.com/articles/T-SQL/63681/
Here's an example that uses a crosstab allowing for up to 5 different product pricings
-- Set up some test data
;with product as (
SELECT *
FROM...
March 26, 2013 at 7:31 pm
You could do something like the following, if you will always have 2 product prices, with 1 that has a quantity of 1.
select ProductID, ProductName, CategoryID, CategoryName, pp1.ProductQuantity, pp1.ProductCost, ppo.ProductQuantity,...
March 25, 2013 at 11:44 pm
Hi
This should do what you want ... I think
;with labData as (
SELECT *
FROM (VALUES
('MICROSOFT VISUAL STUDIO .NET',101)
,('MICROSOFT VISUAL STUDIO .NET',118)
,('MICROSOFT VISUAL STUDIO .NET',256)
,('MICROSOFT VISUAL STUDIO .NET',367)
,('MICROSOFT VISUAL STUDIO .NET',51)
,('MICROSOFT VISUAL...
March 25, 2013 at 1:30 pm
Hi
Does this do what you require?
;with originalCar AS (
SELECT CarName, PartName
FROM Car c INNER JOIN CarPart cp ON c.CarID = cp.CarID
WHERE CarName = @StartCar
),
otherCars AS (
select carName, partName
FROM Car c...
March 21, 2013 at 5:59 pm
Hi Maarten
Not sure if this is what you want, but you could try
;with testdata as(
select *
from (values ('=KET+N.207-13-F4001'),('=KET+DG014-13-F4011'),('=KET+RE002-36-MV009')) as MD (value)
)
select value
,case
when substring(value,16,1) like '[0-9]' then
substring(value,15,2)
else
substring(value,15,1)
end as groupno
from testdata
March 19, 2013 at 2:00 pm
Hi
Jeff Moden wrote a comprehensive article which covers what you want to do and investigates the various methods used
http://www.sqlservercentral.com/articles/T-SQL/68467/
Here's an example using the triangular join method and the quirky...
March 18, 2013 at 1:16 pm
Hi
You have
FETCH NEXT FROM @kpi_cursor INTO ...
inside your loop. you should have
FETCH NEXT FROM kpi_cursor INTO ...
the same as you have for your first fetch
March 17, 2013 at 2:42 pm
Viewing 15 posts - 361 through 375 (of 475 total)