Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tips on upgrading from SQL to T-SQL please!!!

Status
Not open for further replies.

LucyP

Programmer
Jan 17, 2001
51
ES
I'm quite familiar with ASP using Access and ordinary SQL commands, but I've recently had to upgrade to SQL-Server and I'd like to use all of the additional features that this allows.

In particular, I'd like to use @@IDENTITY, which you apparantly can with T-SQL. I'm finding it hard though to get started: Microsoft's files all assume you know how to use this type of variable. How can I pass the variable, once selected, back to VBScript? Do I have to use the command object, rather than the connection object to execute commands. Any tips, or ideas on which book to buy would be helpful.
 
> Microsoft's files all assume you know how to use this type of variable

That is not entirely accurate. The Transact SQL help file has much information regarding the sytax and use of variables. Here is a small excerpt from the 'Variable' help page. The page also list all the global variables including @@IDENTITY

Hope this helps
-pete

Local Variables

Local variables are declared in the body of a batch or procedure with the DECLARE statement and given values with a SELECT statement. Local variables are often used in a batch or procedure as counters for WHILE loops or for IF...ELSE blocks.

Syntax

Variable declaration:

DECLARE @@variable_name datatype
[, @@variable_name datatype...]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top