Forum Replies Created

Viewing 15 posts - 331 through 345 (of 582 total)

  • RE: Unusual -- Violation of PRIMARY KEY constraint ERROR

    When this occurs, use

    DBCC

    CHECKIDENT ('table_name', NORESEED)

    to see if a value higher than the current identity value has been...

  • RE: Running Functions within Strings

    Dynamic SQL is usually a bad idea, but for a quick fix,

    Set @select1 = 'Select Reference.RefID, Reference.CreatorString As CreatorString,  Genre.Type As Media, dbo.getRowRank(''' + replace(@Target,

  • RE: Horrible response time with Update Query

    I understand that you are not some sort of latter-day Sherlock Holmes with nothing to do but solve interesting mysteries (and in his case, hard drugs and fiddling), but you...

  • RE: How to order records

    I think the confusion arises here:

    >Then, all you need to do is use this stored procedure to get your data... it won't be in the form you asked for...

  • RE: looking for images

    It crossed my mind that if you want to store this kind of data, the XML datatype might be of use. I have a feeling that it might be possible...

  • RE: right of last instance of characters

    I didn't use a double colon, but it works for any string (subject to length restrictions).

    declare

    @str varchar(

  • RE: Conditions in SELECT

    Re indexing - I agree for the medium term, but on a longer view and if you have many such reports, you might want to look at a specialised reporting environment...

  • RE: scope? some sp_ prcs use db_name() called from, others not?

    Try owner(schema) qualifying the table name. And yes, post the error and plan if that doesn't work.

  • RE: scope? some sp_ prcs use db_name() called from, others not?

    I don't know (yet). How do you know it doesn't? I can't reproduce it.

  • RE: Returning number of days in month by year

    I agree, and on a more general point. Scalar UDFs are not a panacea. If they are used in a multi-row SQL statement, they are best used as a shorthand for...

  • RE: case stament in where clause

    If you're going to do that, why not:

    declare @sp_type int
    set @sp_type = 5
     
    declare @datesarg datetime
    set @datesarg = case @sp_type 
    when 5 then dateadd(mm,-1,getdate())

    when 6 then dateadd(mm,-2,getdate())

    else dateadd(mm,-3,getdate())

    end

    select * from

    sales

    where Cur_date >...

  • RE: Query with multiple And statements

    The reason a leading wildcard slows things down is because you can't use an index. The index is arranged in (an) alphabetical order, so to find things quickly you need...

  • RE: Conditions in SELECT

    You can't rely on SQL using a lazy OR, i.e. ignoring the second disjunct if the first is true. Even if it did sometimes do that, which I don't think...

  • RE: Easy and effective way to search?

    The full text search capabilities in SQL Server offer a reasonably wide range of functionality, which could perhaps be set up as a basic system and subsequently improved in response...

  • RE: Why does this take so long?

    Should have added that your joins would need to be left joins, and the where clauses amended to handle NULLs, otherwise new venues withut any reservations would never show up...though...

Viewing 15 posts - 331 through 345 (of 582 total)