Question: How can I get the @@IDENTITY for a specific table?

I have been doing 

```
select * from myTable 

```

as I assume this sets the scope, from the same window SQL query window in SSMS I then run 

```
select @@IDENTITY as identt

```

It returns identt as null which is not expected since myTable has many entrie in it already..

I expect it to return the next available ID integer.

myTable has a ID column set to Primary key and auto increment.

Answer: 
I've never known @@IDENTITY to be used this way, i've only ever used it to access the ID of a newly inserted record.
That's correct. @@IDENTITY cannot be used the way you think it can be. It can only be used after an INSERT into a table. Let's consider this for a scenario: 

You have two tables: Order (Primary Key: OrderID), OrderDetails (Foreign Key: OrderID)

You perform
INSERT INTO Order
VALUES('Pillows')
-- Note that OrderId is not mentioned in Values since it is auto number (primary key)

Now you want to perform insert into OrderDetail. But you don't always remember how many records there were in Order table prior to you having inserted the record for 'Pillows' and hence you don't remember what was the last PrimaryKey inserted into Order table. You could but even then you wouldn't want to specifically mention to insert (let's say OrderID of 1) when you insert into OrderDetail table.

Hence, your OderDetail insert would work kinda like so:
INSERT INTO OrderDetail
VALUES (@@IDENTITY,'Soft Pillows')

Hope this explains the user of @@IDENTITY.