Forum Replies Created

Viewing 15 posts - 616 through 630 (of 691 total)

  • RE: Simple PATINDEX and Escape codes

    Watch those ranges....

    create table #search(somechar char(1))

    go

    declare @i int

    set @i = 1

    while @i < = 256

    begin

    insert #search

    select char(@i)

    where char(@i) not like '[abcdefghijklmnopqrstuvwxyz0123456789]'

    set @i = @i + 1

    end

    go

    SELECT *

    from #search

    where PATINDEX('%[^a-z0-9]%', somechar)...

  • RE: Lookup Table Madness

    The perceived virtue of entity-attribute-value tables is that they will assist in creating a simplified schema (less tables = simplicity in some peoples' minds). The other perceived benefit is...

  • RE: Overlapping date ranges

    Please post DDL and sample data for this table. Are you searching an entire table for overlapping dates? Or a subset based on a key? Or...?

  • RE: Lookup Table Madness

    Code/MUCK tables (or more formally, entity-attribute-value tables) violate the first normal form and therefore have severe data integrity issues. Keeping an open mind, though, I would be very interested...

  • RE: Lookup Table Madness

    I totally agree with your message, but please slow down when you write. Maybe make an outline first, and have a few people edit it for you. You...

  • RE: Returning links in a textfield??

    Aris,

    You don't need to use the 'testsearch' table at all.  It was just there for an example.  Use your authors table itself:

    select substring(authors.authorbio,

     numbers.number,

     charindex(' ', 

      authors.authorbio,

      charindex('http://', authors.authorbio, numbers.number)) -...

  • RE: Returning links in a textfield??

    First, a table called 'numbers' is created, with every number from 1 - 8000.  This is meant to be a one-time thing.  You should also make the number a primary...

  • RE: Returning links in a textfield??

    You can use a sequence table for this.  Here's a very simple example.  I have not tested it thoroughly, so it may require some or a lot of tweaking

  • RE: Returning links in a textfield??

    Depending on your data, this may be doable without a cursor.  Can you post some sample rows?

  • RE: Returning links in a textfield??

    Aris --

    By "textfield", I assume you mean a column of datatype TEXT? What is the maximum length of the data that will ever be inserted into the column?

    Have you...

  • RE: SCOPE_IDENTITY

    Mauro --

    You need to use sp_executesql's OUTPUT parameter:

    exec sp_executesql @sql, N'@NewAcctID int OUTPUT', @NewAcctID OUTPUT

  • RE: Question of the Day for 07 Sep 2004

    In addition to the problems already mentioned, there is the little issue of the fact that SQL Server has no notion of anything called a "record".

  • RE: Two fields into one

    CREATE VIEW YourView

    AS

    SELECT FirstName + ' ' + LastName AS FirstLast

    from YourTable

  • RE: covering index

    maxismclaren,

    Please note that you _can_ include a column with the BIT datatype in an index; you just can't do it from the Enterprise Manager UI.

  • RE: Passing a table variable between stored procedures...

    By the way, this article shares some methods:

    http://www.sommarskog.se/share_data.html

Viewing 15 posts - 616 through 630 (of 691 total)