Showing posts with label items. Show all posts
Showing posts with label items. Show all posts

Friday, March 30, 2012

how to remove subscriptions items of sqlserver 2000

Sir,
I am unable to remove replication (subscriptions items) from subscriber
database which has been removed from publications database.
I would be very much grateful if anyone could help me.
with regards,
chewang dorjiIf the wizards did not drop subscriptions correctly and some items still
seem to be replicated and have subscribers, you will have to use system SPs
to do the job. Check the sp_removedbreplication, sp_droppullsubscription,
sp_dropsubscription and related procedures in Books OnLine. If you are
talking only about the tables created on the subscriber, you have to drop
them manually - use the Drop Table statement.
--
Dejan Sarka, SQL Server MVP
FAQ from Neil & others at: http://www.sqlserverfaq.com
Please reply only to the newsgroups.
PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org
"Chewang Dorji" <drukfood@.druknet.bt> wrote in message
news:u9CTafRbDHA.2372@.TK2MSFTNGP10.phx.gbl...
> Sir,
> I am unable to remove replication (subscriptions items) from subscriber
> database which has been removed from publications database.
> I would be very much grateful if anyone could help me.
> with regards,
> chewang dorji
>

Friday, March 23, 2012

How to reference items from different database?

Hi all,

I have two databases DB_External and DB_Internal.

I am writing some stored procedures (in DB_Internal) that reads from
the tables in DB_External. I execute my stored procedures from
DB_Internal.

Everytime I want to read the tables in DB_External, I have to refer to
the table as DB_External.dbo.tableName.

Is there a better way of declaring the database DB_External up front
in the stored procedure so I don't have to pre-fix "DB_External.dbo."
in all the table names?

Thanks in advance,
June Moore."June Moore" <jungewum@.yahoo.com.au> wrote in message
news:e5dfaf21.0310100030.3e0067a5@.posting.google.c om...
> Hi all,
> I have two databases DB_External and DB_Internal.
> I am writing some stored procedures (in DB_Internal) that reads from
> the tables in DB_External. I execute my stored procedures from
> DB_Internal.
> Everytime I want to read the tables in DB_External, I have to refer to
> the table as DB_External.dbo.tableName.
> Is there a better way of declaring the database DB_External up front
> in the stored procedure so I don't have to pre-fix "DB_External.dbo."
> in all the table names?
> Thanks in advance,
> June Moore.

You always have to fully qualify the name - there's no way around that. And
it's good practice to include the dbo owner prefix, even in the 'local'
database.

If you're concerned about moving code between servers where the DB names may
be different, you could consider a pre-processor script to 'fill in' or
find/replace the DB names in a code template, then create the procedure.

Simonsql

Sunday, February 19, 2012

How to query COUNT

If I want to find out how many items of a field is in a table like Type1, Type2... to build a table like

Type1, 10
Type2, 25
...

Is is better to open the table -> Select Type From Table

and then go down each row and record the count of a type or is it better to

Select Distinct Type from table to get the types and then do each type's select to get the count

Select Count (1) from table where type = 'Type?'

Thanks,

FrankUse COUNT and GROUP BY