Forum Replies Created

Viewing 15 posts - 136 through 150 (of 169 total)

  • RE: Help with Update statement

    most of the time is spent clustered index update (98%)

    If you want to make the updates work fast ..

    delete the clustered index . run the update query then create clustered index on...

  • RE: It Must Be Possible?!

    Explain the problem clearly.. I dont think its pivoting a table.. if that is the case I saw so many solutions in this forum only

  • RE: Help with Update statement

    I think Query is perfect ( I assume passwd as char type and ident as integer)

    Tested with the same scenario explained by you, my machine is taking less than minute to...

  • RE: Return persons initials

    I didn't get you.. what does it mean?

     

  • RE: Return persons initials

    Replace the following statement in the function

    Added space to every title

    SET @STR_INIT =LTRIM(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(@STR,'Mrs ',''),'Mr ',''),'Dr ',''),'Rev ',''),'Ms ',''))

    This will guarantee you, if any person have the name with the title...

  • RE: Return persons initials

    try this

    CREATE  FUNCTION dbo.Initials

    (

    @STR VARCHAR(4000)

    )

    RETURNS VARCHAR(4000) AS 

    BEGIN

    DECLARE

    @STR_INIT VARCHAR(4000),

    @STR_PROCESS VARCHAR(4000),

    @STR_COMPLETE VARCHAR(4000),

    @I INT,

    @j-2 INT

     

    SET @STR_INIT =LTRIM(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(@STR,'Mrs',''),'Mr',''),'Dr',''),'Rev',''),'Ms',''))

    SET @I=DATALENGTH(@STR_INIT)

    SET @j-2=0

    SET @STR_COMPLETE=''

    WHILE @j-2<@I

     BEGIN

      SET @STR_PROCESS= SUBSTRING(@STR_INIT,@J,1)

      IF (ASCII(@STR_PROCESS)>64 AND ASCII(@STR_PROCESS)<92)

      BEGIN

       SET @STR_COMPLETE= @STR_COMPLETE+@STR_PROCESS 

      END

      SET @j-2=@J+1

     END

    RETURN (@STR_COMPLETE)

     

    END

    ----------------------------------------------

    If...

  • RE: Why is this not working?

    Exactly what you are trying to do ?

     

  • RE: Find computed columns in a table

    select distinct a.name from sysobjects a inner join syscolumns b on a.id=b.id and b.iscomputed=1

    where a.xtype='U'

    The above query will give the table names which contains atlease one computed column

  • RE: Swaping Columns in Single Query

    You can try this

    create table Numbers (num1 int,num2 int)

    insert into Numbers values(1,2)

    insert into Numbers values(3,4)

    insert into Numbers values(5,6)

    declare @temp int

    Update Numbers

    set @temp=Num1, Num1=Num2, Num2=@temp

  • RE: concantenate text type data

    try this

    t.ColVarchar + ' ' + convert(varchar,t.ColText)

     

  • RE: Subquery on iinsert

    I think there is no need for a function for this, just get the result into @ImageNo using below select statement and use the variable in insert

    select

    ...

  • RE: Is there a lastmodified date stored in sql server when a s_proc is changed?

    I think James needs to know the last modified date of a stored procedure

    This can be get from INFORMATION_SCHEMA views in SQL Server 2005

    "Date the object was last modified by...

  • RE: Problem with control error in fecth

    Jeff, you are right.. my method will work for for single characters only

    Thanks

  • RE: Is there a lastmodified date stored in sql server when a s_proc is changed?

    You can try this also

    select

    name,modify_date from sys.objects

  • RE: Problem with control error in fecth

    Sergiy: Your solution is fetching the 'XX' Value also

    The following will fetch only numerics

    DECLARE C_TESTE INSENSITIVE CURSOR

    FOR

    SELECT TESTE FROM TESTE...

Viewing 15 posts - 136 through 150 (of 169 total)