Re: SQL DB

From: Hari Prasad (hari_prasad_k_at_hotmail.com)
Date: 07/06/04

  • Next message: theplantman222: "Re: Currency Format with Comma Delimination"
    Date: Tue, 6 Jul 2004 08:28:20 +0530
    
    

    Hi,

    (FYI, See the responses in programming group.)

    It seems you have to delete the jobs table, not the entire database.

    1. Login to Query analyzer

    2. Select the database in which jobs table reside

    3. Execute the below command to clear the table.

      TRUNCATE TABLE Jobs

    4. The above command will return an error if jobs table have foreign key
    relation. in that case use DELETE Command

      DELETE from jobs

    Note:

    Dropping the database will clear all the objects and data inside the
    database.

    --
    Thanks
    Hari
    MCDBA
    "William" <anonymous@discussions.microsoft.com> wrote in message
    news:2684e01c4629a$63758bb0$a501280a@phx.gbl...
    > Hello,
    >
    > What I want to do is delete all data found in jobs table
    > because I need to update it by running a script on a log
    > file.
    >
    > When i wrote your function it gave me a script error in
    > the syntax in near '<'. Here's what i re-wrote:
    >
    > FROM         Jobs alter_database < Jobs >
    > SET           single_user WITH ROLLBACK immediate go
    > DROP DATABASE < Jobs >
    >
    > I also looked for the easier way which is by from
    > Enterprise manager .. Expland databases.. Select
    > database.. Right click
    > and Delete, but I can't find Expland databases in
    > Enterprise Manager.
    >
    > Can someone tell me where it is and tell why I'm not able
    > to delete everything from Jobs table?
    >
    >
    > Cheers!
    >
    >
    >
    >
    > >-----Original Message-----
    > >Hi,
    > >
    > >Are you trying to delete the data from table or remove
    > the database fully.
    > >
    > >Command to remove database.  (Can anyone tell me the
    > function that will
    > >allow me to delete my current db?)
    > >
    > >alter_database <dbname> set single_user with rollback
    > immediate
    > >go
    > >drop database <dbname
    > >
    > >or
    > >from Enterprise manager .. Expland databases.. Select
    > database.. Right click
    > >and Delete
    > >
    > >
    > >command to delete data from table (I need to delete all
    > JobId's  from the
    > >db.)
    > >
    > >See
    > >
    > >DELETE command in books online.
    > >
    > >--
    > >Thanks
    > >Hari
    > >MCDBA
    > >
    > >"William" <anonymous@discussions.microsoft.com> wrote in
    > message
    > >news:267dd01c46292$c42c95a0$a501280a@phx.gbl...
    > >> G'Day folks,
    > >>
    > >> My question is related to deleting an existing db in
    > sql.
    > >>
    > >> The reason why I need to delete the existing db in sql
    > is
    > >> to update the db from my log file.
    > >>
    > >> Example for the table jobs, I need to delete all
    > JobId's
    > >> from the db.
    > >>
    > >> Can anyone tell me the function that will allow me to
    > >> delete my current db?
    > >>
    > >> Sincerely your's.
    > >
    > >
    > >.
    > >
    

  • Next message: theplantman222: "Re: Currency Format with Comma Delimination"

    Relevant Pages

    • Re: Cannot use a CONTAINS or FREETEXT predicate on table...
      ... command from the context of the database I wish to publish. ... This database is not enabled for publication. ... The replication agent has been successfully started. ... Source: Microsoft SQL Native Client ...
      (microsoft.public.sqlserver.replication)
    • Re: SQL update in SQL database issue
      ... I am thinking if i change the database from Foxpro to SQL or MS Access, ... program installation require, if a table corrupted, user can just attach ... should I use SQL pass through command to update the Foxpro Database or ...
      (microsoft.public.fox.programmer.exchange)
    • Re: Unload Event Problem
      ... come up with that will allow the database to be used as it is now. ... working so they validly have records with no StopTime yet, ... the jobs relating to the user who is closing down. ... The unload event on the hidden form with null StopTime forcing user to ...
      (microsoft.public.access.forms)
    • Re: Deletin db
      ... col int primary key ... > It seems you have to delete the jobs table, not the entire database. ... Execute the below command to clear the table. ...
      (microsoft.public.sqlserver.programming)
    • Re: Unload Event Problem
      ... If you have multiple users in the same back end, and some are still working so they validly have records with no StopTime yet, but you want to allow the current user to close their instance of the database, but they must enter their StopTime, you will have to track who created/is editing each of the jobs and execute the Update query such that it updates only the jobs relating to the user who is closing down. ... The unload event on the hidden form with null StopTime forcing user to enter stop time to exit db and StopTime automatically filled in when db is shut down thru update query would be a problem if the db were shut down before quitting time for any reason - all time would be stopped while work continued. ...
      (microsoft.public.access.forms)