DucDigital for ( $girl = 1; $girl < $required; $girl++ ) { echo “I love DucDigital”; }

20Dec/090

Convert INT to VARCHAR in SQL (MSSQL)

At some point you will need to change INT to VARCHAR for the purpose of manipulation like substring or to display it in the status windows when execute of stored procedure or trigger...

here is the code which you can use to convert / cast the INT to VARCHAR:

CONVERT(TYPE, VALUE)

in this case ( my case ), this was used:

	PRINT 'New revision updated for post id ' + CONVERT(VARCHAR(20), @intPID) + '!'

Good luck

  • Share/Bookmark
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.