在SQL Server数据库的维护或者Web开发中,有时需要在存储过程或者作业等其他数据库操作中调用其它的存储过程,下面介绍其调用的方法

一、SQL SERVER中调用不带输出参数的存储过程

SQL 代码

--存储过程的定义create procedure [sys].[sp_add_product] (  @m_viewcount int = 0 ,@m_hotcount int = 0)asgo --存储过程的调用 declare @m_viewcount int declare @m_hotcount int exec sp_add_product @m_viewcount,@m_hotcount

SQL 代码

--定义存储过程create procedure [sys].[sp_add_product] (  @m_viewcount int = 0 ,@m_hotcount int output )--存储过程的调用declare @m_viewcount int =0declare @m_hotcount int exec dbo.sp_add_product @m_viewcount,@m_hotcount output

如果数据库的命名是比较规范的,当我们需要查找某个字段在哪些表中存在时,在sql server中就很方便的利用syscolumns系统表查询出结果。

下面一段sql代码给大家讲解sql server 查找 m_Id 在哪些表中存在的方法

select tab.name table_name, col.name column_name from sysobjects tab left join syscolumns col on tab.id = col.id and tab.xtype = 'U' where col.name like '%m_Id%' order by 1,2

更多相关文章

  1. Android异步加载图像小结 (含线程池,缓存方法)
  2. android WebView 图片缩放功能小结
  3. Android(安卓)Camera 使用小结
  4. android fragment学习5--fragment扩展 TabLayout非自定义
  5. Android(安卓)电源系列小结s
  6. Android中自定义对话框小结
  7. Android中自定义对话框小结
  8. Android中自定义对话框小结
  9. Android中自定义对话框小结

随机推荐

  1. golang map 不排序怎么办
  2. golang判断错误类型的方法
  3. golang使用什么数据库?
  4. golang怎么自定义错误
  5. golang 如何部署到服务器?
  6. golang解决中文乱码的方法
  7. go语言中的排序讲解
  8. golang怎么给slice赋长度
  9. Go语言异常处理的方法介绍
  10. golang怎么拼接字符串数组