Click here to Skip to main content
15,890,527 members
Home / Discussions / C#
   

C#

 
GeneralRe: SDLDMO and a Detached Pin
Paul Watson11-Dec-02 10:08
sitebuilderPaul Watson11-Dec-02 10:08 
GeneralRe: SDLDMO and a Detached Pin
Nick Parker11-Dec-02 16:20
protectorNick Parker11-Dec-02 16:20 
GeneralRe: SDLDMO and a Detached Pin
Paul Watson11-Dec-02 20:17
sitebuilderPaul Watson11-Dec-02 20:17 
GeneralRe: SDLDMO and a Detached Pin
Stephane Rodriguez.11-Dec-02 9:56
Stephane Rodriguez.11-Dec-02 9:56 
GeneralRe: SDLDMO and a Detached Pin
Paul Watson11-Dec-02 10:04
sitebuilderPaul Watson11-Dec-02 10:04 
GeneralRe: SDLDMO and a Detached Pin
Stephane Rodriguez.11-Dec-02 10:27
Stephane Rodriguez.11-Dec-02 10:27 
GeneralRe: SDLDMO and a Detached Pin
Paul Watson11-Dec-02 20:13
sitebuilderPaul Watson11-Dec-02 20:13 
GeneralRe: SDLDMO and a Detached Pin
Richard Deeming12-Dec-02 0:58
mveRichard Deeming12-Dec-02 0:58 
To get the list of SQL servers on NT/2000/XP, use the code from the Server Enumerator[^] article. If you can see multiple domains, you'll need to enumerate the domains, and then enumerate the SQL servers for each domain. I've got some simple code to enumerate each domain in a new thread, if you want it.

Once you choose the server, you can connect to the master database, and execute SELECT name FROM master.dbo.sysdatabases ORDER BY name to get the list of databases. You could also use sp_databases, but that seems to be slightly slower.

To get the list of tables, connect to the database and execute sp_tables @table_type = "'TABLE'". (Note the extra quotes around the parameter value.) The important column of the results is TABLE_NAME.

To get the columns of the table, use sp_columns 'Table name'. COLUMN_NAME, PRECISION, LENGTH, SCALE and NULLABLE are all fairly obvious. The TYPE_NAME will give you the name of the datatype for the column, or you can map the SS_DATA_TYPE column to the types defined in srv.h in the Tools\DevTools\Include directory of your SQL Server installation. NB: Watch out for identity columns, with a TYPE_NAME of "int identity".

You can get details of the primary key for the table using sp_pkeys 'Table name', which will return the list of columns (COLUMN_NAME) in the primary key for that table.


"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
GeneralRe: SDLDMO and a Detached Pin
Paul Watson12-Dec-02 1:13
sitebuilderPaul Watson12-Dec-02 1:13 
GeneralRe: SDLDMO and a Detached Pin
Richard Deeming12-Dec-02 7:24
mveRichard Deeming12-Dec-02 7:24 
QuestionHow to replace standard .NET runtime error box Pin
Vasek11-Dec-02 6:56
Vasek11-Dec-02 6:56 
AnswerRe: How to replace standard .NET runtime error box Pin
LongRange.Shooter11-Dec-02 9:07
LongRange.Shooter11-Dec-02 9:07 
GeneralRe: How to replace standard .NET runtime error box Pin
Vasek11-Dec-02 21:41
Vasek11-Dec-02 21:41 
GeneralRe: How to replace standard .NET runtime error box Pin
grv57513-Dec-02 2:42
grv57513-Dec-02 2:42 
GeneralNotifyIcon / Remove from Taskbar Pin
Adrian Hall11-Dec-02 5:44
Adrian Hall11-Dec-02 5:44 
GeneralRe: NotifyIcon / Remove from Taskbar Pin
Alexander Kojevnikov11-Dec-02 7:11
Alexander Kojevnikov11-Dec-02 7:11 
General.NET and COM Interoperability Pin
Amir Harel11-Dec-02 4:48
Amir Harel11-Dec-02 4:48 
GeneralRe: .NET and COM Interoperability Pin
Stephane Rodriguez.11-Dec-02 19:07
Stephane Rodriguez.11-Dec-02 19:07 
GeneralProcess.EnableRaisingEvents Problem Pin
yccheok10-Dec-02 16:46
yccheok10-Dec-02 16:46 
GeneralRe: Process.EnableRaisingEvents Problem Pin
Kannan Kalyanaraman10-Dec-02 22:31
Kannan Kalyanaraman10-Dec-02 22:31 
GeneralRe: Process.EnableRaisingEvents Problem Pin
yccheok11-Dec-02 15:48
yccheok11-Dec-02 15:48 
GeneralRe: Process.EnableRaisingEvents Problem Pin
Richard Deeming11-Dec-02 4:43
mveRichard Deeming11-Dec-02 4:43 
GeneralWhy An Instance Of A Class Cannot Be Created Pin
yccheok10-Dec-02 16:45
yccheok10-Dec-02 16:45 
GeneralRe: Why An Instance Of A Class Cannot Be Created Pin
Nick Parker10-Dec-02 17:02
protectorNick Parker10-Dec-02 17:02 
GeneralRe: Why An Instance Of A Class Cannot Be Created Pin
Kannan Kalyanaraman10-Dec-02 22:36
Kannan Kalyanaraman10-Dec-02 22:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.