views:

127

answers:

2

Can I create a table without any columns in SQL Server by t-sql?

+1  A: 

No. What would you use it for?

Ray
+4  A: 

A table is a collection of columns and rows. You need at least one column.

Digital gig
More precisely: “A table is a collection of at least one column and at least zero rows”
Joey
in postgresql you *can* indeed create tables without columns. But don't ask me why.
codymanix
This seems to be supported by this SQL Server 2005 error message: CREATE TABLE NoColumns (doomed INT) ALTER TABLE NoColumns DROP COLUMN doomed -- "ALTER TABLE DROP COLUMN failed because 'doomed' is the only data column in table 'NoColumns'. A table must have at least one data column."Sad but (apparently) true . . .
Woody Zenfell III