Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
shifis
Posting Yak Master
157 Posts |
Posted - 2006-03-08 : 20:05:00
|
| HiI do the next SP, but when I try to run I got an errorLine that I try to run in Query analyzer:exec SP_RPAD('tere',7,'W')Error:Line 3: Incorrect syntax near 'tere'.ProcedureCREATE PROCEDURE SP_RPAD @Cadena varchar(200), --Cadena Original a la que se va a rellenar@LongCadena int, --Longuitud final que tendra la cadea@Char_llenar char(1) --Caracter con el que se va a rellenarASSELECT RIGHT(REPLICATE(@Char_llenar,@LongCadena) + @Cadena ,@LongCadena) AS RPADGOAny idea what I am doing wrong? |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2006-03-08 : 20:49:09
|
| You don't need the parentheses on your proc call.i.e. exec SP_RPAD 'tere',7,'W'Damian"A foolish consistency is the hobgoblin of little minds." - Emerson |
 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2006-03-08 : 20:51:13
|
New to stored procedures? Don't enclose the parameter list in parentheses.exec SP_RPAD 'tere',7,'W' CODO ERGO SUM |
 |
|
|
shifis
Posting Yak Master
157 Posts |
Posted - 2006-03-09 : 10:31:56
|
| Thanks, I have a very long time with out using SQL server, so how you can see I'm starting to foget the sintaxis |
 |
|
|
|
|
|
|
|