Hi,below is my stored proc in dynmaic sql. i am actually
calling this into my SSIS package which is importing
text files into the DB.. some file names are like
db-1..so my package is throwing an error saying
Incorrect syntax near '-'.
I know it is bcos of that - sign ..can anybody
make the change to my proc so that if the filename
is db-1, it shuld change it to db1 on the fly..so basically
just removing the '-'.
ALTER PROCEDURE [dbo].[test]
@myTable as varchar(40)
DECLARE @SQL nvarchar(max)
SET @SQL='CREATE TABLE ' + @myTable + '
([Address ] [nvarchar](255) NULL,
[Name1] [nvarchar](255) NULL,
[Name2] [nvarchar](255) NULL,
) ON [PRIMARY]'
exec sp_executesql @SQL