Tengo problemas para ver lo que está mal con mi sintaxis aquí (SP)

It is bringing up an error on line 'Select @RowCount = 1'

declare @RowCount int
declare @MaxRows int
declare @CommonImportID bigint
declare @UserName3

select @RowCount = 1;
select @MaxRows = count(*) from import.commonImport;

while @RowCount <= @MaxRows
begin
EXEC [import].[spExecuteMainProcedure]
     @CommonImportID = 2814,
     @UserName3 = N'dTrunley'
select @CommonImportID = @CommonImportID + 1;
select @RowCount = @RowCount + 1;
end

Just really struggling to see what I've done wrong. Probably something really basic.

Muchas Gracias

preguntado el 08 de noviembre de 11 a las 11:11

1 Respuestas

You didn't define a data type here:

declare @UserName3

Probablemente debería ser algo como:

declare @UserName3 nvarchar(8)

respondido 08 nov., 11:15

...I'm literally retarded. Thanks for that. Just having one of those days - codigo comestible

@user1016253 - No worries. We all have times where we can't see what's staring us in the face. Take a break. - Oded

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.