zoukankan      html  css  js  c++  java
  • 点滴积累【other】---存储过程修改表的所有字段(sql)

     1 USE [QG_Mis24]
     2 GO
     3 /****** Object:  StoredProcedure [dbo].[p_set]    Script Date: 07/11/2013 17:05:38 ******/
     4 SET ANSI_NULLS ON
     5 GO
     6 SET QUOTED_IDENTIFIER ON
     7 GO
     8  ALTER procedure [dbo].[p_set]   
     9  as   
    10  declare tb cursor for  
    11  SELECT sql='alter table ['+d.name   +'] alter column bgdlx Varchar(64) '  
    12  FROM syscolumns a left join systypes b on a.xtype=b.xusertype  
    13  inner join sysobjects d on a.id=d.id and a.name like '%bgdlx%' and a.length =10    
    14  order by d.name,a.name   declare @sql varchar(1000)   
    15  open tb   fetch next from tb into @sql   while @@fetch_status = 0   
    16  begin   print @sql  
    17  exec(@SQL)  fetch next from tb into @sql   
    18  end   
    19  close tb   
    20  deallocate tb  
  • 相关阅读:
    九连环
    Fruit Ninja(取随机数)
    Distinct Values(贪心)
    Harvest of Apples
    Don't Be a Subsequence
    ConvexScore
    守卫
    Trie树
    NOIP 2005 过河
    HDU 4597 Play Game 记忆化DP
  • 原文地址:https://www.cnblogs.com/xinchun/p/3185479.html
Copyright © 2011-2022 走看看