Monday, March 26, 2012
how to trace the file activity???
It urgent, can anyone please tell me how to race
the activity which the user have done to the file. e.g.
When the user delete a record from the file, when the
user edit a record from the file and when the user add a
new record to a file from the EM.Please, help.. Thanks.
Regards
Sharon
.There are several ways. One is to add a trigger to every table you wish to
audit that keeps track of all this activity. Of coarse this doesn't help
for any activity that already happened. Another much easier way is to use a
3rd party product such as Log Explorer from www.lumigent.com to look at the
log files and see the history. Of coarse if you have already truncated the
logs you may not have the information.
Andrew J. Kelly
SQL Server MVP
"sharon" <anonymous@.discussions.microsoft.com> wrote in message
news:130a901c44390$4ac6a320$a601280a@.phx
.gbl...
> Dear all,
> It urgent, can anyone please tell me how to race
> the activity which the user have done to the file. e.g.
> When the user delete a record from the file, when the
> user edit a record from the file and when the user add a
> new record to a file from the EM.Please, help.. Thanks.
> Regards
> Sharon
>
> .
>sql
How to trace the database activity
It urgent, can anyone please tell me how to race
the activity which the user have done to the file. e.g.
When the user delete a record from the file, when the
user edit a record from the file and when the user add a
new record to a file from the EM.Please, help.. Thanks.
Regards
Sharon
Please don't post independently in multiple newsgroups. You can add the
other newsgroups in the "Newsgroups" section in the header and it will show
up in all those simultaneously as will the answers. See my reply in the
other newsgroup.
Andrew J. Kelly
SQL Server MVP
"sharon" <anonymous@.discussions.microsoft.com> wrote in message
news:1329601c44387$f1f0c2b0$a501280a@.phx.gbl...
> Dear all,
> It urgent, can anyone please tell me how to race
> the activity which the user have done to the file. e.g.
> When the user delete a record from the file, when the
> user edit a record from the file and when the user add a
> new record to a file from the EM.Please, help.. Thanks.
> Regards
> Sharon
>
Friday, March 23, 2012
How to test if record is found or not and do different things accordingly in a query
I want to do something like
if "Product_code" is Null
insert dbo.t_Shopping_cart (Product_code,Name,Price,Product_group,Quantity,Total)
select Product_code,Name,Price,Product_group,Quantity=1,Yhteensa=1
FROM dbo.t_Shopping_cart
WHERE Product_code='AHTU140213'
else
update dbo.t_Shopping_cart
set Quantity=Quantity+1
where Product_code='AHTU140213'
In short: I cant test existence of a record.
Regards
Leif
IF @.Product_codeISNULLBEGININSERT dbo.t_Shopping_cart (Product_code,Name,Price,Product_group,Quantity,Total)SELECT Product_code,Name,Price,Product_group,Quantity=1,Yhteensa=1FROM dbo.t_Shopping_cartWHERE Product_code= @.Product_CodeENDELSEBEGINUPDATE dbo.t_Shopping_cartSET Quantity=Quantity+1WHERE Product_code=@.Product_CodeEND|||
IFNOT EXISTS(SELECT *FROM dbo.t_Shopping_cartWHERE Product_code=@.Product_code)BEGININSERT dbo.t_Shopping_cart (Product_code,Name,Price,Product_group,Quantity,Total)SELECT Product_code,Name,Price,Product_group,Quantity=1,Yhteensa=1FROM dbo.t_Shopping_cartWHERE Product_code= @.Product_CodeENDELSEBEGINUPDATE dbo.t_Shopping_cartSET Quantity=Quantity+1WHERE Product_code=@.Product_CodeEND|||
This looks interesting. I will certainly try it later tonight.
A couple of short questions.
By the way, is it @.Product_code and not Product_code in "IF @.Product_codeISNULL"line.
If it is possible to write Yhteensa=1, which means total=1 by the way, why isn't this possible "Yhteensa=Price*Quantity". I tried it in Management Studio.
Many thanks
Leif
Monday, March 19, 2012
how to syncronize record via ftp?
Ihave 1 database di access 2000 built on 20 table...query and form,
users insert record easy from form.
I have Microsoft SQL Server Service Manager 7.00.623.
I have the same database in web space ...ex ...(ad esempio
ftp.tiscali.it/azienda/db/data.mdb)
how to syncronize record?
the all database is 60 mb
Access replica is ok for localhost or for a pc in lan...is not ok for
FTP...
Replica snapshot di SQL (with server distributore etc etc) is ok only for
SQL database but i have access...
Is this an Access question?
If so, please post it to microsoft.public.access.replication
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"miikii" <m_piccSPAM@.DELCAKKIOhotmail.com> wrote in message
news:42144f3e$0$6316$5fc30a8@.news.tiscali.it...
> CIAO all people...!
> Ihave 1 database di access 2000 built on 20 table...query and form,
> users insert record easy from form.
> I have Microsoft SQL Server Service Manager 7.00.623.
> I have the same database in web space ...ex ...(ad esempio
> ftp.tiscali.it/azienda/db/data.mdb)
> how to syncronize record?
> the all database is 60 mb
>
> Access replica is ok for localhost or for a pc in lan...is not ok for
> FTP...
> Replica snapshot di SQL (with server distributore etc etc) is ok only for
> SQL database but i have access...
>
>
Monday, March 12, 2012
How to suppress the group header session when no record return?
RegardsCreate tow formulae
Formula1 @.Reset having the code
Numbervar c;
whileprintingrecords;
c:=0;
Formula2 @.Count having the code
Numbervar c;
whileprintingrecords;
c:=c+1;
Place Formul1 at PageHeader and Formula2 at Details.
In the section expert of Group header write this code at suppress option
numbervar c;
if c:=0 then true|||Hi
The above solution didn't work for me. However, I think the following should work:
1) Create an additional section above the already existing section(s) in the details.
2) Move the contents of the group header to the newly created section in the details.
3) Suppress the group header.
4) Create a global variable, say @.isFirstRecordInGroup, which you set to true in the group header.
5) Suppress the newly added section in details (which now contains the previous contents of the group header) if @.isFirstRecordInGroup is false. Otherwise, if @.isFirstRecordInGroup is true, don't suppress and set @.isFirstRecordInGroup to false.
In this way, the contents that were previously placed in the group header will now be shown as part of the first detail in each group. Hence, if there are no details, nothing will be displayed.
Admittedly, this hack does not render the report more understandable for other programmers, but it should fix the problem.
Friday, February 24, 2012
how to store a record before deleting it using triggers
im new to SQL. i wanted to save a particular record before deleting it usin
g a delete trigger can anyone help me on this .. thnxIO you want to store the whole row and therefore the data you could
consider leaving the data in the table and marking the row as "deleted"
by flagging the row with a bit column as deleted. If you don=B4t want to
maintain the whole row you could do something like this:
CREATE Trigger DELTrg_SomeTable ON SomeTable
FOR DELETE
AS
BEGIN
INSERT INTO SOmeTable
SELECT * from Deleted
/*
Rather than using the asterix to Select the column and data I would
namer the columns you want to select and insert therefore lgiving you
the opputunity to fill in additional fields which are extended int he
archive (something like an audit data, who deleted what row from what
host, etc.)
*/
END
HTH, Jens Suessmeyer.
Sunday, February 19, 2012
How to stop running DTS package if my view return zero record?
Hi everyone,
I've created a DTS package runs on every day and night, but now my boss was asking if I can insert an exception code to check the view file.
So.. I need help from you guys, cause I don't know How.
This is my DTS description.
My DB will generate a view called "Calls to Add", then it will run the Transform Data Task and insert into a txt file. once it finished, it will run the Batch file. that is it.
Now My boss wants me to add a checking code between "View to Txt" procedure. If the view has no record inside, than the DTS package should stop and not run.
BUT How? Can someone please help? Thanks
Kelvin,
This is an SSIS forum (not DTS).
Sorry.
|||Not sure, and I second Rafael's comment, but can you put in a row counter against the view and test it's result?|||I did, but I don't know how to put it into a package.?
Please Help......
|||Kelvin Y wrote:
I did, but I don't know how to put it into a package.?
Please Help......
If you are using SSIS, and not DTS, you can use an Execute SQL task in the control flow to query the view and capture the row count. (select count(*) from view) Then in the control flow you can test the variable that was previously populated with the Execute SQL task for a condition of != 0, and if so, continue processing.|||
OK. here's another idea....slightly different from Phil's. Give it a shot. (using SSIS again)
The SQL task has a property "ForceExecutionResult" that you can configure using exprssions. Get the count from the view exactly like Phil explained above but instead of using a conditional split, use the value to set the exprssion to Success or Failure.
You wont be able to log an approiate error message though.
P.S: For some reason the use of the word "e x p r e s s i o n" is causing my post to be truncated. So, had to use "exprssion"
|||Thanks everyone, but I can't find the "ForceExecutionResult" property.
Can you tell me where is it?
Thanks
|||
If you dont have experience with exprssions, I'd suggest using Phil's approach.
But to answer your question, you can find the property under the "misc" category about 6th in the list.
|||Thanks everyone, it works now. Thanks for helping me out.|||Kelvin Y wrote:
Thanks everyone, it works now. Thanks for helping me out.
Please mark this thread as answered.