Did Microsoft enhance Declarative Referential Integrity (DRI) support in SQL Server 2000?
Microsoft hinted several years ago that it would support cascading DRI and disappointed many people when that feature didn't make SQL Server 7.0. With SQL Server 2000, however, the wait is over. SQL Server 2000 supports cascading DRI, a feature that Microsoft Access users have enjoyed for years. What's the difference between previous SQL Server versions' restrictive DRI and cascading DRI? Let's say you have the classic parent-to-child (one-to-many) relationship of customers and orders. Restrictive DRI prevents deletion of a customer with active orders, whereas cascading DRI assumes you know what you're doing and simply deletes the related orders when you delete a customer.
SQL Server 2000's SQL-92 syntax for the CREATE TABLE command supports cascading actions on updates and deletes:
CREATE TABLE mytable
(mycol1 character (30) NOT NULL,
--more column names, data types go here
CONSTRAINT mytable_pk PRIMARY KEY (mytableID)
--note syntax to designate primary key
--column
--naming the constraint is optional
CONSTRAINT mytable_fk FOREIGN KEY (mytableID)
REFERENCES mydependent_table,
ON DELETE|UPDATE CASCADE)
You can implement cascading deletes in SQL Server 7.0 and earlier by writing code or suitable update and delete triggers.
Have you ever needed to connect to a SQL Server running on a different TCP/IP port (the default is 1433), only to discover that you didn't have the SQL Server Client Configuration Utility installed on your systems?
Been there; done that. As you know, changing the default client-side network library (NetLib) is easy if you have the SQL Server Client Configuration Utility. But if this tool isn't on your system, changing the default setting can be difficult.
You can attack this problem three different ways. You can install the SQL Server client tools on your machine, hack the Registry, or use code to set the NetLib information within your application or within the Data Source Name (DSN) or Universal Data Link (UDL) your application uses. Installing the tools is, of course, too simple and obvious a solution, so let's look at the other two solutions.
You can find the default NetLib information in a value called DSQUERY in the following Registry key: KKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo. (Note that Registry key settings and names might change between SQL Server releases. This answer addresses SQL Server 7.0 Registry key settings and names. SQL Server 2000 NetLibs may change by the final release.) If the DSQUERY value isn't in the Registry key, simply add it with a type of REG_SZ. Also, make sure you back up your Registry before you start fiddling with these values. The correct DLL NetLib names are
dbmssocnWin32 Winsock TCP/IP
dbmsspxnWin32 SPX/IPX
dbmsrpcnWin32 Multi-Protocol
(Windows RPC)
dbmsvinnWin32 Banyan VINES
dbnmpntwWin32 Named Pipes
Prev. page  
[1]
2
next page