Declare @Id varchar(20) Declare @Name varchar(20) Declare Cur Cursor For select substring(id,0,7) as id,name from temp1 Open Cur Fetch next From Cur Into @Id,@Name While @@fetch_status=0 Begin Update temp Set [c3]=@Name where [id] like @Id+'%' Fetch Next From Cur Into @Id,@Name End Close Cur Deallocate Cur
装完sql server 2005后却没有找到ms的示例数据库northwind 后来查看安装光盘发现sql server 2005种只有adventurework与adventureworkDW这两个sample database 到ms官方站找了好久 才找到sql server 2000的sample database 下载链接如下 http://www.microsoft.com/downloads/details.aspx?FamilyID=06616212-0356-46A...