Friday, March 9, 2012
How know when one Table was droped? HELP-ME
I have one Data Base,
Today one strange thing occur, one table of my data base disappear , I didnt
drop it, then i would like know if have way to determine when this occur;
The last week same thing occur whit one store procedure.
Any one knows, how to help-me.
I use SQL Server 2005 SP1
Thanks to allIn SQL Server 2005 you can use DDL Triggers. Using these triggers you can
record the time the object was deleted, the login and user name used to
delete the object and the command executed, among other things.
See BOL for more information.
Ben Nevarez, MCDBA, OCP
Database Administrator
"retf" wrote:
> Hi all,
> I have one Data Base,
> Today one strange thing occur, one table of my data base disappear , I didnt
> drop it, then i would like know if have way to determine when this occur;
> The last week same thing occur whit one store procedure.
>
> Any one knows, how to help-me.
> I use SQL Server 2005 SP1
> Thanks to all
>
>
>|||Hi
It sounds like you may need to review your security settings and who has
access to this system! If this is a development system then you should also
be keeping code in a version control system.
John
"retf" wrote:
> Hi all,
> I have one Data Base,
> Today one strange thing occur, one table of my data base disappear , I didnt
> drop it, then i would like know if have way to determine when this occur;
> The last week same thing occur whit one store procedure.
>
> Any one knows, how to help-me.
> I use SQL Server 2005 SP1
> Thanks to all
>
>
>
How know when one Table was droped? HELP-ME
I have one Data Base,
Today one strange thing occur, one table of my data base disappear , I didnt
drop it, then i would like know if have way to determine when this occur;
The last week same thing occur whit one store procedure.
Any one knows, how to help-me.
I use SQL Server 2005 SP1
Thanks to all"retf" <re.tf@.terra.com.br> wrote in message
news:eZ59$B5eGHA.2076@.TK2MSFTNGP04.phx.gbl...
> Hi all,
> I have one Data Base,
> Today one strange thing occur, one table of my data base disappear , I
> didnt
> drop it, then i would like know if have way to determine when this occur;
> The last week same thing occur whit one store procedure.
>
> Any one knows, how to help-me.
> I use SQL Server 2005 SP1
>
Look at the schema change history report in Management Studio.
David|||Where I find this?
Thanks for the help.
"David Browne" <davidbaxterbrowne no potted meat@.hotmail.com> escreveu na
mensagem news:%23k73bO5eGHA.1260@.TK2MSFTNGP05.phx.gbl...
> "retf" <re.tf@.terra.com.br> wrote in message
> news:eZ59$B5eGHA.2076@.TK2MSFTNGP04.phx.gbl...
>> Hi all,
>> I have one Data Base,
>> Today one strange thing occur, one table of my data base disappear , I
>> didnt
>> drop it, then i would like know if have way to determine when this
>> occur;
>> The last week same thing occur whit one store procedure.
>>
>> Any one knows, how to help-me.
>> I use SQL Server 2005 SP1
>
> Look at the schema change history report in Management Studio.
> David
>|||SS Management Studio, Summary Tab, Report, Schema Changes History.
Ben Nevarez, MCDBA, OCP
Database Administrator
"retf" wrote:
> Where I find this?
> Thanks for the help.
> "David Browne" <davidbaxterbrowne no potted meat@.hotmail.com> escreveu na
> mensagem news:%23k73bO5eGHA.1260@.TK2MSFTNGP05.phx.gbl...
> >
> > "retf" <re.tf@.terra.com.br> wrote in message
> > news:eZ59$B5eGHA.2076@.TK2MSFTNGP04.phx.gbl...
> >> Hi all,
> >>
> >> I have one Data Base,
> >>
> >> Today one strange thing occur, one table of my data base disappear , I
> >> didnt
> >> drop it, then i would like know if have way to determine when this
> >> occur;
> >>
> >> The last week same thing occur whit one store procedure.
> >>
> >>
> >> Any one knows, how to help-me.
> >>
> >> I use SQL Server 2005 SP1
> >>
> >
> >
> > Look at the schema change history report in Management Studio.
> >
> > David
> >
>
>|||Hi,
Thank you very much...:o) :o) :o) :o)
"Ben Nevarez" <bnevarez@.sjm.com> escreveu na mensagem
news:54A60353-0816-4335-839F-50D6682BFFB4@.microsoft.com...
> SS Management Studio, Summary Tab, Report, Schema Changes History.
> Ben Nevarez, MCDBA, OCP
> Database Administrator
>
> "retf" wrote:
>> Where I find this?
>> Thanks for the help.
>> "David Browne" <davidbaxterbrowne no potted meat@.hotmail.com> escreveu na
>> mensagem news:%23k73bO5eGHA.1260@.TK2MSFTNGP05.phx.gbl...
>> >
>> > "retf" <re.tf@.terra.com.br> wrote in message
>> > news:eZ59$B5eGHA.2076@.TK2MSFTNGP04.phx.gbl...
>> >> Hi all,
>> >>
>> >> I have one Data Base,
>> >>
>> >> Today one strange thing occur, one table of my data base disappear , I
>> >> didnt
>> >> drop it, then i would like know if have way to determine when this
>> >> occur;
>> >>
>> >> The last week same thing occur whit one store procedure.
>> >>
>> >>
>> >> Any one knows, how to help-me.
>> >>
>> >> I use SQL Server 2005 SP1
>> >>
>> >
>> >
>> > Look at the schema change history report in Management Studio.
>> >
>> > David
>> >
>>
How know when one Table was droped? HELP-ME
I have one Data Base,
Today one strange thing occur, one table of my data base disappear , I didnt
drop it, then i would like know if have way to determine when this occur;
The last w
Any one knows, how to help-me.
I use SQL Server 2005 SP1
Thanks to allyou can have a DDL trigger defined for DROP objects.. Don't know the exact
syntax..
you can check the BOL..
In this DDL trigger you can select the event details and insert it to a
table.|||You can DDL trigger for logging and Event Notification in S2K5.
"Retf"?? ??? ??:
> Hi all,
> I have one Data Base,
> Today one strange thing occur, one table of my data base disappear , I did
nt
> drop it, then i would like know if have way to determine when this occur;
> The last w
>
> Any one knows, how to help-me.
> I use SQL Server 2005 SP1
> Thanks to all
>
>|||SQL Server 2005 has an always running trace - called "default trace". All ob
ject drop/alter/creation is audited (among other things). It keeps the histo
ry in up to 5 separate trace files with a limit of 20 MB per file. Since on
every SQL server restart a
new file is created the history is limited also by the last 5 SQL Server res
tarts. Here is how to get the information (assuming you have the default fil
e layout):
SELECT * FROM fn_trace_gettable
('C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\log.trc', default)
If you have lots of trace files under your LOG folder, find the last bunch o
f continuous file numbers and use the first file number. For instance if you
see log_154.trc, log_155.trc, log_156.trc, log_157.trc, use:
SELECT * FROM fn_trace_gettable
('C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\log_154.trc', defa
ult)
Thanks,
-Ivan
--Original Message--
From: hongjujung
Posted At: Friday, May 19, 2006 10:21 PM
Posted To: microsoft.public.sqlserver.programming
Conversation: How know when one Table was droped? HELP-ME
Subject: RE: How know when one Table was droped? HELP-ME
You can DDL trigger for logging and Event Notification in S2K5.
"Retf"?? ??? ??:
> Hi all,
> I have one Data Base,
> Today one strange thing occur, one table of my data base disappear , I
> didnt drop it, then i would like know if have way to determine when
> this occur;
> The last w
>
> Any one knows, how to help-me.
> I use SQL Server 2005 SP1
> Thanks to all
>
>
How know when one Table was droped? HELP-ME
I have one Data Base,
Today one strange thing occur, one table of my data base disappear , I didnt
drop it, then i would like know if have way to determine when this occur;
The last week same thing occur whit one store procedure.
Any one knows, how to help-me.
I use SQL Server 2005 SP1
Thanks to all"retf" <re.tf@.terra.com.br> wrote in message
news:eZ59$B5eGHA.2076@.TK2MSFTNGP04.phx.gbl...
> Hi all,
> I have one Data Base,
> Today one strange thing occur, one table of my data base disappear , I
> didnt
> drop it, then i would like know if have way to determine when this occur;
> The last week same thing occur whit one store procedure.
>
> Any one knows, how to help-me.
> I use SQL Server 2005 SP1
>
Look at the schema change history report in Management Studio.
David|||Where I find this?
Thanks for the help.
"David Browne" <davidbaxterbrowne no potted meat@.hotmail.com> escreveu na
mensagem news:%23k73bO5eGHA.1260@.TK2MSFTNGP05.phx.gbl...
> "retf" <re.tf@.terra.com.br> wrote in message
> news:eZ59$B5eGHA.2076@.TK2MSFTNGP04.phx.gbl...
>
> Look at the schema change history report in Management Studio.
> David
>|||SS Management Studio, Summary Tab, Report, Schema Changes History.
Ben Nevarez, MCDBA, OCP
Database Administrator
"retf" wrote:
> Where I find this?
> Thanks for the help.
> "David Browne" <davidbaxterbrowne no potted meat@.hotmail.com> escreveu na
> mensagem news:%23k73bO5eGHA.1260@.TK2MSFTNGP05.phx.gbl...
>
>|||Hi,
Thank you very much...:o) :o) :o) :o)
"Ben Nevarez" <bnevarez@.sjm.com> escreveu na mensagem
news:54A60353-0816-4335-839F-50D6682BFFB4@.microsoft.com...[vbcol=seagreen]
> SS Management Studio, Summary Tab, Report, Schema Changes History.
> Ben Nevarez, MCDBA, OCP
> Database Administrator
>
> "retf" wrote:
>
How know when one Table was droped? HELP-ME
I have one Data Base,
Today one strange thing occur, one table of my data base disappear , I didnt
drop it, then i would like know if have way to determine when this occur;
The last week same thing occur whit one store procedure.
Any one knows, how to help-me.
I use SQL Server 2005 SP1
Thanks to allIn SQL Server 2005 you can use DDL Triggers. Using these triggers you can
record the time the object was deleted, the login and user name used to
delete the object and the command executed, among other things.
See BOL for more information.
Ben Nevarez, MCDBA, OCP
Database Administrator
"retf" wrote:
> Hi all,
> I have one Data Base,
> Today one strange thing occur, one table of my data base disappear , I did
nt
> drop it, then i would like know if have way to determine when this occur;
> The last week same thing occur whit one store procedure.
>
> Any one knows, how to help-me.
> I use SQL Server 2005 SP1
> Thanks to all
>
>
>|||Hi
It sounds like you may need to review your security settings and who has
access to this system! If this is a development system then you should also
be keeping code in a version control system.
John
"retf" wrote:
> Hi all,
> I have one Data Base,
> Today one strange thing occur, one table of my data base disappear , I did
nt
> drop it, then i would like know if have way to determine when this occur;
> The last week same thing occur whit one store procedure.
>
> Any one knows, how to help-me.
> I use SQL Server 2005 SP1
> Thanks to all
>
>
>
Friday, February 24, 2012
How I can use SqlDataReader?
Hi..
Every time I want to read any record from data base I read it in dataset for example:
SqlConnection con =newSqlConnection(@."Data Source=localhost ;Initial Catalog=university ;Integrated Security=True");SqlCommand cmd =newSqlCommand("select [User_AuthorityID] from users where [UserID]='" + TextBox1.Text +"' and [UserPassword]='" + TextBox2.Text +"' ", con);
SqlDataAdapter adp =newSqlDataAdapter();adp.SelectCommand = cmd;
DataSet ds =newDataSet();adp.Fill(ds,"UserID");
foreach (DataRow drin ds.Tables["UserID"].Rows){
user_type = dr[0].ToString();
Session.Add("User_AuthorityID", user_type);
.......
Is there easier way to read data from data base?
How I can use SqlDataReader to do that?
Thanks..
it looks like your returning a single value:
SqlConnection con =newSqlConnection(@."Data Source=localhost ;Initial Catalog=university ;Integrated Security=True");SqlCommand cmd =newSqlCommand("select [User_AuthorityID] from users where [UserID]='" + TextBox1.Text +"' and [UserPassword]='" + TextBox2.Text +"' ", con);
string value = cmd.ExecuteScalar().ToString();
or
SqlConnection con =newSqlConnection(@."Data Source=localhost ;Initial Catalog=university ;Integrated Security=True");
SqlCommand cmd =newSqlCommand("select [User_AuthorityID] from users where [UserID]='" + TextBox1.Text +"' and [UserPassword]='" + TextBox2.Text +"' ", con);
Session.Add("User_AuthorityID",cmd.ExecuteScalar().ToString(), ;
|||Example data reader:
SqlConnection con =newSqlConnection(@."Data Source=localhost ;Initial Catalog=university ;Integrated Security=True");SqlCommand cmd =newSqlCommand("select [User_AuthorityID] from users where [UserID]='" + TextBox1.Text +"' and [UserPassword]='" + TextBox2.Text +"' ", con);
SqlDataReader reader = cmd.ExecuteReader();string value =string.Empty;
while (reader.Read()){
value = reader["User_AuthorityID"].ToString();}
Session.Add("User_AuthorityID", value);
|||
Thanks for that but what should I use if I have more than one value reture from the query?
|||
You can go ahead with the above approach suggested by David.
manal.m.k:
what should I use if I have more than one value reture from the query?
This is pretty straight forward. In the post the while loop goes through all the rows that are returned from the query in your reader. The below example can fetch the column values for each column returned in a row.
while (reader.Read()){ value1 = reader["column1"].ToString(); value2 = reader["column2"].ToString(); . . . valueN = reader["columnN"].ToString();}
How I can make trigger to Add Row 4 to my data base?
Hi
I need help about this problem
I have a data grid view like this:
Index
Code(releted to other table)
Name
Price +
Price _
1
1
BMW X5
1000000 $
2
1
BMW X3
500000 $
3
1
BMW Z3
250000 $
4
1
SUM
1750000 $
Row 4 must add by code automatically.
How? I must Use trigger or . . .?
my user may want to edit the data (some row OR price) I have a Problem.
How I can make a Code for Make SUM add row 4 and Delete this row when it loaded to edit? (Select and delete)
Or I can do some thing better than delete the row and write it again?
This doesn't seem like a SQL Server problem. If you do not want to persist the results in the backend you should do it in the client-side and add the extra row to the DataGrid from code. You should post this question in the Visual Studio or .NET Framework newsgroups.Sunday, February 19, 2012
How I can calculate the % in the matix's details base on the matix's subtotal?
Region1 Region2 Total
duration % duration % duration %
call1 10 10 90 90 100 100
call2 10 10 90 90 100 100
How I can calculate the %, I need to know the total duration!
Nobody can help me?
abc_abc
Do the following
Divide each column in the matrix by the row total and multiply by hundred. Dividing by the row total is a matter of scope. If you go to the edit group properties in you row group, you can see the name of your row scope. So simply divide the current row,col value by Sum(fieldname,rowscope). Remeber to change all your results to a string and concatentate them. i.e. row val.ToString() + " " + computed percentage.ToString().
I am assuming, that u have a single matrix.
Umer
|||Yes I have a single matrix, but it doesn't work... I m sure I'm in wrong in something.The group Total is the same of Region1 and Region2, I used the Subtotal by right-click
I have written this expression in the matrix's detalil
=(Sum(Fields!Duration)/sum(Fields!Duration.Value,"matrix_Region"))*100
but something is wrong.
but I don't understand what!|||Now it works, thanks...
In the group'scope I used the "latest" row-groups before datails.
abc_abc