>>>>>Personally I use SELECT @@IDENTITY or even SELECT CAST(0 as bit) , but query any other system variable will do the same.
>>>>
>>>>Both you and Dragan know only about 1000 times more than I do :)
>>>>
>>>>I wish there was a definitive way to find out which one is faster Select @@version or SELECT @@IDENTITY. For me, the resulting number is not important. Only if the SELECT worked or no.
>>>>
>>>>Thank you!
>>>
>>>
>>>SELECT @@VERSION -- Returns nvarchar variable, not sure how long it is
>>>SELECT @@IDENTITY -- Returns 4 byte int
>>>SELECT CAST(0 as bit) - returns 1 bit.
>>>
>>
>>When I run SELECT @@IDENTITY in my SSMS (of SQL 2008), the returned value is NULL. Why?
>
>:-)
>Because you did not insert any record in a table with identity field.
>
>>
>>Also, how is SELECT CAST(0 as bit) different from SELECT ""? That is, neither one (as far as I know) hits the SQL Server. No?
>
>Both hits SQL Server.
>SELECT "" should return error becuase you should round string in single quotes.
Please bear with me. Are you saying that:
IF SQLEXEC( oApp.conn_handle, "") < 0
hits the SQL Server? That is, if the application lost connection to the SQL Server, the above will return value less than 0?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham