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
Explain multiserver query
What are the advantages of mirroring?
What is the data tier application?
What are the advantages of log shipping?
Mention the uses of stored procedures.
What are the types of sql server?
What is “begin trans”, “commit tran”, “rollback tran” and “savetran”?
How to list all dsn entries on your local machine using odbc_data_source()?
How global temporary tables are represented and its scope?
What are triggers? How do you invoke a trigger on demand?
Explain the difference between HTTP and HTTPS in database?
What is a fill factor?
How to Improve the performencs of SQL Server 2005 exclude stored Procedure and Indexes?
What is normalization of database? What are its benefits?
You have a table with close to 100 million records recently, a huge amount of this data was updated now, various queries against this table have slowed down considerably what is the quickest option to remedy the situation?