Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ColumnProperty from different database
Message
De
14/04/2004 16:17:32
Larry Long
ProgRes (Programming Resources)
Georgie, États-Unis
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Maintenance bases de données
Titre:
ColumnProperty from different database
Divers
Thread ID:
00894932
Message ID:
00894932
Vues:
72
I am migrating data from 1 database to another with a different schema altogether and need to designate identity columns in the original. If I am in the new database and issue the following from a stored procedure where northwind is the original..

select o.name , c.name AS [idcolumn]
from northwind..sysobjects o join northwind..syscolumns c
on o.id = c.id
and COLUMNPROPERTY(o.id, c.name, 'IsIdentity') = 1

I get nothing, because apparently the COLUMNPROPERTY is bound to the local database. Is there a way to "tell" the system to use the northwind COLUMNPROPERTY?

I know I can just issue a USE NORTHWIND before the query and then switch back if I use a standard script, but I would like to keep it in a procedure file.

TIA
L.A.Long
ProgRes
lalong1@charter.net
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform