SQL - Inserting a blank row

Soldato
Joined
23 Oct 2002
Posts
4,154
Location
_
Hello!

I'm working in SQL Server 2000, and I've got a single column in my table which has an identity (An auto-incrementing primary key).

I want to use a SQL insert statement that just inserts a new record.

Something like:

Code:
Insert INTO Session () VALUES ()

The reason I want to do this is to get a guaranteed and recorded unique session ID that doesn't rely on ASP's session object, and can be permanent, or at least as long as the cookie lasts.

Any thoughts?

Cheers for your ideas in advance.

Karl.
 
How about:

Code:
Insert INTO Session (2) VALUES ('')

This should insert nothing into column 2.

Note: it is 2 x apostaphies in the VALUES section
 
A good guess, but unfortunately I don't have a second column to deal with.

The table consists of only the primary key, as no other information to go in this table is pertinent, and it's literally just a way of generating a 100% unique number.
 
How about creating a second column?

I cant see how it could be done otherwise? Maybe use ADODB.Add? Instead of SQL INSERT?
 
That might be an option, I'll look into that. :)

It'd be tidier if I didn't have the 2nd column, but if I have to I will.

Thanks for your input mate. :)
 
I don't know if you can use adodb.add in an ASP sense. I've had a quick look on google, but it returns less than 5 results with some omitted. I guess I'll add an extra column!
 
Back
Top Bottom