Forum Replies Created

Viewing 15 posts - 31 through 45 (of 337 total)

  • RE: Scalar function

    You will have to use APPLY clause to send item code from the left input (outer table).

    Something like this...

    Select t1.*,t2.* from yourtable t1

    Cross Apply dbo. Getgrnqty_test3 (t1.ItemCode) as t2

  • RE: Finding months in incremental fashion

    You can do something like this

    SELECT *

    FROM (VALUES ('My Aggregated data1',

    'My Aggregated data2'))T(data1, data2)

    CROSS APPLY (SELECT...

  • RE: OMG - What have they done to Stored Proc Scripts???

    Please see the screenshot below.

    http://oi68.tinypic.com/xcn3o2.jpg

    When generating scripts you can play with these options in the Advanced Settings.I always have this options set

    "Check For Object Existence"=False.This makes sure that the script...

  • RE: Scalar function

    Yes Jeff you are right.It was a silly mistake.

  • RE: Scalar function

    Forgot the column alias for SUM in the earlier code.

    ALTER FUNCTION [dbo].[Getgrnqty_test2] (@ItemCode VARCHAR(10))

    RETURNS TABLE

    AS

    BEGIN

    RETURN

    ...

  • RE: what could be the solution to make secondary database online and database is TB size?

    If your log chain is broken then there is no way that log shipping can continue.I am afraid you will have to break the LS and restore a diff backup...

  • RE: Scalar function

    ALTER FUNCTION [dbo].[Getgrnqty_test2] (@ItemCode VARCHAR(10))

    RETURNS TABLE

    AS

    BEGIN

    RETURN

    (SELECT S1.divisionid,

    ...

  • RE: INSERT Statement - How to Handle to Avoid Thousands

    kocheese (3/25/2016)


    Thank you for the help, but unfortunately this doesn't seem to work as I expected. Not sure I explained it correctly.

    The table has the following columns:

    [ProjectType]

    [ProjectSubType]

    [ProjectCategory]

    [ProjectSubCategory]

    I...

  • RE: Scalar function

    Your function is scalar valued so it will return only a single value.What you need to do is convert the scalar valued function to a inline table valued function so...

  • RE: Strange behaviour

    Please post the table structure,your update query and the index definition that you added.

  • RE: Insert Performance Issue From Temp Table

    ...WHERE NOT EXISTS (

    SELECT EmployeeID

    FROM budCrewDetail

    WHERE budCrewDetail.Co = JCDET.JCCo

    AND budCrewDetail.Project = JCDET.Job

    AND budCrewDetail.[Date] = JCDET.ActualDate....

    Negation operators like NOT are nonsargable expressions.An index is not useful in nonsargable expressions.SQL Server cannot...

  • RE: Significant drop in performance on If Exists, and while loop blocks

    Try using @@Rowcount instead.But make sure nothing gets executed before the except clause and if it does then reset the @@rowcount value to 0.

    select col1,col11 from table1

    except

    select col2,col22 from...

  • RE: Running Totals with window function

    Alan.B (3/25/2016)

    Original Solution:

    Table 'Worktable'. Scan count 38, logical reads 194...

    Table '#TranTable__00000000003A'. Scan count 1, logical reads 2...

    Original Solution + Window framing specifications on subquery a:

    Table 'Worktable'. Scan count 19, logical...

  • RE: Running Totals with window function

    Jacob Wilkins (3/25/2016)


    Your version doesn't have to be that complicated.

    It could just be this:

    SELECT accountid,

    trandate,

    tranvalue,

    ...

  • RE: How to configure mirroring with certificates.

    Incase you are implementing witness server as well then it gets a little bit complicated.

    Make sure you have created its own certificate on the witness server and on the principal...

Viewing 15 posts - 31 through 45 (of 337 total)