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 |
Arunavally
Yak Posting Veteran
58 Posts |
Posted - 2013-10-24 : 07:03:10
|
Hai,I want to check if first record is in Table or not.Kindly help me.Thanks in Advance |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-10-24 : 08:31:17
|
Define what do you mean "First record". SQL doesnt have any concept of First or Last unless you specify order by means of ORDER BY clause.If you attempt is to see if table has any rows use thisIF EXISTS (SELECT 1 FROM tableName) ...your code ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
Arunavally
Yak Posting Veteran
58 Posts |
Posted - 2013-10-24 : 09:20:05
|
Thank you. I wan to chk table have any records or not? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-10-24 : 11:44:12
|
ok...then what i gave you would be enough.------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
Arunavally
Yak Posting Veteran
58 Posts |
Posted - 2013-10-25 : 00:33:25
|
I usedIf exists (select 1 from table)its wrk as my wish |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-10-25 : 03:00:05
|
cool------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
|
|
|