How will you collect the date from current date to last
older 6 days date in sql server 2005
Answer Posted / hairlin vasanth raj
ALTER procedure [dbo].[p1]
as
declare
@i int
set @i = 0
begin
set nocount on
while (@i < 6)
begin
SELECT DATEADD(DD,-@i,GETDATE()) as date
set @i=@i+1
end
end
exec p1
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Can you explain full-text query in sql server?
What are translations and its use? : sql server analysis services, ssas
What is coalesce and check constraint in sql server?
What happens if the update subquery returns no rows in ms sql server?
What is the use of partition by in sql server?
What are cursors? Explain different types of cursors. What are the disadvantages of cursors? How can you avoid cursors?
Explain what are the basic functions for master, msdb, model, tempdb databases?
Explain “@@rowcount” and “@@error” in sql server?
Explain what you mean by 3 tier architecture.
What are the fixed server level roles? : sql server security
Do you know what is difference between stored procedure and user defined function?
how do you test proper tcp/ip configuration windows machine? : Sql server database administration
What are a scheduled jobs?
How to return the date part only from a sql server datetime datatype?
Define Joins?