Forum Replies Created

Viewing 8 posts - 1 through 8 (of 8 total)

  • RE: Top 5 Records

    That works Fine

    Thanks Steve

    Shrinivas L.K.

  • RE: Temporary Tables

    pls trying to use exists object

    if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].tmptablename') and OBJECTPROPERTY(id, N'IsUserTable') = 1)

    drop table [dbo].[tmptablename]

    GO

    Shrinivas L.K.

  • RE: Temporary Tables

    pls trying to use table varibal insted of TMP table

    by

    DECLARE @TableName TABLE

    (

    Fields

    )

    Shrinivas L.K.

  • RE: to get only date or hour from getdate()

    Hi

    select Replace(Convert(varchar(11),Getdate(),110),'-','')

    Shrinivas L.K.

  • RE: Easy Syntax

    Update #temploadpack

    SET city_state=

    WHEN LEN(city_state) > 3 then

    LEFT(city_state,(LEN(city_state)-3))

    WHEN LEN(city_state) < 3 then

    city_state

    END

    from #temploadpack

    where city_state is not null

    Shrinivas L.K.

  • RE: Update of image columns in triggers

    DECLARE @src_textptr varbinary(16), @dest_textptr varbinary(16);

    SELECT @src_textptr = TEXTPTR( txtfld )

    FROM src_tbl

    WHERE IDENTITYCOL = 1;

    -- Ensure that the text pointer is initialized for the

    -- destination table

    UPDATE dest_tbl

    SET txtfld = ''

    WHERE IDENTITYCOL...

  • RE: Returning top 3 records

    SELECT *

    FROM wellprod wellprod1

    WHERE EXISTS

    (SELECT 1

    FROM

    (SELECT year, gas_mo

    FROM wellprod wellprod3

    WHERE wellprod1.uwi= wellprod3.uwi

    Group By year, gas_mo

    Having count(*) <=3

    ) AS wellprod2

    WHERE wellprod2.year= wellprod1.year AND wellprod2.gas_mo= wellprod1.gas_mo)

    ORDER BY year, gas_mo

    Shrinivas L.K.

  • RE: Almost bald...Syscolumns question

    you can use sp_executeSql to return a output value in the following way

    Declare @strSQL nVarchar(2000),

    @strt nvarchar(100),

    @Count INT

    set @strSQL = ('SELECT @Count = Count(*) FROM .information_schema.columns WHERE table_catalog + ''.'' +...

Viewing 8 posts - 1 through 8 (of 8 total)