Viewing 8 posts - 1 through 8 (of 8 total)
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.
June 3, 2002 at 5:08 am
pls trying to use table varibal insted of TMP table
by
DECLARE @TableName TABLE
(
Fields
)
Shrinivas L.K.
June 3, 2002 at 2:39 am
Hi
select Replace(Convert(varchar(11),Getdate(),110),'-','')
Shrinivas L.K.
June 3, 2002 at 2:34 am
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.
May 29, 2002 at 6:05 am
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...
April 11, 2002 at 8:00 am
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.
April 11, 2002 at 4:14 am
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 + ''.'' +...
December 28, 2001 at 1:03 am
Viewing 8 posts - 1 through 8 (of 8 total)