Forum Replies Created

Viewing 15 posts - 541 through 555 (of 2,894 total)

  • RE: Automatically Grant Execute to SP

    Since SQL2005 there is a much better way to do so:

    CREATE ROLE db_executor

    GRANT EXECUTE TO db_executor

    The above will create database role which will have rights to execute all procs and...

  • RE: cache plan

    ramyours2003 (3/19/2013)


    what is query cache plan , list the dmv's to trouble shoot poor performance of a query in sql 2005/2008?

    1. Google "what is query cache plan" - first link...

  • RE: Primary key or not to primary key, that is the question

    TheSQLGuru (3/19/2013)


    Eugene Elutin (3/19/2013)


    2) why aren't you using NEWSEQUENTIALID??

    I don't know why OP doesn't, but me...

    I don't use it because it's useless! It does not guarantee sequential order after reboot...

  • RE: Data not inserting

    kapil_kk (3/16/2013)


    I have solved it..... forget to initialize the IsBookelet variable value ;-):w00t:

    You might solve it, but if you did it based on your CURSOR/LOOP solution, then it's just a...

  • RE: how to make a stored procedure return a value when there are no available values

    Create PROCEDURE [dbo].[GetExtractSiteExtractFileBatchPreviousSuccessInd]

    @BatchStatusCd NVARCHAR(5)

    ,@ExtractSiteCd NVARCHAR (10)

    ,@ExtractAsOfDate DATETIME

    AS

    BEGIN

    SELECT case when @ExtractAsOfDate = isnull(convert(varchar(10),ExtractAsOfDate,120),'1900-01-01') then 0

    when @ExtractAsOfDate <> isnull(convert(varchar(10),ExtractAsOfDate,120),'1900-01-01')then 1 else 1 end

    as ExtractSiteExtractFileBatchPreviousSuccessInd FROM ExtractSiteExtractFileBatch

    WHERE...

  • RE: Primary key or not to primary key, that is the question

    2) why aren't you using NEWSEQUENTIALID??

    I don't know why OP doesn't, but me...

    I don't use it because it's useless! It does not guarantee sequential order after reboot as it's just...

  • RE: Stop large queries from running

    sestell1 (3/19/2013)


    CapnHector (3/18/2013)


    I always use a close parentheses ")" at the top of my code sheets (be careful if you add a go it may not work exactly, tend not...

  • RE: First and Last number

    TheSQLGuru (3/19/2013)


    Eugene Elutin (3/18/2013)


    SELECT TransactionID, MIN(VoucherNo) , MAX(VoucherNo )

    FROM yourtable

    GROUP BY TransactionID

    Just a small point, but this only works as long as the values are fixed width and zero padded....

  • RE: Checking the facts

    ...Is it always guaranteed with Identity columns that they will be generated in the same order the rows were inserted?

    No it's not. One of example can be this:

    CREATE TABLE TestingTheData

    (

    ID...

  • RE: Help with the query!

    What should your output recordset look like?

    Two columns for DAYOFWEEK and SUBJECTS

    Or multiple columns like: DAYOFWEEK, SUBJECT1, SUBJECT2, SUBJECT3, ...

    If the second is right, is there known maximum number...

  • RE: problem in select command

    Sergiy (3/18/2013)


    Eugene Elutin (3/18/2013)


    I did. Checked. He did not state that CTE are easier to write. For a mater of fact, he said that writing queries using CTE is easier...

  • RE: problem in select command

    Just replace

    SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1 UNION ALL

    SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT 1...

  • RE: outputting the Stored Proc output to Text File Pipe (|) Seperated with Headers

    skb 44459 (3/18/2013)


    Command to run

    Exec Rpt_OrderReport '1/1/2013' , '1/31/2013'

    Need a code which will save the output to Text file with headers and column data pipe (|) seperated.

    Why not use SSIS?...

  • RE: Sql Query

    Jeff Moden (3/18/2013)


    SqlServerLover (3/18/2013)


    Thanks SSCrazy. Union all does not work in my case as i do not want two rows .........

    but left join worked.. thanks.

    Since you said there was no...

  • RE: problem in select command

    Sergiy (3/18/2013)


    Eugene Elutin (3/18/2013)


    First of all it's not quite polite to put statements in foreign language on English forum without translation. So, here we are:

    As you pointed out this proverb...

Viewing 15 posts - 541 through 555 (of 2,894 total)