Send Multiple attachment using sp_send_db_mail sql server - sql-server-2014

Can anyone advise if I can send multiple attachments using sp_send_db_mail in sql server 2014, I've 2 files and file names are dynamic so i'm picking the files with variables. Here's what I'm using:
#file_attachments = #filename;#filename1 which says incorrect syntax. However it works fine with one attachment .

Related

SSIS send ftp files from a list in a text file

My job is to get files from an ftp folder, and take only the files that have Day-1 data and send those files to another ftp folder.
I was told to do this via SSIS.
Here's what I did :
Transfer all the files from the ftp to my local machine.
Get the names of all the files and store them into a sql server Table.
Check wether the name of the file corresponds to Yesterday's date.
If so, store the filename in another sql server Table.
Finally, read the finale sql table, get the rows that contain the name of files to be sent, and sent them.
I got stuck in Step 5 ! I have no idea what to do I even think there's no way to do it.
Any ideas ?

Is it possible ? I want to read the data from active directory and insert into sql server table using SSIS

I have a client requirement in that i need to read the data from active directory server and populate these data to sql server table using SSIS(Or any other approach)
I have
1.Active directory server name
AD login details
Powershell script which they used to pull the required fields manually .
I refer below post but its not working for me.
https://dataqueen.unlimitedviz.com/2012/05/importing-data-from-active-directory-using-ssis/
Thanks

How to load HTML data into SQL Server (non-table format)?

I'm posting it here because I couldn't' find any such scenario on the web so far. I have a webpage which contains a set of reports both in XLS and PDF formats. I should be downloading the excel files from the page and load into my database. I wish I could use the URL for XLS file directly but the problem is the naming convention may keep changing every time (Sales_Quarter1.xlsx can be Sales_Q1.xlsx the next year). The only thing that would be constant in the following example is "Sales for Calendar Year". I should be looking up for the file that corresponds to this text and download it before loading it into database table.
I would like to know from experts if this would be possible?
<li>
<sub>Sales for Calendar Year 2015--All Countries </sub>
<a href="/Data/Downloads/Documents/Sales/Sales_Quarter1.xlsx">
<sub>[XLS]</sub></a><sub> , <sub>[PDF]</sub><sub>​</sub></sub>
</li>
PS: I am using SQL Server 2014.
Thanks!
Have a look at Integration Services. Create a package for both pulling the web page using a script task, along with a variable name that will represent your downloaded, local filenames for the html file and excel files (you will also have to parse the link out of the html file). Then utilize an Excel Source next in your package.
The variable name for the excel file used in the script task will need to be set to ReadWrite as well.
You can also schedule the resulting package execution via SQL Agent job, if you plan to run this on a reoccurring basis, placing logic into the script or the execution paths,

adding text to an xls file with bash script

I'm trying to understand if it's possible to write to an xls file with a bash script. Situation is outlined below.
I have a cronjob that runs every monday and generates an xls and emails to my client. This xls is filled with data from a MySQL DB. when the report is empty and the client attempts to open it, it shows as corrupt. Originally I addressed this issue by excluding empty files from the email with an if statement. However, the constraint is that all 4 reports much reach the client - empty or not.
So my question is, can I simply add a row of text at the top with a bash script so the file never "empty"? I'm not an expert in bash scripting by any means, so feedback here would be great. thanks!
Tony
I'm not aware of any pure bash implementation for writing XLS files. There are solutions in other languages such as Perl, Python, or PHP. If you think outside the box there is another option available to you. You mentioned that you currently use an if statement to not attach empty files. Create a blank spreadsheet in a program like MS Excel, optionally enter some text in A1 like "No records", save it, and transfer that to a known location on the server that runs the cronjob. Rather that skipping the attachment, whenever you detect an empty file in your if statement just attach the blank "No records" template XLS file. You may need to copy the template to a temporary location before attaching if you need to rename the file.

Cannot open .accdb files because Access looking for hard-coded path

I have received a few .accdb files from a client, and I am trying to open them in Microsoft Access 2013. The files seem to open correctly, but whenever I click on any of the tables or queries on the left I get the following error message:
C:\[hard-coded path on client's computer] is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
Now, I know that the path does not exist on my computer. But why is Access looking for a hard-coded path on another person's computer? And how can I access the tables and queries in Access?
Additional question: Is there an easy way to import the data to SQL Server instead? I read a couple of posts about importing data from Access to SQL Server, but apparently the SQL Server Import and Export Wizard is expecting a file of a different format, not .accdb.
Thanks in advance.
You need to get the back-end database file from your client. All the tables are stored there. Once you receive it, save it at a convenient location on your computer and use the "Linked Table Manager" on the "External Data" tab in the .accdb you already have. That will allow you to update the table links for the current location of the back-end database file on your system.