SQL Server: Read data from URL Text File - sql

I am looking for a way to read a data from URL and store it in a Table or a variable in SQL Server.
http://10.10.1.10/data/data.txt
The data in this URL will be like this 746473
The URL will have only one data at any point of time
Is it possible to capture this and store it against a variable or to a table. For guidance please.

It's possible but do you really want to open database in a such way?
Just read the data using another language like node.js or C# and call the T-SQL code then.
You can use use SSIS for such task or use some kind of CLR component. It's more complicated for sure then reading the data with node.js and inserting into a database.
I am advising to reconsider.

Related

Having a data upload get "picked up" by SQL Server?

I need to transfer some data over to another location so that it can get "refreshed" in their database system (SQL Server).
I'm a little unfamiliar with this, is SQL server able to refresh its own internal tables based on anything? For instance is it able to recreate/refresh tables based on the contents of .CSV files? Or would I need to move the data over in the form of a small Access database with tables or something similar?
What is the "correct" way to do something like this where you need to refresh the data of another server based on the content you have somewhere else?
Best way would be to use SSIS as Brad suggested.
But if you are not familiar with SSIS packages then you can opt for simple sql server job to upload data from csv files periodically. Please have a look in below links:
Schedule import csv to SQL Server 2014 Express edition
https://answers.laserfiche.com/questions/74591/Auto-Import-csv-into-SQL-Table

Dynamically writing subject in send mail task in ssis

Sorry if the question is already asked.
I have created a ssis package which loads the data from excel file to sql server database.
I logged this information in sql server 'SYSSSISLOG' table using the logging feature in ssis.
Here i need to send the information that was captured in SYSSSISLOG table using send mail task.
How can i achieve this without using script task,because i am not good in writing c# code.
Thanks in advance.
Put the information into a variable and use the variable in the send mail task.
If you don't already have this information in a variable, and can't get it in your current dataflow depending on what type of logging you're using. you could select the data from your log table with a sql task and return the result as a variable.

Retrieve XML Code by API with Automatic Approach

Goal:
Retrieve a XML list from Internet, using API connection, and transfer the data into a sql server's table automatic using Scheduling tool with SQ server agent and its jobs.
Problem:
I have two questions:
What component in SSIS do I need to retrieve the XML file, using API connection?
Is it possible to use stored procedure, code that retrieve and transform the xml file and its data, to transfer it into a table? In This context, no usage of SSIS.
Information:
*The computers version is SQL 2008 R2 standard edition.
If everything is straightforward, I would use Web Service Task. If not, use the Script Task and take care of API Connection in C# code. See this link.
Yes. to avoid SSIS, you need to create a CLR Stored Procedure. See this link.

Get the duration of T-SQL VARBINARY audio in SQL or VB.Net

I've found solutions to determine the length of an audio file using WMPLib.WindowsMediaPlayer (which seems quite ugly), by using a physical file path, but nothing to determine the duration of an audio file stored in a VARBINARY field (SQL Server 2008 R2).
I'm using .Net WebForms. Maybe it'd be a better idea to do this client side with jQuery, but what if I only want to expose some controls to the web browser based off of the duration?
follow these links to implement your functionality:
you can implement these in your vb.net code not in tsql. May be possible using CLR UDF/stored procedures in sql server, but not confirm about this.
just read files from database and get the information about the media as here are the links to read the meta information of MP3 files etc.
hope you will get some idea from these ..
http://www.developerfusion.com/code/4684/read-mp3-tag-information-id3v1-and-id3v2/
http://www.codeproject.com/KB/audio-video/mpegaudioinfo.aspx
http://rongchaua.net/blog/c-how-to-read-mp3-header/
http://www.developerfusion.com/code/4684/read-mp3-tag-information-id3v1-and-id3v2/

SQL How can I convert MD5 Hash String to Binary using query?

In my project, I have a user table where password is MD5 hashed and stored as binary(16). Now I want to write those user data as INSERT queries to a .sql file so that customer can import them back again?
Or is there anyway to export those data directly? I tried DTS using from Excel to Access file but when importing, there are several errors occur that I don't know why? Or is there any other tool besides MSSQL Server that can do this?
So far, now I'm using detach/attach the whole database to send to the customer which I think is not really a good way?
Thanks,
Someone posted an answer to my question and deleted it right away? He suggested me to use HASHBYTES which is exactly what I'm looking for. Thanks!