{{theTime}}

Search This Blog

Total Pageviews

Stored Procedure to fetch all orders created today

CREATE PROCEDURE todays_orders
AS
BEGIN
SELECT * FROM order_table where  order_date = DATEADD(DAY,-1,GETDATE())
END

No comments:

Generate Insert Sql from Select Statement

SELECT 'INSERT INTO ReferenceTable (ID, Name) VALUES (' +        CAST(ID AS NVARCHAR) + ', ''' + Name + ''...