Forum Replies Created

Viewing 15 posts - 11,476 through 11,490 (of 15,376 total)

  • RE: Invoice

    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....

  • RE: How to use scalar valued function in select statement

    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,...

  • RE: How to use scalar valued function in select statement

    --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...

  • RE: How to use scalar valued function in select statement

    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...

  • RE: Scripting Languages

    Robert.Sterbal (6/26/2012)


    Professionally I help manage 500+ small SQL Server installations. We have 5 to 100 devices per install. I'm trying to automate manual processes and collect data for verification and...

  • RE: select statement and output parameter

    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...

  • RE: Scripting Languages

    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...

  • RE: Are the posted questions getting worse?

    Grant Fritchey (6/26/2012)


    Oh, and a nice horror story for you all[/url].

    WOW that really stinks!!! Wish there was a way to recoup the poor influence. Maybe Amazon will be able to...

  • RE: Cursor in cursor problem with choosing database in cursor

    You will have to use dynamic sql for this and add the database to each object you are querying.

  • RE: Format SQL (Pro)

    http://poorsql.com is a free online one that seems to work fairly well.

  • RE: sql server 2005

    hiteshchouhan91 (6/26/2012)


    Thank you for your help,

    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...

  • RE: Which is the best way to query data between 2 dates

    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...

  • RE: sql server 2005

    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)...

  • RE: Returning a date column to Bigint after an update

    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...

  • RE: Are the posted questions getting worse?

    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!!!

Viewing 15 posts - 11,476 through 11,490 (of 15,376 total)