Forum Replies Created

Viewing 15 posts - 91 through 105 (of 199 total)

  • RE: error while executing sp_executesql

    Sorry Stefano,

    we appear to have been typing at the same time.

    This will never work matey:-

    Execute sp_executesql N'exec spGetAuthorsList @author_id, @FindExact' , N'@author_id varchar(10), @FindExact bit' ,  @author_id =...

    Steve

    We need men who can dream of things that never were.

  • RE: error while executing sp_executesql

    Hi,

    Provided you are not trying to return a value to the executing sproc you need to do this:-

    Execute sp_executesql N'spGetAuthorsList ''' + @author_id + ''', ' + CAST(@FindExact as varchar(6))

    Or...

    Steve

    We need men who can dream of things that never were.

  • RE: Where clause using parameters

    Forgot to mention - if you are doing Dynamic SQL within a stored procedure, when you EXEC the sql string, it generates a new SPID of its own. The sql...

    Steve

    We need men who can dream of things that never were.

  • RE: Where clause using parameters

    Hi All,

    Dynamic SQL has vulnerabilities - mainly based around web front ends. Just search for SQL Injection in Dynamic SQL. The risk is negligable if you are working on an...

    Steve

    We need men who can dream of things that never were.

  • RE: GoTo ????????

    Sorry gents,

    Posted - then had a week off and have just got back in the swing....

    I'm in complete agreement of using GoTo in error...

    Steve

    We need men who can dream of things that never were.

  • RE: sum of distinct records

    Simplified a touch:-

    select COUNT(DISTINCT(Name)) FROM

    Have fun

    Steve

    We need men who can dream of things that never were.

  • RE: select & string concatenation

    Nothing in ours either matey.....

    Have fun

    Steve

    We need men who can dream of things that never were.

  • RE: How to trap errors from nested stored procedures??

    Hi Ian,

    You are getting the error message because of these lines -

    set @b-2 = '123a'

    set @c = @a/@b

    You cant set the integer value @b-2 to the string '123a' -...

    Steve

    We need men who can dream of things that never were.

  • RE: Tough Query

    Hi David,

    Works a treat, no problems - change the 5 to a 7 and it picks the ones running into weekends.

    Have fun

     

    Steve

    We need men who can dream of things that never were.

  • RE: Search for partial credit card number

    Hi Guys,

    Just a thought as I haven't got too much time to test it - how much difference to performance (If any) would this give:-

    SELECT CardNumber FROM CreditCardDetails

    WHERE RIGHT(CardNumber, 4)...

    Steve

    We need men who can dream of things that never were.

  • RE: Search for partial credit card number

    Steve,

    Just checking - There is an index on the card number field isn't there?

    Have fun

    Steve

    We need men who can dream of things that never were.

  • RE: Datatype question. Need to exceed varchar(8000) in stored proc.

    Hi Jason,

    Cant you just declare @Ntext1(4000), @NText2(4000), @NText3(4000), @NText4(4000). Portion up your message / e-mail and then SELECT @NText1 + @NText2 + @NText3 + @NText4.

    Have fun

    Steve

    We need men who can dream of things that never were.

  • RE: Tough Query

    Hi Noel,

    I know what you mean - the job spec isn't very clear.  Every time I read it I come up with a slightly different set of requirements. I'm sure there is...

    Steve

    We need men who can dream of things that never were.

  • RE: Tough Query

    Hi Noel,

    New someone would do it.....

    But - does it accomplish the original request?

    Correct me if i'm wrong...

    Steve

    We need men who can dream of things that never were.

  • RE: Tough Query

    Hi Eric,

    Had a quick play with this, I dont think it's something you are going to accomplish with 'straight' sql but I will happily await a couple of the Guru's...

    Steve

    We need men who can dream of things that never were.

Viewing 15 posts - 91 through 105 (of 199 total)