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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Migrating from Oracle SQL Plus to T-SQL

Status
Not open for further replies.

Guest_imported

New member
Joined
Jan 1, 1970
Messages
0
I am trying to find the correct syntax for Transact SQL.
Particulary the "Substr" function and the "Concatenation"
function. I am proficiant in Oracle SQL Plus, However it does not translate very well to T-SQL.
Also is there a good book or wesite w/ Transact SQL Syntax, Functions, and, Character Functions?
Can anybody help me on this?
thanks,
scotta
 
SUBSTRING(<StringToEvaluate>,StartPosition,#ofCharsToReturn)

Hard to blow up if you supply all the arguments. Only nastiness I've found is a negative number in the third argument so if you derive that value you should validate.

My favorite T-SQL tome: &quot;The Guru's Guide to Transact SQL&quot; By Ken Henderson
JHall
 
Concatenation in T-SQL is accomplished with the concatenation operator '+'.

Example: Concatenate 2 columns
Select col1 + col2 As CatCol
From tableA

Example: Concatenate 3 strings
Set @str = 'This is part 1.' + @var1 + ' The last part.'
Print @str

I agree with JHall's recommendation of &quot;The Guru's Guide to Transact SQL&quot; By Ken Henderson.
Terry L. Broadbent
Programming and Computing Resources
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top