Autor Beitrag
moloch
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 451

Win 2000
D5 Prof
BeitragVerfasst: Do 12.08.04 10:54 
Hey Leute,
kann mir jemand sagen wie ich am besten und sichersten abfrage ob eine bestimmte MSSQL-Tabelle schon vorhanden ist?

Im Moment mache ich die SQL 'select * from ' + sTabelle + ' where 1=2';
Das klappt schon ganz gut. Will nur wissen ob es was besseres gibt, da ich das Gefühl habe dass das manchmal fehlschlägt.

MFG

moloch
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Do 12.08.04 11:06 
Hallo,

mit welchen Komponenten greifst Du auf die Daten Zu? ADO?

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)
moloch Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 451

Win 2000
D5 Prof
BeitragVerfasst: Do 12.08.04 11:12 
hey,
ich gehe über die bde von borland and die mssql-datenbank

MFG
moloch
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Do 12.08.04 11:41 
Hallo,

leider kenne ich mich mit BDE/MSSQL nicht so gut aus.
Eine Möglichkeit an die Tabellenname zu kommen besteht über die Eigenschaft GetTableNames der Session. Näheres dazu findest Du in der Delphi-Hilfe.

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)
moloch Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 451

Win 2000
D5 Prof
BeitragVerfasst: Do 12.08.04 13:43 
ok danke erstmal,
stehst du auf Philosophie ja?
MFG
moloch
Cashels
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 167



BeitragVerfasst: Mo 16.08.04 12:47 
moloch hat folgendes geschrieben:
kann mir jemand sagen wie ich am besten und sichersten abfrage ob eine bestimmte MSSQL-Tabelle schon vorhanden ist?

Hi,
kuck dir doch mal die Tabelle sysobjects an, die (glaub ich) in jeder MSSQL Datenbank vorhanden sein müsste. Womöglich wird dies aber auch alles zentral in der Masters Datenbank verwaltet, weiss ich jetzt nicht mehr genau.

Gruß,
Tom