Forum Replies Created

Viewing 15 posts - 1,306 through 1,320 (of 1,468 total)

  • RE: Stored Procedure help

    ma701ss (1/3/2017)


    Forget returning the user id or data from any other columns, is it possible to amend the code to just return one value, i.e. either -2, -1 or 1?...

  • RE: Stored Procedure help

    It would appear that the [Id] field in AspNetUsers contains GUIDS.

    However, your proc declares @UserId as INT, and then tries to assign a GUID to an INT variable.

    Let's start...

  • RE: How to modify query to only use base tables

    Is product not possibly a view?

  • RE: Query tuning - Help needed

    For the table provided (DocumentBinder)

    • The clustered index in on a UNIQUEIDENTIFIER, which is going to cause major fragmentation
    • For IX_DocumentBinder_ID_BinderDefID and _dta_index_DocumentBinder_11_325576198__K1_K2_3_4, I would rather disable IX_DocumentBinder_ID_BinderDefID, and enable _dta_index_DocumentBinder_11_325576198__K1_K2_3_4
    • You can...

  • RE: Reducing the overall log size from a SP that deletes data in groups

    You could use dynamic SQL for each DELETE, thus having a separate sql command executed for each group.

  • RE: Analyze Table structure for best data type

    This query should help

    DECLARE @sql VARCHAR(MAX);

    SELECT @sql = 'WITH cteMinMax AS (' + CHAR(10)

    + ' SELECT' +...

  • RE: How to parse json data in SQL server 2012?

    pinky_sam05 (12/11/2016)


    I am using sql server 2012.I have been assigned a task where one of my column(JsonText) of table(Sample) contain json data.I want to parse that data and insert into...

  • RE: Stored Procedure help

    ma701ss (12/11/2016)


    Hi, thanks for the replies.

    This code returns the user id but what I want it to return is either 1, -1 or -2. My vb code then uses a...

  • RE: Is it right way to add filtered column as main column for creating filtered index

    dudekula.kareemulla (12/9/2016)


    Hi

    I have a query like below. table contains 70 million records

    select MIN(createtime) _time_ from tablename

    where status <> 20 and type_id = 44

    and createtime >...

  • RE: Do I need those multiple NON UNIQUE indices on my table?

    BOR15K (12/7/2016)


    DesNorton (12/7/2016)


    What CLUSTERED index does the table have?

    Currently none. The table has lots of records periodically loaded at once (every other hour or so).

    If you use invoice_lines_I03 to replace...

  • RE: Do I need those multiple NON UNIQUE indices on my table?

    What CLUSTERED index does the table have?

  • RE: Generate Running MAT from Quarter

    User-defined functions cannot make use of dynamic SQL or temp table

    Source: https://msdn.microsoft.com/en-us/library/ms191320.aspx

    If you need to use Dynamic SQL, then change your function to a Stored Procedure.

  • RE: Coalesce and Case

    replace FSI.StepCompletion

    with CONVERT(VARCHAR(30), FSI.StepCompletion)

  • RE: Last 2 years and YTD

    Is this for a Gregorian calendar year, or a fiscal year?

  • RE: using output statement from merge to populatet an audit table

    OK. First things first.

    Your #temp needs to change the datatype of UpdateDate

    CREATE TABLE #temp (

    [Type] VARCHAR(1)

    , TableName VARCHAR(20)

    , ClientID VARCHAR(10)

    ...

  • Viewing 15 posts - 1,306 through 1,320 (of 1,468 total)