XXD
ҽ
л
ҵBlog
¹鵵...
·...
ͳ...
վ...
Դ
===========================================================
oracleֶνSQL2000еIDԶ+1ֶ
===========================================================
ַ
һ
ô

һ
create sequence a_seq increment by 1 start with 100;
һ, Զ+1
create or replace trigger your_seq_tri
before insert on your_table1 for each row
declare
next_id number;
begin
select your_seq.nextval into next_id from dual;
:new.id := next_id;
end;



һ
create sequence a_seq increment by 1 start with 100;
+1
insert into tbl(id,....)
values (a_seq.nextval,....)
xxdxxdxxd :2007.08.24 09:26 ::: ( Oracle & Open DB ) ::Ķ:(164) :: Permanent link :: (0)
===========================================================
Cannot resolve collation conflict for equal to operation
===========================================================

select * from table where id in (select in from othertable)

֣

collationSQL_Latin1_General_CP1_CI_ASSQL ServerĬChinese_PRC_CI_AS

޸othertablecollation

иϸreference

 鿴ȫ
xxdxxdxxd :2007.05.11 14:30 ::: ( SQL Server & ADO ) ::Ķ:(600) :: Permanent link :: (0)
===========================================================
Speed Up SQL Server Apps -SQL ServerӦóЧ
===========================================================

Learn 10 useful tips and tricks that help boost SQL Server application performanceand streamline development and deployment as well.

ѧϰ10õļSQL ServerӦóЧʣ򻯿Ͳby Roman Rehak, תأллԭRoman Rehak.

Developers love database programming tips, tricks, and workaroundsespecially those that slash development time or boost application performance. Here's a collection of such nuggets for developing SQL Server applications.

 鿴ȫ
xxdxxdxxd :2007.03.26 17:05 ::: ( T-SQL ) ::Ķ:(369) :: (0) :: (0)
===========================================================
Five Ways to Rev up Your SQL Performance
===========================================================
ĽѡMSDN¡ SQL ܵķ߻SQL ServerӦóЧʣdzֵƼһЩTrafficܸߵӦϵͳԣߺ͸ĽSQLָǷdzҪģҲһܺõͻƵ㡣
*ҪһЩݣȤֱӷURLĶӢĵ
 鿴ȫ
xxdxxdxxd :2007.03.26 16:53 ::: ( SQL Server & ADO ) ::Ķ:(228) :: (0) :: (0)
===========================================================
SQL SERVER C LOCKֹỰ ID/UOW û
===========================================================
KILL { session ID | UOW } [ WITH STATUSONLY ] 鿴ȫ
xxdxxdxxd :2007.03.26 16:47 ::: ( SQL Server & ADO ) ::Ķ:(370) :: (0) :: (0)
===========================================================
DBCC DBREINDEXؽSQL Server
===========================================================
SQL ServerҪݵķٶȣûSQL Server Ҫбɨȡеÿһ¼ҵҪݡԷΪͷǴͨűеݵķٶȣǴͨάеָݵ 鿴ȫ
xxdxxdxxd :2007.03.26 16:46 ::: ( SQL Server & ADO ) ::Ķ:(381) :: (0) :: (0)
===========================================================
The Effect of NOLOCK on Performance
===========================================================

Updated with an author's note

When this article was first published, it produced some lively debate. It was believed by some that the article misled readers into thinking that NOLOCK should be a tool for performance tuning, which it is not. There is a divided opinion on the appropriate use of NOLOCK, and therefore I am adding this foreword to my article in an effort to clarify matters.

NOLOCK is a query optimizer hint. It has advantages, and disadvantages, and it potentially breaks one of the fundamental rules of databases †data integrity through the use of a locking mechanism. In a nutshell, NOLOCK does not take locks on the data it reads. This provides benefits for concurrency and performance, but data integrity suffers.

I can't speak for Microsoft or the MVP's, but if Microsoft offers an ISOLATION LEVEL which does the same thing as NOLOCK, then there must be an appropriate place for the use of NOLOCK. We've discussed the advantages of NOLOCK, so let's take a look at some of the disadvantages.

Firstly, when reading with NOLOCK you are reading uncommitted data. This means the data has not been committed to the database, and could be rolled back (undone) after you have read it. So, you may find your application is processing invalid data. This is not so much of a problem with Name and Address data, but is particularity problematic with Accounts, Finance and Sales data. This is where your data integrity would suffer.

Secondly, as noted by one of the SQLServerCentral.com forum posters, Itzik Ben-Gan demonstrated to the UK SQL Server User Group that NOLOCK can return duplicate rows when reading data. To quote the forum posting: "Tony Rogerson's blog has code which demonstrates this. http://sqlblogcasts.com/blogs/tonyrogerson/archive/2006/11/16/1345.aspx ".

This article was intended as a clinical approach to the effect of NOLOCK on performance, without advocating you use NOLOCK in an attempt to speed up your queries. If you do decide to use it that way, I would like you to know the risks.

That's all I have to add, folks. I hope you read on and enjoy the article!

Cheers, Wayne Fillis

 鿴ȫ
xxdxxdxxd :2007.03.26 16:43 ::: ( SQL Server & ADO ) ::Ķ:(409) :: (0) :: (0)
===========================================================
The SQL Server 2005 XML Temptress
===========================================================
I am neither a big fan of XML nor an expert. Over the years I have seen XML used and abused yet another silver bullet to solve all of our problems. I have seen XML fail on many projects because it is too verbose - consuming too much bandwidth and processing power where good ol' fixed-length records would have been fine. I have also seen XML as a good solution to interfacing problems and I (almost) unknowingly use it every day interfacing with web services and configuring systems.

Although XML is interesting, I never found the motivation or need to go out and buy the biggest book on XML that I can find in order to master what should really be a simple markup language. XML gets complicated fast and before you know it you are either confused or an XML bigot (where your confusion is hidden behind a veneer of expertise). 鿴ȫ
xxdxxdxxd :2007.03.26 16:39 ::: ( SQL Server & ADO ) ::Ķ:(387) :: (0) :: (0)
===========================================================
Locking
===========================================================
Microsoft® SQL Server™ 2000 uses locking to ensure transactional integrity and database consistency. Locking prevents users from reading data being changed by other users, and prevents multiple users from changing the same data at the same time. If locking is not used, data within the database may become logically incorrect, and queries executed against that data may produce unexpected results.

Although SQL Server enforces locking automatically, you can design applications that are more efficient by understanding and customizing locking in your applications.

 鿴ȫ
xxdxxdxxd :2007.03.23 12:28 ::: ( SQL Server & ADO ) ::Ķ:(239) :: (0) :: (0)
===========================================================
sp_lock
===========================================================
Transact-SQL Reference
sp_lock

Reports information about locks.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_sp_la-lz_6cdn.asp

 鿴ȫ
xxdxxdxxd :2007.03.23 12:17 ::: ( SQL Server & ADO ) ::Ķ:(184) :: (0) :: (0)
===========================================================
Controlling Transactions and Locks in SQL 2000 and 2005
===========================================================

Controlling Transactions and Locks with Hints and Snapshots in SQL 2000 and 2005.

Locks

Locks are the mechanism databases use to control problems that may arise from simultaneous multi-user access. Some common issues locks try to manage include; what happens when two users try to change the same piece of information at the same time - who wins? Or user one tries to read data while user two is making changes on the same information, - which version of the data should user one see, changed or unchanged? Without locks, these situations may cause the data or results of a query to be logically incorrect. Lock sophistication is a key difference between simple databases designed for single user applications and enterprise databases capable of simultaneously handling large volumes of multi-user actions. Locks are automatically created and managed by both Microsoft SQL 2000 and SQL 2005, but there are cases when a developer or DBA will obtain better performance by dictating the locking behavior SQL should use. This article will introduce Transactions and Locks, as well as methods for controlling them such as using Locking Hints and Snapshots.

Before a review of locks can take place, transactions (the smallest unit of work in TSQL), must be introduced.

 鿴ȫ
xxdxxdxxd :2007.03.23 11:19 ::: ( SQL Server & ADO ) ::Ķ:(370) :: (0) :: (0)
===========================================================
Oracle T-SQL
===========================================================
1. ĵȴ


select event,sum(decode(wait_Time,0,0,1)) "Prev",


sum(decode(wait_Time,0,1,0)) "Curr",count(*) "Tot"


from v$session_Wait


group by event order by 4;
 鿴ȫ
xxdxxdxxd :2007.03.20 18:23 ::: ( Oracle & Open DB ) ::Ķ:(102) :: (0) :: (0)
===========================================================
SQL ServerĴ
===========================================================
http://www.ixpub.net/644838.html
xxdxxdxxd :2007.03.20 17:35 ::: ( SQL Server & ADO ) ::Ķ:(118) :: (0) :: (0)
===========================================================
ASPʵַҳʾ
===========================================================
΢ASPϵУADOĽʹôҳݿΪһ £رADORecordsetʹÿݵʾΪ㡢ɡVisual InterDev6.0(¼VI6.0)УScript Object Model¼SOMDesign-Time Control(¼DTC)ԼData Environment Object Model(¼DEOM)ȶģ͵룬ʹҳݿķԵøΪ㡣

Ϊⷽԭ򣬹ݿӣֻͼҪעͣصRecordset󣨻ؼʵݼ¼ķҳʾ档 ҵ⣬ҳʾĹؼڶADORecordsetDTCʱؼRecordsetؼԺͷϡ
 鿴ȫ
xxdxxdxxd :2007.03.16 18:36 ::: ( .NET ) ::Ķ:(89) :: (0) :: (0)
===========================================================
Oracle 10gͨӵ
===========================================================

Oracle 10gУData Pumpĵ빦ܴݿʵֱӵ룬Ҳɽļ

һǶһݿӶʶԴݿ⣬ṩ¼ʸ֤磬Զ̵һԴݿͨOracleRSVRʶͨ RUSERRPSWDе¼ȨҪݣCREATE DATABASE LINK:

CREATE DATABASE LINK dblink
CONNECT TO ruser IDENTIFIED BY rpswd
USING 'RSVR';

Data PumpimpdpʹøݿֱӷԶݡвNETWORK_LINK ͨݿָԴݿ⡣ûLUSER룺LPSWD

impdp luser/lpswd TABLES=customers,sales DIRECTORY=dpump1
NETWORK_LINK=dblink

Ҫѯͨӵ⣬ɲοOracleļеOracle Database 10g Utilities


xxdxxdxxd :2007.03.07 12:36 ::: ( Oracle & Open DB ) ::Ķ:(181) :: (0) :: (0)