SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Tracking the Inserts,Updates to Table
 New Topic  Reply to Topic
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 6

whitefang
Enterprise-Level Plonker Who's Not Wrong

272 Posts

Posted - 04/21/2009 :  11:57:17  Show Profile  Reply with Quote
quote:
Originally posted by Peso

And your data analysis is still being done with your application object?
And the proper UPSERT is still being done with your application object?

Oh man, those network roundtrips.



E 12°55'05.63"
N 56°04'39.26"




TSQL doesn't support upserts but we can package the check, insert, and update into a batch statement from the application object.

At what point are you going to realize that the DB and the AppServer are located in the same datacenter and have massive amounts of bandwidth and very low latencies between them? Network roundtrips are costly if you are using CISCO routers from 1980s.
Go to Top of Page

spirit1
Cybernetic Yak Master

Slovenia
11751 Posts

Posted - 04/21/2009 :  11:59:20  Show Profile  Visit spirit1's Homepage  Reply with Quote
no, not better nor more intelligent, just different way of doing things.


___________________________________________________________________________
Causing trouble since 1980
Blog: http://weblogs.sqlteam.com/mladenp
Speed up SSMS development: www.ssmstoolspack.com <- version 1.5 out!
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
30282 Posts

Posted - 04/21/2009 :  12:03:35  Show Profile  Visit SwePeso's Homepage  Reply with Quote
What are you so afraid of?
quote:
Originally posted by whitefang

I'm not wrong.

I have never said nor written that everything should be done on DB side. You're dead wrong with that argument. Again.
Most of the things you talk about I think should be done DB side.

Heavy duty things like file import should be done DB side.
Data cleansing and rinsing should be done DB side.

Why? Beacuse the database server is made for serving you (the client) with the proper data depending on what you want.
If you think a database is only storage, why don't you use textfiles as storage in your enterprise application?
Why only use the database for half the capacity? Release the database's full potential, deliver data to you.
And use database server to handle the external imports. Distribute the load from your application object.

Then the business logic can be handled in your application object.
You can also look at it this way. Where should xyz be handled for most performance for the customer?
After all, it is the customer who ultimately pays your salary.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

robvolk
Most Valuable Yak

USA
15688 Posts

Posted - 04/21/2009 :  12:05:12  Show Profile  Visit robvolk's Homepage  Reply with Quote
quote:
So you are doing 50 million records inserts with FULL logging AND recovery model in 12 minutes? Your database must be running on the IBM Roadrunner supercomputer.
I do this all the time on a 3 year old DL 585, although it's bulk-logged. I do a number of 100 million row inserts in about 20-25 minutes. The new DL 585 does 100 million rows in under 15 minutes.

Then there's always SSIS:

http://msdn.microsoft.com/en-us/library/dd537533.aspx
quote:
I'm not wrong. I have a different way of doings things, the better intelligent way.
Yeah, call us back about that when your way can load 1 TB in under 30 minutes.
Go to Top of Page

robvolk
Most Valuable Yak

USA
15688 Posts

Posted - 04/21/2009 :  12:06:34  Show Profile  Visit robvolk's Homepage  Reply with Quote
quote:
TSQL doesn't support upserts...
It's called the MERGE statement, it's new in SQL 2008.
Go to Top of Page

whitefang
Enterprise-Level Plonker Who's Not Wrong

272 Posts

Posted - 04/21/2009 :  12:08:09  Show Profile  Reply with Quote
That is my point, I've always said a database should be a database and used for CRUD only that includes imports. You're the one polluting with SPs containing business logic and unnecessary crap. I've always said business logic should be handled by application object which you always disagree on.

There's several ways to do imports, I prefer using the application layer to do the import. It's my way, and I find it better for my applications.
Go to Top of Page

whitefang
Enterprise-Level Plonker Who's Not Wrong

272 Posts

Posted - 04/21/2009 :  12:11:29  Show Profile  Reply with Quote
Anyways, the topic poster got several solutions and chose to implement mine, argument closed.
Go to Top of Page

cat_jesus
Aged Yak Warrior

547 Posts

Posted - 04/21/2009 :  12:23:23  Show Profile  Reply with Quote
quote:
Originally posted by whitefang


TSQL doesn't support upserts



I guess I better stop implementing upserts then.




__________________________________________

An infinite universe is the ultimate cartesian product.
Go to Top of Page

blindman
Flowing Fount of Yak Knowledge

USA
2365 Posts

Posted - 04/21/2009 :  12:45:29  Show Profile  Reply with Quote
quote:
Originally posted by whitefang

Triggers are bad for debugging (in a properly written application, triggers are not needed. It's just a tool for lazy developers/dbas)


A totally ignorant statement. Do you have any knowledge you haven't picked up reading other developer's blogs?

quote:
Originally posted by dineshrajan_it

I have 120 tables so using trigger for all 120 tables will be i dont know?


Not a problem.
Run the code in the link below, and it will generate a script for creating all your archive tables and all the necessary triggers to maintain them. Total time for your DB, probably under 15 minutes.
http://sqlblindman.pastebin.com/f3b20af45

________________________________________________
If it is not practically useful, then it is practically useless.
________________________________________________
Go to Top of Page

DonAtWork
Flowing Fount of Yak Knowledge

2165 Posts

Posted - 04/21/2009 :  12:52:08  Show Profile  Reply with Quote
Not a bad little script for an entry level DBA there blindman. Too bad those triggers are not needed, you lazy entry level DBA.

[Signature]For fast help, follow this link:
http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx
Learn SQL or How to sell Used Cars
For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page

whitefang
Enterprise-Level Plonker Who's Not Wrong

272 Posts

Posted - 04/21/2009 :  12:58:16  Show Profile  Reply with Quote
O'Reilly Oracle performance Tuning: Disadvantages of Triggers
http://books.google.com/books?id=1Fnf7C4JGsIC&pg=PA227&lpg=PA227&dq=disadvantages+of+triggers+oracle&source=bl&ots=U0q7xz0ogR&sig=ShuY_LzZ6G14JH1Vp-jjCjXkfNQ&hl=en&ei=jfrtSbn9M5yMtgfn6bnBDw&sa=X&oi=book_result&ct=result&resnum=7#PPA230,M1

I guess the book is a "developer blog" and is pretty much worthless according to you. As you can see, it makes debugging very complicated and bug prone.

Edited by - whitefang on 04/21/2009 12:59:15
Go to Top of Page

robvolk
Most Valuable Yak

USA
15688 Posts

Posted - 04/21/2009 :  13:02:58  Show Profile  Visit robvolk's Homepage  Reply with Quote
quote:
O'Reilly Oracle performance Tuning: Disadvantages of Triggers
http://books.google.com/books?id=1Fnf7C4JGsIC&pg=PA227&lpg=PA227&dq=disadvantages+of+triggers+oracle&source=bl&ots=U0q7xz0ogR&sig=ShuY_LzZ6G14JH1Vp-jjCjXkfNQ&hl=en&ei=jfrtSbn9M5yMtgfn6bnBDw&sa=X&oi=book_result&ct=result&resnum=7#PPA230,M1
Yeah, Oracle advice on SQL Server always works.

Tell me whitefang, do you think before you type? Or do you have some ORM code generator do it for you?
Go to Top of Page

whitefang
Enterprise-Level Plonker Who's Not Wrong

272 Posts

Posted - 04/21/2009 :  13:06:27  Show Profile  Reply with Quote
quote:
Originally posted by robvolk

quote:
O'Reilly Oracle performance Tuning: Disadvantages of Triggers
http://books.google.com/books?id=1Fnf7C4JGsIC&pg=PA227&lpg=PA227&dq=disadvantages+of+triggers+oracle&source=bl&ots=U0q7xz0ogR&sig=ShuY_LzZ6G14JH1Vp-jjCjXkfNQ&hl=en&ei=jfrtSbn9M5yMtgfn6bnBDw&sa=X&oi=book_result&ct=result&resnum=7#PPA230,M1
Yeah, Oracle advice on SQL Server always works.

Tell me whitefang, do you think before you type? Or do you have some ORM code generator do it for you?



If you read the article, you would know that it would apply to triggers in both MS SQL and Oracle. The problems it outlines are present in MS SQL, not only in Oracle.
You must have a intelligence level of NULL.
Go to Top of Page

cat_jesus
Aged Yak Warrior

547 Posts

Posted - 04/21/2009 :  13:15:44  Show Profile  Reply with Quote
quote:
Originally posted by whitefang

If you read the article, you would know that it would apply to triggers in both MS SQL and Oracle. The problems it outlines are present in MS SQL, not only in Oracle.
You must have a intelligence level of NULL.



That book is 15 years old.

Why would he take advice for caveman 90's databases?



_____________________________________________

An infinite universe is the ultimate cartesian product.
Go to Top of Page

whitefang
Enterprise-Level Plonker Who's Not Wrong

272 Posts

Posted - 04/21/2009 :  13:17:38  Show Profile  Reply with Quote
quote:
Originally posted by cat_jesus

quote:
Originally posted by whitefang

If you read the article, you would know that it would apply to triggers in both MS SQL and Oracle. The problems it outlines are present in MS SQL, not only in Oracle.
You must have a intelligence level of NULL.



That book is 15 years old.

Why would he take advice for caveman 90's databases?



_____________________________________________

An infinite universe is the ultimate cartesian product.



Yes, but the problems it outlines are still present today.
Go to Top of Page

blindman
Flowing Fount of Yak Knowledge

USA
2365 Posts

Posted - 04/21/2009 :  13:20:12  Show Profile  Reply with Quote
quote:
Originally posted by DonAtWork

Not a bad little script for an entry level DBA there blindman. Too bad those triggers are not needed, you lazy entry level DBA.


It was for an extra-credit assignment back in kindergarten. ;)

Can I get a "Lazy DBA" as my sqlteam title????

________________________________________________
If it is not practically useful, then it is practically useless.
________________________________________________
Go to Top of Page

cat_jesus
Aged Yak Warrior

547 Posts

Posted - 04/21/2009 :  13:26:51  Show Profile  Reply with Quote
quote:
Originally posted by whitefang

Yes, but the problems it outlines are still present today.




Really? Which problems are those exactly?



_____________________________________________________________

An infinite universe is the ultimate cartesian product.
Go to Top of Page

whitefang
Enterprise-Level Plonker Who's Not Wrong

272 Posts

Posted - 04/21/2009 :  13:30:21  Show Profile  Reply with Quote
Also, a SQL Server MVP's post on Triggers and why it causes problems
http://blog.sqlauthority.com/2007/05/24/sql-server-disadvantages-problems-of-triggers/

Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
30282 Posts

Posted - 04/21/2009 :  13:31:28  Show Profile  Visit SwePeso's Homepage  Reply with Quote
quote:
Originally posted by whitefang

If you read the article, you would know that it would apply to triggers in both MS SQL and Oracle.
And triggers are implemented the exact same way with both vendors?
Just a all cars a exact matches of eachother? Diesel, V6, wankel; they are all the same?


E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

whitefang
Enterprise-Level Plonker Who's Not Wrong

272 Posts

Posted - 04/21/2009 :  13:35:01  Show Profile  Reply with Quote
quote:
Originally posted by Peso

quote:
Originally posted by whitefang

If you read the article, you would know that it would apply to triggers in both MS SQL and Oracle.
And triggers are implemented the exact same way with both vendors?
Just a all cars a exact matches of eachother? Diesel, V6, wankel; they are all the same?


E 12°55'05.63"
N 56°04'39.26"




They both have the same problems, read the article above (directly from a MS SQL MVP, that guy has a lot of authority and credit) instead of anecdotal crap.

Edited by - whitefang on 04/21/2009 13:36:39
Go to Top of Page
Page: of 6 Previous Topic Topic Next Topic  
Previous Page | Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.17 seconds. Powered By: Snitz Forums 2000