where 1 = 0 ::: Rowcount????

Results 1 to 3 of 3

Thread: where 1 = 0 ::: Rowcount????

  1. #1
    Join Date
    Dec 1969

    Default where 1 = 0 ::: Rowcount????

    I am looking at some code that was given to me. What does the clause where 1 = 0 do in this example. I also have another statement where there is 1 =1. Is this related to a feature of SQL Server that is rowcount. Please help because I know that the table does not have a field called &#039;1&#039; <BR><BR><BR>select date,<BR> ID_Security,<BR> ID_Lot,<BR> ID_Valuation,<BR> ID_Valuation_Type,<BR> Additive_Mode,<BR> Pct,<BR> Dollars,<BR> Amount,<BR> Fx <BR> into #Val<BR> from valuation<BR> Where 1 = 0 <BR> <BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: where 1 = 0 ::: Rowcount????

    The condition<BR><BR> Where 1 = 0 <BR><BR>is always false. (It is not columns, just numerical values.)<BR><BR>select ... int #val creates a temporary table and as the select statement will not return any records the table will be empty.<BR><BR>This has nothing to do with SQL server or rowcount.

  3. #3
    Join Date
    Dec 1969

    Default In other words...

    It&#039;s a quicky way of "cloning" a table (or parts of a table).<BR><BR>Shorter than doing CREATE TABLE and then having to set all the field types. You are just copying field types from the existing table.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts