Select blank recordset in sql server

diegot
11-14-2004, 08:16 PM
Which is the best (fastest) way to select a blank recordset in sql server?

I was using "SELECT * FROM <Table> WHERE FALSE" in ms jet.

Thanks.

VBJoe
11-14-2004, 11:01 PM
Why do you need an empty Recordset?

diegot
11-14-2004, 11:09 PM
Thanks for your reply.

I need to add records through ADO. The recordset is also sent to a couple of subs to be generated.

VBJoe
11-15-2004, 12:01 AM
It's more efficient to use an INSERT query executed through a Command object to add records to a database table. If you do need an empty Recordset, open it using a SQL query that has impossible parameters in the WHERE clause:

SELECT *
FROM SomeTable
WHERE SomeDate < '1/1/1900' AND SomeDate > '12/31/2099'

diegot
11-15-2004, 12:16 AM
I'll do it like that. I thought there was a way to translate the word FALSE in the query.

Thanks for your time.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum