Hello... I'm new with using SQL with VS 2008. I like to think that I'm getting better, but I've run into what I hope is only a slight problem. What does and how can I fix the following error message? "The variable name'@ClosePrice' has already been declared. Variable names must be unique within a query batch or stored procedure." I'm suspicious that their may be another version of this DB elsewhere. If that is the cause of this error, how should I track it down and remove it? May you have a blessed day as the Lord wills. JEP_Dude
It's pretty much exactly what it says. It doesn't have anything to do with another database. You have a variable called @ClosePrice. It is being used somewhere in a query or stored procedure. That variable is then being declared again, so the error is being displayed. Check your code and the stored procedure for all instances of the variable "@ClosePrice" and you will find the error. It should be relatively easy to find.
Hey there.... I did a search for "@Clos" as I wanted to see ALL POSSIBLE COMBINATION. However, it returned, "Search found no results". I couldn't find it! What should I try next? I'm out of ideas! God bless JEP_Dude
Hey there... There is some hope! I did a "Find and Replace" search for "@ClosePrice". I told it to "Look in:" "Entire Solution". It stated that this was found in an ".XSD" file. What type of file is ".XSD"? I looked at the line with the mysterious variable name. It was .... <CommandText> INSERT INTO [dbo].[Statistics] ([PrimaryKey], [Symbol], ..... , [ClosePrice]) VALUES (@PrimaryKey, @Symbol, .... , @ClosePrice); SELECT PrimaryKey, Symbol, .... , ClosePrice FROM [Statistics] WHERE (PrimaryKey = @PrimaryKey) </CommandText> Why did VS.Net 2008 insert the "@" symbol in the VALUES clause? ...and why did it flag it as an error? Did I miss something here? Could there be another name for this column in the SQL table definition? If there is, how should I go back and fix it? Sorry for all these Q's but this is the first time I'm using SQL and the first time I'm trying to design a website. So please help this newbie. May you have a blessed day as the Lord wills. JEP_Dude