i need to insert my dynamic query which i am generating and saving into sql-server database table, but without where condition its working fine but with where condition its giving me error, please anyone can help me on this.
INSERT INTO [dbo].[tablename] ([DataQuery],[DataQueryName],[EditedDate],[LastUsedDate],[UserId])
VALUES ('SELECT * from tablename WHERE tablename.UID < '10' AND tablename.status = 'Active' ORDER BY Id'
,'aa',GETDATE(),GETDATE(),'1541')