Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to find out number of fields
Message
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2008
Divers
Thread ID:
01446547
Message ID:
01446629
Vues:
40
>>>>>Hi everybody,
>>>>>
>>>>>I have a long select statement and I'm wondering how can I find number of fields returned by it without writing to a real table?
>>>>>
>>>>>Also, since I'm getting the result into VFP cursor, I guess I need to limit the number of fields to 254, correct?
>>>>>
>>>>>Thanks.
>>>>
>>>>You have a long SELECT?
>>>>Are you using a some kind of macro/execscript?
>>>>
>>>>Because if you don't you may check the number of the fields after the cursor is created, if you do you could parse the string between SELECT and FROM and check how many commas are there.
>>>
>>>I wanted to find out from the SQL side. I solved the problem, there were only 83 fields, but looked much more than that.
>>
>>Did you grab @@ROWCOUNT or what?
>
>I'm still working today right now :(
>
>Anyway, I selected into TempTable and grabbed number of fields from Information_Schema.Columns and then dropped the TempTable.

I have no idea what I was thinking with ROWCOUNT. My only excuse it was right after a long (but good) week at work. Evidently I left all the brain cells back there on my desk <g>.

Sounds like you are working again? If so, congratulations!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform