.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

SQL Agent Jobstep output file contains automatically generated header

Posted By:      Posted Date: August 28, 2010    Points: 0   Category :Sql Server
Hi,   I've created a stored procedure that creates a script to create a number of objects within the database (based on what existing objects are in the database).  From Management Studio, this works fine, and the output is exactly as I want it.   I'm now trying to create a job that will execute this stored procedure, and deposit the results into a file somewhere on the server.  When the job runs, the script is created in the correct place and is essentially ok.   However, there are a couple of questions I'd like to ask.   Why does SQL Server Agent put a header at the top of the output file?  I was hoping to be able to use that output file 'as is' and execute it automatically to recreate my objects when required.  (Obviously, I can manually remove the header, but this is an inconvenience in this situation).  How do I stop it?   Also, when executed from SSMS, the output is correctly line-spaced.  But, the output from the scheduled job adds an extra line between each line of text, which is, again, inconvenient.  Why does it do this, and how can I prevent this (again, without manually editting the output)?   Any thoughts and help greatly appreciated.   Cheers Simon

View Complete Post

More Related Resource Links

Sql Server 2005 ( remove header information from query output file "Job 'bustd_Daily_Query_Output_1

Dear All,I have scheduled job for querying output & asve it into particuler folder....but in the top of file i getting the message like "Job 'bustd_Daily_Query_Output_13July09' : Step 1, 'Query1' : Began Executing 2009-07-13 16:32:06"I want to remove this & want output in txt file format without above header....RegardsRavendra Cindia

Non Delimited Header in a delimited output file



I have a requirement to make a delimited flat file from a data base table.  The table has some 20+ columns.   I totally understand how to accomplish this part.  What is a bit more  tricky is that I need to create a header row that is not delimited.  The final output would look something like this


$header –Opt1 –Opt2 20101005


PowerShell Agent.JobStep for SSIS with one or more configuration file??


Is it possible to script adding a sql agent job for an SSIS package that uses one or more configuration files?  I've spent the better part of the day searching forums and blogs for any examples, but all I can find is just default TSQL or stored proc jobs.  I have most of the script written to pull the appropriate information in, I just do not see how I can specify the configuration files for the job step.  And yes, I've even tried going through Visual Studio accessing that api to see if i can dig out the appropriate object/property to no avail...

Any help would be incredibly appreciated as this would make a huge step forward for our deployment process :)

---- UPDATE ----

I know this sounds odd, but I'm mostly asking because I can't even access a sql 2008 server right now to see what gets put into the step normally for the SSIS Package..I'm assuming all it's really doing in that step is a dtsexec with the appropriate switches, if this is the case, then I can probably just build the command out to pass in multiple configurations...?

how to automatically save new file into document library with a unique name or ID?

I've created a form using MS Word Document (2007) and lock it (protect it) so that users will be able to fill in the required fields.
then i've created a Content Type and uploaded the MS word form to be used as a template.

Then I've created a document library and enabled the content type and associate the above form for the library, so that when users click on New button the form will open.

everythings goes fine till here.

The problem is when users clicks on New and save the file back to the library, It doesn't save it with a unique name, instead it is over writting the existing one.
in other words, if employee 1 fill up the form and save it and later on employee 2 accessed the library and fill up a new form, he will overwrite what employee 1 has already saved!!

Is there a way to give every new created file a unique name? maybe (username+time)??

Tablix Header missing on last page of PDF output

Tablix Headers don't show on last page of PDF and TIFF output.   I've tried all things mentioned including installing SQL Server 2008 Cumulative Update# 7.   My issue is that I have a Tablix with some header rows that repeat fine until the last page.   On the last page they are hidden.  This appears to be true of PDF and TIFF output.  THere are other issues with Word output.   The standard HTML viewer works fine.   So its clearly a PDF renderer issue.  

FileStreamResult how to rename the output file?????

i have an action to return a pdf file in my controller,if the return file is for downloading, the following code can be used to modify filename successfully.HttpContext.Response.AddHeader("content-disposition", "attachment; filename=form.pdf");HOWEVER, i found that when the pdf file was returned to browser( rather than a pop up window to download), the filename always remain same as the action name! (when u right click file and try to save it on ur hard disk), i was wondering if there is a automatic way to rename the file rather than "right click" and "save as" manually.so  can anyone tell me how to rename the outputfile when it is shown in the browser?

customize list view table header css file

i need to make table header for my list to be red and on hover to get specific  image so all my site have the same appearence also i need this to reflect to the list view webpart thanks

FPT File Header (FoxPro)

Following is DBT File Header (Dbase DBF Memo Header) [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] private struct DBTHeader { public Int32 nextBlockID; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public byte[] reserved1; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)] public string fileName; public byte version; // 0x03 = Version III, 0x00 = Version IV [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public byte[] reserved3; public Int16 blockLength; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 490)] public byte[] reserved4; } [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] private struct MemoHeader { [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public byte[] reserved; public Int16 startPosition; public Int32 fieldLength; } i required FoxPro FPT File Header. Following link is description of  FPT File Header but i can not under stand how is it use in C#. http://www.clicketyclick.dk/databases/xbase/format/fpt.html Please Help Me. Thanks   Please "Mark as Answer" if this post answered your question. :) Kalpesh Chhatrala | Software Developer | Rajkot | India Kalpesh 's Blog

Saving a generated text file

 I have an application that collects data and puts it in a text file.  When the data collection is complete the UI offers the user the opportunity to save or open the text file with a dialog box using this code: Response.Clear(); Response.ClearHeaders(); Response.AppendHeader("Content-Disposition", "attachment; filename=" + outputFilename + ";"); Response.Cache.SetCacheability(HttpCacheability.Private); Response.ContentType = "text/plain"; Response.WriteFile(outputFilePath + outputFilename); Response.End(); Response.Flush(); The problem is this.  The starting interface allows the user to select a large number of data gathering points.  If all are selected the program will run for about 90 minutes.  Sometimes it will present the dialog box, sometimes not.  Sometimes it will present the dialog box, but regardless of whether the user selects save or open, the dialog box simply disappears, and the data text file is neither displayed nor saved to the client system. When fewer data gather points are selected, and the program runs for 15 minutes or less, there is no problem.  The resulting data can be saved or displayed. The actual data text file is initially stored in the temporary path directory on the web server.  On at least one occasion, where the dialog box disappeared, I was able to

Create zip file of dyanamicaly generated Excel sheet in c#

hi all,   I want to give product details in excel sheet but that excel sheet should be zipped and then pass it to user. I know how to create excel sheet from database but  how to pass that excel sheet into folder and then zip that folder..?   plz giv me any solution 

Has anyone tried to import an XML file generated by PPT into SQL?

I'm trying to take the XML that is generated by a "Save As" from PPT 2007 and import that into SQL. My goal is to be able to capture the appropriate records for the presentation, slides, and images and have them stored and accessible. When I try follow the directions found here: http://www.sql-server-performance.com/articles/dba/Loading_XML_data_into_SQL_Server_2008_p1.aspx I run into a problem that the XML contains multiple namespaces. Any help would be greatly appreciated!

How do you freeze the tablix header row in an Excel export file in SSRS 2008?

So this is totally killing me. I've found out how to make a tablix header row repeat on each page of a PDF export file in SSRS 2008 (which I won't even get started on because all I can say is that 2005 is way better), but I cannot figure out how to make a simple header row of a tablix freeze in an Excel export file.  The tablix is right at the top of the body and spans the entire width of the design area.  How in the world do you get it to freeze in the Excel export file?

Output Blank Text File

Hello all,I have come across an interesting edge case when using Response.Write. I couldn't find another forum to post this in, so I'm putting it here, even though its not really "getting started" in my mind.The scenario goes like this:I have a ASPX page that stores data in a string using a comma delimited text format, which is then written to the response stream using Response.Write. Whenever there is data, this works fine. But, when there is no data, the string generated is empty and a basic HTML page structure magically appears in the output even though it isn't even in the .ASPX file. What I'd like to do is simply return a blank text file (not even a space).I've tried using Response.Clear to ensure that there is no content in the response stream. I've tried setting the content type and even specifying a filename in the response header. I am, of course, also using Response.End after the call to Response.Write, but all to no avail. The response is always a basic HTML structure.To eliminate other possibilities, I've set up a test. Just a default .ASPX Web form with the following PageLoad method: Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Response.ContentType = "text/plain" Response.Clear() Response.Write("") Response.End() End Sub

How do i force SharePoint to open file automatically during check out process?

Currently, when checking out a file (doc., excel, pdf etc.) in Sharepoint, i right click on doc. and click "check out". Then a window pops up and saying " you are about to check out:...." and i choose the option of saving the file in my Local Drafts Folder. The issue is that the file does not open automatically once i click "ok" in pop up window. I have go back to file in SharePoint and click on it again to open it. How do i force SharePoint to automatically open the file, when i go through the check it out process? Thank you all for your feedback.

Has anyone tried to import an XML file generated by PPT into SQL?

I'm trying to take the XML that is generated by a "Save As" from PPT 2007 and import that into SQL. My goal is to be able to capture the appropriate records for the presentation, slides, and images and have them stored and accessible. When I try follow the directions found here: http://www.sql-server-performance.com/articles/dba/Loading_XML_data_into_SQL_Server_2008_p1.aspx I run into a problem that the XML contains multiple namespaces. Any help would be greatly appreciated!

Save file automatically from server

I need to know the best way to have a user click a link that will download a file that is out on the server and save it to a specific location on their computer.  The file is a custom template for Microsoft Outlook signature.  Thus, it has to be in a certain folder and this folder will have a different location if the user has Windows 7 vs Windows XP. I wrote a ASP.NET page that captures the user that is logged in and use WebClient.DownloadFile to download the file.  However, I am getting an access is denied error.  Apparently my server doesn't have access to write to the user's folder.  My questions are. 1. How do I solve this and make it so that my server can write to the user's PC? 2. Is there a better way to roll out a custom Outlook template that the entire company should use?  Thank you,

Execute a SSRS Report from CRM using URL to output to PDF with a specific file name


We have a CRM installation from which I am trying to do some reports which use the CRMAF filters so the reports are sensitive to entitiy selections.

eg execute a sales report for a number of selected accounts.

The specific RDLs have been created in VS2008 and uploaded to the reporting server via the Report import tools within CRM and all work as expected however the output of the report is in HTML via the web browser.

I have changed the configuration of the report in CRM so that it uses the URL method like below so that the report is rendered into PDF which is great.



This method prompts for the user to open/save the PDF file which is acceptable however I would like to replace the default file name (which is the report name) with one of my own.

For example rather

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend