Showing posts with label drop. Show all posts
Showing posts with label drop. Show all posts

Sunday, March 25, 2012

cleaning up system objects left by a merge repl.

Hi,
After disabling publishing on my server, there were
numerous merge replication related objects.
How do I clean them up. I tried to drop them, but I get a
message saying I am trying to drop system objects, and the
effort fails.
Thanks,
Sang
Sang,
try sp_removedbreplication (assuming the database is no longer contains any
publications/subscriptions).
Hilary Cotter sent me a link to a script he created at http://www.ava.co.uk
(technical resouces section) that you might want to look at, if the above
stored proc doesn't remove all the objects.
HTH,
Paul Ibison

Monday, March 19, 2012

Choosing several items from a Pick list

Morning All,
Does anyone know how to pick more than one item from a pick list (drop down
box.)
E.g if I had the months of the year in the pick list how could I select Jan
and Feb'
Any ideas greatfully recieved.
Regards
Munish
--
Technical Data Analyst
Hammersmith & W London CollegeAs fas as I know you cannot do this with the normal report parameters list,
you need to write code to handle the multi select and call the reporting
services web service. I think it is a lot of effort, and I havent seen any
example code.
I think RS 2005 has this multi select functionality included.
"Munish RaasmaanDaas" wrote:
> Morning All,
> Does anyone know how to pick more than one item from a pick list (drop down
> box.)
> E.g if I had the months of the year in the pick list how could I select Jan
> and Feb'
> Any ideas greatfully recieved.
> Regards
> Munish
> --
> Technical Data Analyst
> Hammersmith & W London College

Friday, February 24, 2012

Checking sysobjects for temp table

How can I check for the existence of a temp table before I attempt to drop
it?
Something like:
IF EXISTS( SELECT * FROM sysobjects WHERE Name = '#temp' )
DROP TABLE #temp
#temp exists but I cannot find a record for it in sysobjects. Neither can I
find it in tempdb (tempdb.dbo.sysobjects ).
Can anyone recommend how to handle this situation?Try:
if object_id('tempdb..#tmp') is not null
drop table #tmp
--
-Vishal
"David Frick" <dave@.frickcpa.com> wrote in message
news:uIYX89TTDHA.1992@.TK2MSFTNGP12.phx.gbl...
> How can I check for the existence of a temp table before I attempt to drop
> it?
> Something like:
> IF EXISTS( SELECT * FROM sysobjects WHERE Name = '#temp' )
> DROP TABLE #temp
> #temp exists but I cannot find a record for it in sysobjects. Neither can
I
> find it in tempdb (tempdb.dbo.sysobjects ).
> Can anyone recommend how to handle this situation?
>

Sunday, February 12, 2012

Check to see if a table exists

I am running Sql Server 7.0 and I am using a store procedure to drop a global temp table if it exists.
Currently, it looks like this:
if object_id('##Table') is null
print 'True'
else
print 'False'
Drop Table ##tmpTable
It works fine through Query Analyzer, but when I try to execute this code through ASP code, I get the following error:
Microsoft OLE DB Provider for SQL Server error '80040e09' With the statement printing out TRUE that the table doesn't exist. And if doesn't exist, it should continue on and create the table as instructed.
Any ideas as to what I am doing wrong? Is there a better way to check as to whether or not a table exists? Any help would be appreciated.
Thanks.
Kirk
That will always execute the drop table
if object_id('##Table') is null
print 'True'
else
begin
print 'False'
Drop Table ##tmpTable
end
And think will only work if you are in tempdb - try
if object_id('tempdb..##Table') is null
print 'True'
else
begin
print 'False'
Drop Table ##tmpTable
end
"Kirk" wrote:

> I am running Sql Server 7.0 and I am using a store procedure to drop a global temp table if it exists.
> Currently, it looks like this:
> if object_id('##Table') is null
> print 'True'
> else
> print 'False'
> Drop Table ##tmpTable
> It works fine through Query Analyzer, but when I try to execute this code through ASP code, I get the following error:
> Microsoft OLE DB Provider for SQL Server error '80040e09' With the statement printing out TRUE that the table doesn't exist. And if doesn't exist, it should continue on and create the table as instructed.
> Any ideas as to what I am doing wrong? Is there a better way to check as to whether or not a table exists? Any help would be appreciated.
> Thanks.
> Kirk
>