Showing posts with label call. Show all posts
Showing posts with label call. Show all posts

Wednesday, March 28, 2012

MSSQL 2000 Activity Logs

Does the SQL server logs the information on when a database has ben
deleted, attached, deatached, and so on?
This morning I recived a call from remote site that the aplication won't
connect to the server. It turns out that the user database has disapeared
from the server. I can't see it in the EM, nor I can see the .mdf/.ldf files
on the disk. The SQL server logs (from the EM) just show me that the
database was opened (started) at some time this weekend, and that's it.
Are there more detailed logs, wich I was unable to find?
Mario
"I can do it quick. I can do it cheap. I can do it well. Pick any two."
Mario Splivalo
msplival@.jagor.srce.hrHi,
I feel that SQL Server wont store any information of that sort by default.
If you keep enabled the profiler then you can see the command DROP DATABASE
, by using that you can identify the user who has dropped it. But old data
can not be retrived.
Thanks
Hari
MCDBA
"Mario Splivalo" <majk@.fly.srk.fer.hr> wrote in message
news:slrnc5td57.f2.majk@.fly.srk.fer.hr...
> Does the SQL server logs the information on when a database has ben
> deleted, attached, deatached, and so on?
> This morning I recived a call from remote site that the aplication won't
> connect to the server. It turns out that the user database has disapeared
> from the server. I can't see it in the EM, nor I can see the .mdf/.ldf
files
> on the disk. The SQL server logs (from the EM) just show me that the
> database was opened (started) at some time this weekend, and that's it.
> Are there more detailed logs, wich I was unable to find?
> Mario
> --
> "I can do it quick. I can do it cheap. I can do it well. Pick any two."
> Mario Splivalo
> msplival@.jagor.srce.hr|||On 2004-03-22, Hari Prasad <hari_prasad_k@.hotmail.com> wrote:
> Hi,
> I feel that SQL Server wont store any information of that sort by default.
> If you keep enabled the profiler then you can see the command DROP DATABAS
E
> , by using that you can identify the user who has dropped it. But old data
> can not be retrived.
>
Yes, when I have the profiler running, then I can see what's going on. But,
most of the time, I don't keep the profiler up.
Is there a way to tell SQL server 'do, please, keep logs of who and when
created/dropped/attached/deatached databases'?
Mike
--
"I can do it quick. I can do it cheap. I can do it well. Pick any two."
Mario Splivalo
msplival@.jagor.srce.hr|||Mario
You can run SQL Server Profile to capture those commands and save it to the
table.
As far as I know with SQL Server 2005 you will be able to define a trigger
on a table or even on a database ( I am not certain) for drop table events.
"Mario Splivalo" <majk@.fly.srk.fer.hr> wrote in message
news:slrnc5tjfd.p0k.majk@.fly.srk.fer.hr...
> On 2004-03-22, Hari Prasad <hari_prasad_k@.hotmail.com> wrote:
default.
DATABASE
data
> Yes, when I have the profiler running, then I can see what's going on.
But,
> most of the time, I don't keep the profiler up.
> Is there a way to tell SQL server 'do, please, keep logs of who and when
> created/dropped/attached/deatached databases'?
> Mike
> --
> "I can do it quick. I can do it cheap. I can do it well. Pick any two."
> Mario Splivalo
> msplival@.jagor.srce.hr|||On 2004-03-22, Uri Dimant <urid@.iscar.co.il> wrote:
> Mario
> You can run SQL Server Profile to capture those commands and save it to th
e
> table.
So, if I'm not running the profiler at the moment that actuall event of
droping/deleting the database was taking place, I have no way of seeing what
happened.
The funniest thing is that the missing database was published for
replication, so you can't just delete it from the EM. If you try to delete
the file from the disk (using Windows Explorer, for instance), it will tell
you that the file is in use (because SQL server is using it).
But, SQL server was running all the time (uptime is more than 6 mths), and
the database just dissapeared. No .mdf files found on the disk, no errors
(that I can find) on the SQL server. If I run the NTFS-Undelete utility (i
tried several ones) I can find dozens of deleted files (some were deleted
more than 6 months ago!), but none of the files are my database files.
At this point of time I have no way or knowledge to explain what exactley
happened.
Mike
--
"I can do it quick. I can do it cheap. I can do it well. Pick any two."
Mario Splivalo
msplival@.jagor.srce.hr|||On 2004-03-22, Mario Splivalo <majk@.fly.srk.fer.hr> wrote:
> On 2004-03-22, Uri Dimant <urid@.iscar.co.il> wrote:
>
I browsed the transaction log for the master database, and found that
database was deleted
Mike
"I can do it quick. I can do it cheap. I can do it well. Pick any two."
Mario Splivalo
msplival@.jagor.srce.hr

Wednesday, March 21, 2012

Msgbox from Stored Procedure

Hi,
Can I Call MsgBox Function From SP ?No. Transact SQL doesn't have any UI functionality. For that you need to use
a host language such as VB or C# for example.
David Portas
SQL Server MVP
--|||As long as Procedures are executed on the server that would make no sense to
display a Msgbox. If ou want to debug your sp, fill in some PRINT commands
to get some information.
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"DMP" <debdulal.mahapatra@.fi-tek.co.in> schrieb im Newsbeitrag
news:OVQx1XXRFHA.2604@.TK2MSFTNGP10.phx.gbl...
> Hi,
> Can I Call MsgBox Function From SP ?
>|||Hi,
What are you trying to achieve, are you trying to debug something or
are you trying to display something to the end user.
If you are trying to debug something in a stored procedure then I
personally use a debug table posting results to the table as I go
through the stored procedure. This only any good for debuging.
If you are trying to display something to the end user then use an
OUTPUT parameter in the stored procedure and get the value on the
end-users computer and display that throught the msgbox interface.
Regards
Alex|||Thanks to everybody,
Basically I have three sp let sp1,sp2,sp3
From VB I call sp1,
sp1 call to sp2 and dpending the return value of sp2 , End user will take
dicission that
sp3 will be called or not like VB msgbox("do you want to continue ?",
vbYesNo),
If vbYes then calls to sp3 else return from sp2,sp1
This is my goal...
"Alex" <alex@.intralan.co.uk> wrote in message
news:1113985604.270498.57780@.l41g2000cwc.googlegroups.com...
> Hi,
> What are you trying to achieve, are you trying to debug something or
> are you trying to display something to the end user.
> If you are trying to debug something in a stored procedure then I
> personally use a debug table posting results to the table as I go
> through the stored procedure. This only any good for debuging.
> If you are trying to display something to the end user then use an
> OUTPUT parameter in the stored procedure and get the value on the
> end-users computer and display that throught the msgbox interface.
> Regards
> Alex
>|||you either need to design out the decision or:
All in VB:
Call SP1
Processes results
Ask User Continue?
Yes? Call SP3
SP's run not just "on" the server, but "in" the server - the only ways that
an SP can communicate is via return codes, output parameters, result sets,
print statements (rare IMHO), exceptions (raiserror), or indirectly via COM
objects - see sp_oa* sp's. (there are more methods, but I think you get the
point). IE the pre-existing communications channels via the comms protocol
in use which is normally TDS (tabular data stream) over TCP/IP.
Whats more, if you call a COM interface it really should be prompt -
stalling SQL Server for some external process of indefinite length falls
into the really really really bad technique category.
"DMP" <debdulal.mahapatra@.fi-tek.co.in> wrote in message
news:uKw%23dWYRFHA.244@.TK2MSFTNGP12.phx.gbl...
> Thanks to everybody,
> Basically I have three sp let sp1,sp2,sp3
> From VB I call sp1,
> sp1 call to sp2 and dpending the return value of sp2 , End user will take
> dicission that
> sp3 will be called or not like VB msgbox("do you want to continue ?",
> vbYesNo),
> If vbYes then calls to sp3 else return from sp2,sp1
> This is my goal...
> "Alex" <alex@.intralan.co.uk> wrote in message
> news:1113985604.270498.57780@.l41g2000cwc.googlegroups.com...
>sql