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

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

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

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

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

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

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

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

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

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

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

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

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

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

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

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

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

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

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

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

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

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

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

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

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

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

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

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

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

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

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