Home Home    Forum    Blog    Feed your aggregator (RSS 2.0)

The Johnnynine Weblog - Thursday, March 16, 2006
A weblog by Johnny Hughes
 
 Thursday, March 16, 2006

Here is the sql to view the indexes on an oracle table.  Just replace MYTABLENAME with yout table name:

select index_name, column_name, column_position from user_ind_columns
where table_name='MYTABLENAME' order by index_name, column_position

Thursday, March 16, 2006 11:35:49 PM (US Mountain Standard Time, UTC-07:00)  #    Comments [1]   Database | Oracle | Technical  | 
 Tuesday, February 14, 2006

Microsft SQL Server 2005 does not include the Service Manager system tray application, but a 3rd party application is to the rescue.

This works great for a developer's workstation running SQL Server 2005 where you may not want the database running all the time.

Wednesday, February 15, 2006 6:22:42 AM (US Mountain Standard Time, UTC-07:00)  #    Comments [0]   Database | Sql Server  | 
 Monday, November 07, 2005

Although an Oracle DSN supports timeouts (which can be disabled via a checkbox), creating a DSN-less connection in VB6 will not respect any settings for the Connection.ConnectionTimeout or Command.CommandTimeout settings.  It just ignores them and your application will sit and wait until the request is done.

See MDSN article ID: 251248

http://support.microsoft.com/default.aspx?scid=kb;en-us;251248


The Microsoft Oracle ODBC driver and Microsoft OLE DB Provider for Oracle do not support setting connection timeouts or query timeouts.

There is no workaround to allow setting a query timeout.

For connection timeouts you can work around the issue, if your database application framework supports asynchronous operations. By putting the call to open the connection in an asynchronous loop and checking the status of the connection, you can terminate the connection if it does not occur in the stated duration of time. The implementation of this solution is application-dependent, but an example using ActiveX Data Objects (ADO) is shown in the "More Information" section of this article.
Monday, November 07, 2005 6:52:26 PM (US Mountain Standard Time, UTC-07:00)  #    Comments [0]   Database | Oracle | Technical  | 
 Monday, October 10, 2005


DECLARE @TruncateStatement nvarchar(2000)
DECLARE TruncateStatements CURSOR LOCAL FAST_FORWARD
FOR SELECT N'TRUNCATE TABLE ' +
   QUOTENAME(TABLE_SCHEMA) +
   N'.' + QUOTENAME(TABLE_NAME)
FROM
   INFORMATION_SCHEMA.TABLES
WHERE
   TABLE_TYPE = 'BASE TABLE' AND
   OBJECTPROPERTY(OBJECT_ID(QUOTENAME(TABLE_SCHEMA) +
   N'.' + QUOTENAME(TABLE_NAME)), 'IsMSShipped') = 0
OPEN TruncateStatements
FETCH NEXT FROM TruncateStatements INTO @TruncateStatement
WHILE @@FETCH_STATUS = 0
BEGIN
   FETCH NEXT FROM TruncateStatements INTO @TruncateStatement
   EXEC(@TruncateStatement)
END
-- Clean up work
CLOSE TruncateStatements
DEALLOCATE TruncateStatements


Since this script doesn't take parent-child relationships into consideration it may have to be run more than once if you have any set up.

Again, I like to give credit where credit is due, but I don't have an original source for this code.  Searching on keywords in it will reveal several web pages with it posted.
Monday, October 10, 2005 7:49:56 PM (US Mountain Standard Time, UTC-07:00)  #    Comments [0]   Database | Sql Server  | 
 Tuesday, September 06, 2005

You can not rename a SQL Server database from Enterprise Manager, but you can with the sp_renamedb stored procedure.  You must first set the database to singe user.

1. Set the database to Single User by right clicking the database in Enterprise Manager, select Properties, select the Options Tab, check the Restrict Access checkbox, and select Read-Only, then click OK.
2. Close Enterprise Manager (since we can only have 1 user accessing it at a time now).
3. Open Query Analyser.
4. Type:  sp_renamedb <oldname>, <newname>
5. Don't forget to reset the Restrict Access settings on the database that you changed in step 2.

Tuesday, September 06, 2005 5:31:19 PM (US Mountain Standard Time, UTC-07:00)  #    Comments [5]   Database | Sql Server  | 
Copyright © 2009 Johnny Hughes. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.