Forum Replies Created

Viewing 15 posts - 76 through 90 (of 898 total)

  • RE: Access rights to execute a stored procedure if there is no DML involved

    Sean Lange (7/2/2014)


    Kingston Dhasian (7/2/2014)


    Sean Lange (7/2/2014)


    Kingston Dhasian (7/2/2014)


    Sean Lange (7/2/2014)


    Kingston Dhasian (7/2/2014)


    I would like to provide the db_datareader and db_executor role to a particular SQL Server Login in a...

  • RE: Access rights to execute a stored procedure if there is no DML involved

    Sean Lange (7/2/2014)


    Kingston Dhasian (7/2/2014)


    Sean Lange (7/2/2014)


    Kingston Dhasian (7/2/2014)


    I would like to provide the db_datareader and db_executor role to a particular SQL Server Login in a database

    But, I would like...

  • RE: Access rights to execute a stored procedure if there is no DML involved

    Sean Lange (7/2/2014)


    Kingston Dhasian (7/2/2014)


    I would like to provide the db_datareader and db_executor role to a particular SQL Server Login in a database

    But, I would like to avoid any INSERT's,...

  • RE: Stored Procedure Boundaries

    Nice Question.

  • RE: SQL Query

    kapil_kk (2/10/2014)


    ChrisM@Work (2/10/2014)


    kapil_kk (2/10/2014)


    ChrisM@Work (2/10/2014)


    balu.arunkumar (2/10/2014)


    Hi This part shows error.

    /*------------------------

    SELECT*, SUM( Price ) OVER( Partition BY Customer_Name ORDER BY DatePurchased) AS Total_Till_Date

    FROM#sample where Customer_Name='A'

    ------------------------*/

    Msg 102, Level 15, State 1, Line...

  • RE: SQL Query

    Something like this..

    SELECT*

    FROM(

    SELECT*, ROW_NUMBER() OVER( PARTITION BY Customer_Name ORDER BY DatePurchased ) AS RN

    FROM(

    SELECT*, SUM( Price ) OVER( PARTITION BY Customer_Name ORDER BY DatePurchased ) AS Total_Till_Date

    FROM#sample

    ) AS S

    WHERETotal_Till_Date >=...

  • RE: Generate Insert Script

    The below given script is one that I use for such random tasks

    DECLARE@strSQL VARCHAR(MAX)

    DECLARE@strTableName VARCHAR(100)

    DECLARE @strWhereClause VARCHAR(MAX)

    SET@strTableName = 'mstEmployees' -- Put you View Name here

    --SET@strWhereClause = 'EmployeeID IN (2,26,38)' --...

  • RE: Generate Insert Script

    I don't think you need to generate an INSERT script from the VIEW for that

    Try something like this

    INSERTYourTableName( Column1, Column2, ... )

    SELECTColumn1, Column2, ...

    FROMYourViewName

    (optional WHERE Clause)

  • RE: Generate Insert Script

    Why do you want to create INSERT script from a VIEW? You cannot insert data into all views.

    INSERTS are generally done on tables and you should creating scripts out of...

  • RE: Simple Transpose - why can't I do it??

    david.kotchie (9/12/2013)


    Kingston,

    I feel like I owe you my firstborn!! Can't thank you enough for this, worked like a charm!!!

    You guri know your stuff. I should have known it...

  • RE: Return value if field not there in Query

    Your explanation is not very clear enough. What do you mean by return( return a value or a result or a column name or ... )?

    You can use the INFORMATION_SCHEMA.COLUMNS...

  • RE: IF EXISTS ( SELECT 1 ......vs..... IF EXISTS ( SELECT *

    These are all same in my opinion except your 3rd query( It will always print an "1" as an output which is not what you want )

    You can check the...

  • RE: How to get the correct Return_Amt from a table?

    One of the ways to achieve it..

    DECLARE@tableSTK TABLE

    (

    ItemIDVARCHAR(8),

    ItemDescVARCHAR(100),

    PriceMONEY

    )

    DECLARE @tableABC TABLE

    (

    ItemIDVARCHAR(8),

    ConditionAmtMONEY,

    Return_AmtMONEY

    )

    INSERT@tableSTK

    ( ItemID, ItemDesc, Price )

    SELECT'04400110', 'A4 Paper', 30.00 UNION ALL

    SELECT'08800220', 'Bic Pen 5.0',...

  • RE: Simple Transpose - why can't I do it??

    I am not sure if this is the best way to do it. But, this is what I could come up with( An UNPIVOT followed by a CROSS-TAB )..

    DECLARE@tbl TABLE

    (

    CategoryVARCHAR(10),

    PrevWk2NUMERIC(5,2),

    PrevWk1NUMERIC(5,2),

    CurrWkNUMERIC(5,2)

    )

    INSERT@tbl

    ...

  • RE: How to use"Union ALL" to join sql queries each containing order by clause

    Please note that this thread is more than 3 years old.

Viewing 15 posts - 76 through 90 (of 898 total)