Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
dhw
Constraint Violating Yak Guru
332 Posts |
Posted - 2002-12-23 : 17:07:33
|
| Does anyone know if there is a simple SQL query that I can use to return an empty table? I have a large quantity of tables that I want to return an empty result for....at the moment I am adding a WHERE clause to my sql expression that is specific to each table...and providing a column/value comparison that will return zero records. I was wondering though, if there were a simple or generic t-sql statement or option that I could add to my sql statement to provide the same results - an empty dataset.thanks... |
|
|
jasper_smith
SQL Server MVP & SQLTeam MVY
846 Posts |
Posted - 2002-12-23 : 17:29:21
|
select * from blah where 1=0orset FMTONLY ONselect * from blahset FMTONLY OFF HTHJasper SmithEdited by - jasper_smith on 12/23/2002 17:35:21 |
 |
|
|
dhw
Constraint Violating Yak Guru
332 Posts |
Posted - 2002-12-23 : 17:53:04
|
| thanks!! both of these solutions will work for me... |
 |
|
|
fire1
Starting Member
5 Posts |
Posted - 2002-12-26 : 08:08:23
|
| u can also use:select top 0 * from table |
 |
|
|
|
|
|