Viewing 15 posts - 11,476 through 11,490 (of 15,376 total)
You need to provide a few more details before anybody can be much help here. You will need to concatenate some strings but I couldn't begin to provide the syntax....
June 27, 2012 at 7:29 am
Here is an example based off the OP's criteria.
declare @GuidToFind uniqueidentifier = newid()
;with Derived (Line_GUID, Diameter, begin_measure, end_measure)
as
(
select @GuidToFind, 5, 108394, 24819570 union all
select @GuidToFind, 10, 45839290, 509589373
),
Guids(SomeValue, MyGuid)
as
(
select 1,...
June 26, 2012 at 10:24 am
--note about apply above--
If you wanted it to function more like a left join to either the function or the inline you could change the cross apply to an outer...
June 26, 2012 at 10:22 am
Here is another way that does your function logic inline.
SELECT PS.LineGUID AS LINE_GUID
,PS.PODSID
,PS.SystemName
,PS.LineNumber
,PS.LineName
,PS.RegulatoryTypes
,PS.OperatingStatus
,PS.Jurisdiction
,PS.Mileage
,PS.Operator
,PS.ProductTypes
,
--DerivedAsset.dbo.Get_PredominantDiameter(PS.LineGUID) as PredominantDiameter
d.Diameter
FROM DerivedAsset.dbo.PipelineSummaryMaster PS
CROSS APPLY (
SELECT TOP 1 Diameter
FROM DERIVEDASSET.DBO.EU_DIAMETER EU
WHERE EU.line_GUid = PS.LineGuid
GROUP BY Diameter
ORDER BY...
June 26, 2012 at 10:16 am
Robert.Sterbal (6/26/2012)
June 26, 2012 at 9:27 am
anush_tar (6/26/2012)
P.S. IDENT_CURRENT() , Scope_Identity() , @@Identity work wrong when several people work parallel.
What do you mean they work wrong??? The don't work wrong but each of them does...
June 26, 2012 at 9:13 am
Robert.Sterbal (6/26/2012)
I guess I'm trying to figure out where to spend my time going forward. Please add to the list as needed
I guess that depends on what you want to...
June 26, 2012 at 9:06 am
WOW that really stinks!!! Wish there was a way to recoup the poor influence. Maybe Amazon will be able to...
June 26, 2012 at 9:00 am
You will have to use dynamic sql for this and add the database to each object you are querying.
June 26, 2012 at 7:55 am
http://poorsql.com is a free online one that seems to work fairly well.
June 26, 2012 at 7:46 am
hiteshchouhan91 (6/26/2012)
column import and issue values showing me 2200 and 600
but actual total of these column is 1100 and 300 respectively
i want that it should be...
June 26, 2012 at 7:42 am
Hard to say with absolute certainty without seeing the ddl. Is this column a datetime datatype? If so you should not do any conversions at all.
The 2nd is just flat...
June 26, 2012 at 7:36 am
Actually if you format this sql it is pretty clear that you did not group by all the non-aggregate columns (I used http://poorsql.com).
SELECT s.part_name AS Part_Name
,s.part_no AS Part_No
,s.uom AS UOM
,i.Stock_OnEntryDate
,sum(i.invoice_quantity)...
June 26, 2012 at 7:21 am
Wow if this isn't enough of a reason to store datetime information as datetime instead of some oddball integer strangeness I don't know what is.
If this data was stored with...
June 25, 2012 at 2:58 pm
Stefan Krzywicki (6/25/2012)
Don't you love columns with "number" in the name that are typed as char or varchar?
Or the date ones...
InsertedDateTime int
BAH!!!
June 25, 2012 at 8:55 am
Viewing 15 posts - 11,476 through 11,490 (of 15,376 total)