I want to execute this query as you can see :
DECLARE @site_value INT;
SET @site_value = 1310;
WHILE @site_value <= 1396
BEGIN
ALTER DATABASE AdventureWorksDW
ADD FILE
(NAME = N'data_2002',
FILENAME = N'C:\symfadb2filegroup\data_'+@site_value+'.ndf',
SIZE = 5000MB,
MAXSIZE = 10000MB,
FILEGROWTH = 500MB)
TO FILEGROUP [Filegroup_2002]
SET @site_value = @site_value + 1;
END;
But I get this error in this part +@site_value
Msg 102, Level 15, State 1, Line 10
Incorrect syntax near '+'.
I used CONVERT and CONCAT but I get the same error.