Forum Replies Created

Viewing 15 posts - 166 through 180 (of 192 total)

  • RE: how to remove carriage return symbol?

    Ah, it's a text column.

    I'm sure you know this but I want to double check. Are you running sql 2005 (and converting to VARCHAR(max)? If you are not, you may...

  • RE: how to remove carriage return symbol?

    Just for clarification, the carriage return is in the data that you are exporting to a text file?

    If that is the case, you could probably do this:

    SELECT REPLACE(REPLACE(Column,CHAR(10),''),CHAR(13),'') as Column

    FROM...

  • RE: Concatenating Values from Different Rows

    Hi Michael,

    A self-join is where a table is joined to itself for recursive or higherarchial operations (such as concatenating values from different rows).

    An equi-join is basically where the join operator...

  • RE: How do the cursors work?

    Thanks Jeff, Matti and John for correcting me and clearing up my knowledge of Temp Tables/table variables. I'm glad Hector got a sound response.

  • RE: ''''Invalid column name'''' error after ALTER TABLE

    For what it's worth,

    This should also work (and your variable contents will be preserved):

    DECLARE @idStart INT
    DECLARE @hospId VARCHAR(4)
    
    --(code to assign @idStart and @hospId  values…)
    
    DECLARE @stmt VARCHAR(200)
     
  • RE: How do the cursors work?

    Here is a good article on table variables and temporary tables. From reading this article, it seems I may be wrong about large table variables being converted into temporary tables....

  • RE: How do the cursors work?

    For many records (registers), a temporary table is recommended. The reason for this is twofold. First, as you pointed out, you can use indexes*. Second, when your table variable gets...

  • RE: How do the cursors work?

    Depending on how you declare a cursor, they can cause undesired locking, the can strain your tempdb, I have known cursors to crash, but the biggest reason to avoid cursors...

  • RE: Creating sequential numbers

    The code I put up is split into two blocks. The first block create a temp table and inserts a few values, and the second block does a 'fill down'...

  • RE: Count Decimal Places

    Ouch! I guess next time I should get more information on how a solution might be used before posting a response!

    Interesting solutions all around, I thought. Very slick guys!

  • RE: Creating sequential numbers

    How about something like this:

    CREATE TABLE #t1
    (
    
        num VARCHAR(30),
        Location VARCHAR(30)
    )
    INSERT INTO #t(numlocation)
    VALUES('32764000021707' 
  • RE: Creating sequential numbers

    Am I correct in thinking the other columns would be blank at that point?

  • RE: Mind Your Manners

    I guess there is an online example here:http://www.simple-talk.com/prettifier/

  • RE: Mind Your Manners

    Check out Simple-talk's SQL prettifier on http://www.simple-talk.com/sql/sql-tools/download-sql-prettifier/ It's very cool!

    it's basically a SQL proc that generates html. The only downside is the proc you posted is too wide and...

  • RE: Mind Your Manners

    It might be worth changing your settings in QA (this will help)

    Tools->Options->Editor

    Check the Save tabs as spaces box

Viewing 15 posts - 166 through 180 (of 192 total)