Showing posts with label command. Show all posts
Showing posts with label command. Show all posts

Wednesday, March 21, 2012

HOW to make a database blank through single command?

Is there any way through which all the tables of database can be make blank through a single command.
sumeetOriginally posted by sumeet29
Is there any way through which all the tables of database can be make blank through a single command.

sumeet

I think you should generate the SQL script for the tables, make sure to check the DROP, and CREATE options, besides you should check the Script Indexes, Script triggers, Script PRIMARY keys, and Script FOREIGN keys options.
After running this script all tables will be dropped and created again, so should be blank.
Hope this will help.|||True, thats only the way even I know.

BTW, why do you want to do so?

Friday, February 24, 2012

how to know time of insertion of a row

Hi
Is there a way to know time of insertion of a row without using,
timestamp,currentdate function etc. Isthere any DBCC COMMAND which gives me
the date of insertion of a row.
--
Thanks in Advance
Regards
SuparichituduNo, there isn't
However , you are be able to create a column with GEDATE() as a DEFAULT
CONSTRAINT.
CREATE TABLE Test (col1 INT,col2 DATETIME DEFAULT GETDATE())
GO
INSERT INTO Test (col1) VALUES (100)
GO
SELECT * FROM Test
"Suparichithudu" <Suparichithudu@.discussions.microsoft.com> wrote in message
news:42420237-454F-49EE-B756-21326EAADE0C@.microsoft.com...
> Hi
> Is there a way to know time of insertion of a row without using,
> timestamp,currentdate function etc. Isthere any DBCC COMMAND which gives
> me
> the date of insertion of a row.
> --
> Thanks in Advance
> Regards
> Suparichitudu
>|||if you're in the unenviable situation where you need to retrospectively
find this out, one thing that might be able to help you is if you can
get hold of the transaction logs over the period that you know it was
inserted. However that would require you to not be using a simple
recovery model.
There are some tools you can get free trials of which will query a
logfile, but I'm not sure of their reliability.

Sunday, February 19, 2012

how to know database space on SQL 6.5 by command line

Hello,
i'll write a scripte to check my databases.
My need know the space use by the database & device,
the same for the space free.
Can you help me..
ThanksHi
I don't have 6.5 access at the moment, but you may want to check out if
sp_helpdb <dbname> run from isql, gives you something you can work with.
John
"bfav" <bfav@.ch.ibm.com> wrote in message
news:087701c3506d$49c01bd0$a001280a@.phx.gbl...
> Hello,
> i'll write a scripte to check my databases.
> My need know the space use by the database & device,
> the same for the space free.
> Can you help me..
> Thanks

How to Kill Process - Sleeping, Awaiting Command

Hi,
Any help will me be much apprecaited. Our SQL Server 2000
has many processing as Awaiting Command, Sleeping which
we can't seen to kill even server restart doesn't get rid
of them.
How do I kill them?
Hw do I avoid process going in that state in the future?
All these processes below to a user name which we use to
run some stored procedure.
Please also email your reply to terryb@.tisc.edu.au.
Thank you
TerryTerry
Please refer to KILL command on BOL
"Terry Bhatti" <terryb@.tisc.edu.au> wrote in message
news:01cf01c37120$72997e60$a001280a@.phx.gbl...
> Hi,
> Any help will me be much apprecaited. Our SQL Server 2000
> has many processing as Awaiting Command, Sleeping which
> we can't seen to kill even server restart doesn't get rid
> of them.
> How do I kill them?
> Hw do I avoid process going in that state in the future?
> All these processes below to a user name which we use to
> run some stored procedure.
> Please also email your reply to terryb@.tisc.edu.au.
> Thank you
> Terry
>|||Terry,
When you say you can't seem to kill them, are you referring to the KILL
command failing?
Are these connections autostarting when you start the SQL Server? How is it
that the problem is still there after a server restart? Try using DBCC
INPUTBUFFER(spid) to see if you can figure out what is going on.
Awaiting Command and Sleeping are not pernicious states for a connection to
be in.
Russell Fields
"Terry Bhatti" <terryb@.tisc.edu.au> wrote in message
news:01cf01c37120$72997e60$a001280a@.phx.gbl...
> Hi,
> Any help will me be much apprecaited. Our SQL Server 2000
> has many processing as Awaiting Command, Sleeping which
> we can't seen to kill even server restart doesn't get rid
> of them.
> How do I kill them?
> Hw do I avoid process going in that state in the future?
> All these processes below to a user name which we use to
> run some stored procedure.
> Please also email your reply to terryb@.tisc.edu.au.
> Thank you
> Terry
>