Some SQL Statments (Up-to-date)
1- To Get the Last Record in table name test for Example With columns ( testId,testName )
then write the select statment :
SELECT testid,testName FROM test WHERE testid=( SELECT MAX( testid ) FROM test )
you can also use the Following statment :
SELECT Top 1 testid,testName FROM test ORDER BY testid DESC
2- To copy tables From Database To other :
SELECT * into TargetTable
FROM hrdb.dbo.SourceTable
we want to copy the table hrEmployees from the database HR to Created Table tblEmployees in Accounting Database for Example:
SELECT * into tblEmployees
FROM hrdb.dbo.hrEmployees
LuisR 8:36 am on November 30, 2008 Permalink |
just stopped in….
Wasn’t what I was looking for, but neat site. Take care….
Stilts 3:47 am on February 5, 2009 Permalink |
just wandered in….
Looking for another site, but cool site. Thanks….
Malpractice 9:04 pm on February 13, 2009 Permalink |
Heya…
Gotta love msn, very fine stuff. Thank you….
LocalAdLink 11:05 pm on February 15, 2009 Permalink |
Hi…
Looking for something else, but cool site….