Interesting 'undocumented feature'

Interesting 'undocumented feature'

Post by Pyropun » Wed, 29 Dec 1999 04:00:00



Hi

When I run the following in iSQL or iSQL_w:



I get:
Msg 913, Level 22, State 2
Could not find row in Sysdatabases with database id 30. Run DBCC
CHECKTABLE on Sysdatabases.

Interestingly it works on some servers, but only if there is a DB with
id = 30.

Has anybody got an idea why and how this happens?
Ta
LXG
---------------------------------------

---------------------------------------

 
 
 

Interesting 'undocumented feature'

Post by BPMargoli » Wed, 29 Dec 1999 04:00:00


Try the following instead:





> Hi

> When I run the following in iSQL or iSQL_w:



> I get:
> Msg 913, Level 22, State 2
> Could not find row in Sysdatabases with database id 30. Run DBCC
> CHECKTABLE on Sysdatabases.

> Interestingly it works on some servers, but only if there is a DB with
> id = 30.

> Has anybody got an idea why and how this happens?
> Ta
> LXG
> ---------------------------------------

> ---------------------------------------


 
 
 

Interesting 'undocumented feature'

Post by Pyropun » Thu, 30 Dec 1999 04:00:00


Unfortunately this does not work.
It stays in the previous database.


> Try the following instead:





> > Hi

> > When I run the following in iSQL or iSQL_w:



> > I get:
> > Msg 913, Level 22, State 2
> > Could not find row in Sysdatabases with database id 30. Run DBCC
> > CHECKTABLE on Sysdatabases.

> > Interestingly it works on some servers, but only if there is a DB with
> > id = 30.

> > Has anybody got an idea why and how this happens?
> > Ta
> > LXG
> > ---------------------------------------

> > ---------------------------------------

--
---------------------------------------

---------------------------------------
 
 
 

Interesting 'undocumented feature'

Post by Neil Pik » Thu, 30 Dec 1999 04:00:00


Pyropunk - I'm sure this is just a side-effect of the parser and ascii values.  
Where in the docs does it say that use can be used with a local variable?

 Neil Pike MVP/MCSE.  Protech Computing Ltd
 (Please reply only to newsgroups)
 SQL FAQ (391 entries) see

 or www.ntfaq.com/sql.html (+ ntfaq download)
 or http://www.sql-server.co.uk

 
 
 

Interesting 'undocumented feature'

Post by BPMargoli » Thu, 30 Dec 1999 04:00:00


Pyropunk,

It does work, provided you use it correctly.

All statements in an exec( ) operate, effectively, as if you have opened
another connection. Thus the USE is changing to another database context
during the exec(). After the exec() completes, the connection is closed,
thereby returning you to your original database context.

If you want to do something useful while in the other database, you will
have to add those statements to the exec() also. For example:




will create table T in the master database.


> Unfortunately this does not work.
> It stays in the previous database.


> > Try the following instead:





> > > Hi

> > > When I run the following in iSQL or iSQL_w:



> > > I get:
> > > Msg 913, Level 22, State 2
> > > Could not find row in Sysdatabases with database id 30. Run DBCC
> > > CHECKTABLE on Sysdatabases.

> > > Interestingly it works on some servers, but only if there is a DB with
> > > id = 30.

> > > Has anybody got an idea why and how this happens?
> > > Ta
> > > LXG
> > > ---------------------------------------

> > > ---------------------------------------

> --
> ---------------------------------------

> ---------------------------------------

 
 
 

1. er, 'interesting' new 9i feature

Have you noticed that backup controlfile to trace now outputs a tracefile
containing the 'create controlfile' stuff *twice*? Once with the word
'noresetlogs' attached. And once with the word 'resetlogs'. No other
differences detectable.

This is happening in 9i R2, and it occurs to me that I don't think it
happened in 9i R1... but was wondering if anyone could check for me?

Quite what was wrong with editing out the two letters "no", like we used to
in earlier versions, I have no idea. I can already smell the confusion users
are going to get themselves into using the new, improved version.

Regards
HJR

2. J/Builder and Oracle8

3. One of Paradox 7's best features (that's not on the feature list)

4. Best cursor side location for edit, add and read records?

5. Undocumented error: 'Too many help topics'

6. Convert DAO to RDO

7. help with interesting 'query'

8. ADO Recordet ODBC/OLEDB error

9. Interesting behaviour of : LIKE @v + '%'

10. help with interesting 'query'

11. 'Optional Feature not implemented'

12. Transaction 'feature' in MS SQL 6.5

13. [WEBMASTER] 'www/html features.html'