6
Answers

How to save exported PDF file into specified folder

 Hi,
I am unable to export data into pdf format and save it into user defined location.
Bellow is the code to export the data from database and save to pdf.
 
Please find the document and help Me urgently.
I have been given a deadline till todat 5PM.
Thank You  in advance.
 
 
Answers (6)
1
Madhanmohan Devarajan

Madhanmohan Devarajan

NA 6.5k 471.5k 8y
Gaurav,
Would like to understand few things.
Whether you want to delete the records in a table based on the count of rows (parameter)? irrespective of which 10 or 40 records to be deleted.
Below link has the sample stored procedure to delete the records (result of search query) from the table.
https://technet.microsoft.com/en-us/library/ms189634(v=sql.105).aspx
Hope it will solve your issue.
Accepted
0
Nigel Fernandes

Nigel Fernandes

NA 4k 138.9k 8y
Another approach you can take is schedule the deletion of rows during a time when database is not used.
Example during Night.
Then you would not need to implement any extra logic.
But use this, only if deletion can be done later.
0
Nepethya Rana

Nepethya Rana

NA 335 20.1k 8y
CREATE PROCEDURE spDeleteRecord
@DeleteBatchSize INT,
@DelayTime DATETIME
AS
BEGIN
SET NOCOUNT ON;
DECLARE @DeleteRowCount INT
SET @DeleteRowCount = 1

WHILE (@DeleteRowCount > 0)
BEGIN
BEGIN TRANSACTION
DELETE TOP(@DeleteBatchSize) SchemaTableName;
SET @DeleteRowCount = @@ROWCOUNT;
PRINT @DeleteRowCount;
COMMIT
WAITFOR DELAY @DelayTime
END
END
GO
0
Dhananjay Kumar

Dhananjay Kumar

NA 1.1k 8.7k 8y
https://sqlperformance.com/2013/03/io-subsystem/chunk-deletes