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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2001-07-30 : 08:48:05
|
| Rodney writes "I am trying to build a lookup table in a Stored procedure... and i get an error saying something about sp_dboption... here is the stored proc.Version - SqlServer7 : WinNT 4.0 : SP (latest)Alter Procedure dbo.sp_createlookupAsCreate Table CityLookup ( ID int identity, City nvarchar(50), State nvarchar(2));DECLARE @State_Table nvarchar(2)Declare @sql varchar(100)DECLARE c1 CURSOR FORSELECT state FROM state_listOPEN c1FETCH NEXT FROM c1INTO @State_TableWHILE @@FETCH_STATUS = 0BEGINset @sql = 'select distinct(City), state into CityLookup from [' + @state_Table + ']'Exec(@sql)FETCH NEXT FROM c1INTO @State_Table ENDCLOSE c1DEALLOCATE c1am i doing something wrong here? Can what i am trying to accomplish be done?thanks for any help.Rod" |
|
|
|
|
|