Click here to Skip to main content
15,921,697 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

Im trying to print a variabl in SQL but it just return the first Character of that String. Am i missing something?

Thank You.


Heres the Code:

SQL
DECLARE @nome_maq varchar

SET @nome_maq = 'MYP'
PRINT @nome_maq


Heres the Result :

M
Posted

1 solution

I guess so! Try like that:

SQL
DECLARE @nome_maq as varchar(20);

SET @nome_maq = 'MYP'
PRINT @nome_maq


Did you spot the difference?

Regards,

Manfred
 
Share this answer
 
Comments
Member 8956437 22-May-12 10:03am    
yeah, i missed that thanks .
Maciej Los 23-May-12 2:16am    
Good answer, my 5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900