Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Related Cursor

Author  Topic 

snehal20
Starting Member

3 Posts

Posted - 2006-10-03 : 04:04:16
Getting error while executing this query!

Error:AccessLevels
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'AccessLevels'.
Server: Msg 105, Level 15, State 1, Line 1
Unclosed quotation mark before the character string 'ABC'.
demotest
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'demotest'.
Server: Msg 105, Level 15, State 1, Line 1
Unclosed quotation mark before the character string 'ABC'.


Query:EXEC ('update ''' + @tablename + ''' SET PortalID=''' + @OldPortalId + ''' where PortalID ='''+ @NewPortalId )

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-10-03 : 04:06:02
[code]EXEC ('update ' + @tablename + ' SET PortalID = ''' + @OldPortalId + ''' where PortalID = ''' + @NewPortalId + '''')[/code]


KH

Go to Top of Page

snehal20
Starting Member

3 Posts

Posted - 2006-10-03 : 07:42:56
quote:
Originally posted by khtan

EXEC ('update ' + @tablename + ' SET PortalID = ''' + @OldPortalId + ''' where PortalID = ''' + @NewPortalId + '''')



KH




Thanx a lot!!!
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-10-03 : 08:57:39
Why do you want to pass table name as parameter?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -