May 7, 2008 at 11:43 pm
THis is hw my Stored proc goes
Original
ALTER procedure [stpGetlist]
(
@Name varchar(255),
)
As
Declare @sName varchar(1000)
Declare @count bigint
select @sName = replace(replace(replace(@name,'.', '%'), '-', '%'), ',', '%')
In above decalration i had made like @Name
but when i am using in below i used like @name
and it gave the Error like+
Must declare the scalar variable "@name".
If i change the above into
select @sName = replace(replace(replace(@Name,'.', '%'), '-', '%'), ',', '%')
the stored proc is executing fine
can any one please suggest on this
May 8, 2008 at 12:07 am
I think Sql Server is having a case-sensitive collation and hence the above error message. You can confirm this by runnning,
sp_helpsort (or) SELECT SERVERPROPERTY ('Collation')
[font="Verdana"]- Deepak[/font]
May 8, 2008 at 12:12 am
Hi
The only error i found was in your parameter declaration.
"@Name varchar(255)," . No need of a comma if its the only parameter there.
Check your server,db collation.
"Keep Trying"
May 8, 2008 at 2:34 am
hI AFTER RUNNING
select serverproperty ('Collation') THIS I GOT THE RESULT AS
SQL_Latin1_General_CP437_BIN
IS THERE ANY WAY WE CAN ALTER THIS
May 8, 2008 at 2:49 am
for changing on a single database, you can use the ALTER DATABASE command. For changing the entire instance, you may need to rebuild the master database.
May 10, 2008 at 12:54 am
Finnaly the Problem was solved by rebuilding.
while installing the Sql- Server it will asl of Collation "Case- Insensitive", this was to be set corectly. To avoid the Issues mentioned above.
Thanks guys
May 12, 2008 at 6:30 pm
Couldn't you just go to database properties > options and select the right collation?
May 12, 2008 at 6:39 pm
In order to change the server level collation you need to rebuild the system databases. For changing database collation you can make use of alter database statement.
[font="Verdana"]- Deepak[/font]
May 13, 2008 at 1:34 am
Yes Alter/ or modifying can be done ,
But not to System DataBases
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply