sql 语句 exec 执行字符串
create PROCEDURE [dbo].[AllDnn_NewsPublish_DeleteArticleByArticle]
@ArticleID nvarchar(200)
AS
declare @sql nvarchar(1000)
set @sql='DELETE dbo.Site_News_Article where ArticleID in ('+@ArticleID+')'
exec (@sql)
--[AllDnn_NewsPublish_DeleteArticleByArticle] '50,51'
相关文档:
文章来源:Http://www.simple-talk.com
原文地址:http://www.simple-talk.com/sql/learn-sql-server/managing-transaction-logs-in-sql-server/
原作者:Robert Sheldon
翻译:三晋一枝花
译文原地址:http://prj.souty.cn/Admin/Knowledges/ShowKnowledge.aspx?id=44dbde74-d2c5-41a5-a8e9-375ba7103025
在 SQL Serv ......
First:
create table gobo.gobo_om_reservations_2008b as
select * from gobo_om_reservations
where to_char(CREATION_DATE,'yyyy')<'2008'
delete from gobo_om_reservations
where to_char(CREATION_DATE,'yyyy')<'2008'
commit
After 2009Year:
create table gobo.gobo_om_reservations_????b as ......
select d.code,d.name, sum(w.weight) weight,round(avg(w.price),2) price,sum(w.money) money
from weight_info w left outer join t_dict d on w.productcode=d.code left outer join t_balancecode b on w.balancecode=b.balancecode where 1=1 and w.operdate>TO_TIMESTAMP('2009-11-2 04:12:32.0', ' ......
Student(S#,Sname,Sage,Ssex) 学生表
Course(C#,Cname,T#) 课程表
SC(S#,C#,score) 成绩表
Teacher(T#,Tname) 教师表
问题:
1、查询“001”课程比“002”课程成绩高的所有学生的学号;
select a.S# from (select s#,score from SC where C#='001') a,(select s#,score
fr ......