Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

delete records
Hello,

I have a database called articles

I want to delete all articles from a subgroup e.g. DVD

If I am in the enterprisemanager what steps do I have to take to do this

thanks in advance

Paul



Report this thread to moderator Post Follow-up to this message
Old Post
Paul
09-20-05 06:24 PM


Re: delete records
I would do it in Query Analyzser (from EM you can select Tools, SQL
Query Analyzer)

Something like this:

BEGIN TRAN

DELETE
FROM articles
WHERE subgroup = 'DVD'

SELECT * FROM articles

ROLLBACK TRAN

Once you've verified that it deleted what you expected then change the
ROLLBACK to COMMIT.

Make sure you have a backup.

--
David Portas
SQL Server MVP
--


Report this thread to moderator Post Follow-up to this message
Old Post
David Portas
09-20-05 06:24 PM


Re: delete records
Hello David,

thank you for your answer it is exactly what I need

kind regards Paul


"David Portas" < REMOVE_BEFORE_REPLYI
NG_dportas@acm.org> schreef in bericht
news:1127237303.004486.198620@g44g2000cwa.googlegroups.com...
>I would do it in Query Analyzser (from EM you can select Tools, SQL
> Query Analyzer)
>
> Something like this:
>
> BEGIN TRAN
>
> DELETE
>  FROM articles
>  WHERE subgroup = 'DVD'
>
> SELECT * FROM articles
>
> ROLLBACK TRAN
>
> Once you've verified that it deleted what you expected then change the
> ROLLBACK to COMMIT.
>
> Make sure you have a backup.
>
> --
> David Portas
> SQL Server MVP
> --
>



Report this thread to moderator Post Follow-up to this message
Old Post
Paul
09-21-05 01:23 AM


Re: delete records
Hello David

Actually I want do also a rename command
this means not delete the record however change all subgroups with DVD in
e.g. VHS

kind regards Paul

"David Portas" < REMOVE_BEFORE_REPLYI
NG_dportas@acm.org> schreef in bericht
news:1127237303.004486.198620@g44g2000cwa.googlegroups.com...
>I would do it in Query Analyzser (from EM you can select Tools, SQL
> Query Analyzer)
>
> Something like this:
>
> BEGIN TRAN
>
> DELETE
>  FROM articles
>  WHERE subgroup = 'DVD'
>
> SELECT * FROM articles
>
> ROLLBACK TRAN
>
> Once you've verified that it deleted what you expected then change the
> ROLLBACK to COMMIT.
>
> Make sure you have a backup.
>
> --
> David Portas
> SQL Server MVP
> --
>



Report this thread to moderator Post Follow-up to this message
Old Post
Paul
09-23-05 01:24 AM


Re: delete records
UPDATE articles
SET subgroup ='VHS'
WHERE subgroup = 'DVD'

http://sqlservercode.blogspot.com/


Report this thread to moderator Post Follow-up to this message
Old Post
SQL
09-23-05 01:24 AM


Sponsored Links





Last Thread Next Thread
Post New Thread

Microsoft SQL Server forum archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 01:42 PM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006