Re: Trigger - for statement

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Dejan Sarka (dejan_please_reply_to_newsgroups.sarka_at_avtenta.si)
Date: 08/20/04


Date: Fri, 20 Aug 2004 08:50:59 +0200

Hi!

If you need a loop, use WHILE statement. There is no FOR loo in T-SQL. Or do
you mean maybe FOR clause in some other statements (SELECT ... FOR ...)?

-- 
Dejan Sarka, SQL Server MVP
Associate Mentor
Solid Quality Learning
More than just Training
www.SolidQualityLearning.com
"Just D." <no@spam.please> wrote in message
news:H2hVc.1496$kz6.163@fed1read02...
> All,
>
> How can I use FOR and others like that in T-SQL (inside triggers)? What's
> the syntax of these FOR...?
>
> Thanks,
> D.
>
>


Relevant Pages

  • Re: T-SQL Looping
    ... T-SQL supports WHILE loop. ... (id int IDENTITY(1,1) ... find the Nth delimiter in strMSG and return ...
    (microsoft.public.sqlserver.programming)
  • Re: Daily Graphs of activity
    ... It's the Crystal Report that ... > grouping by day a count, not any t-sql. ... >> You'll need to write a SQL while loop to insert blank data. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Loop though select statement
    ... Can I loop through a select statement with t-sql, grab a value at a ... time and then use it in a stored procedure? ...
    (microsoft.public.sqlserver.programming)
  • Re: Delete Text file from Stored Procedure
    ... Why do you want to do that by T-SQL? ... Look at EXEC master..xp_cmdshell and sp_OACreate ... > Is it possible to loop through the Files in a directory and delete certain ...
    (microsoft.public.sqlserver.programming)
  • IF statement in SQL?
    ... Can I write an if statement in T-SQL for MSSQL2K or do I have to do it in the ... WHERE clause? ... IF field1 = e ...
    (microsoft.public.sqlserver.mseq)