I have a column that can accept only .xls sheet. And I want to know how how we can store from the uploaded file in SQL Server.
There are many different ways based on how you plan to access it once it's there. Here are the recommended ways from Microsoft (https://support.microsoft.com/en-us/kb/321686)
SQL Server Data Transformation Services (DTS)
Microsoft SQL Server 2005 Integration Services (SSIS)
SQL Server linked servers
SQL Server distributed queries
ActiveX Data Objects (ADO) and the Microsoft OLE DB Provider for SQL Server
ADO and the Microsoft OLE DB Provider for Jet 4.0
The techniques for each method are described in the article (or you can google them). If you just need to keep the file for download, you could just load the excel file into a VARBINARY column.
Depends on the database you will use, but generally binary files will be stored as BLOBs:
http://en.wikipedia.org/wiki/Binary_large_object
I recommend against doing this if you can avoid it though.
Related
I would like to connect Firebird db to my SQL Server database. Purpose of this is that I want the SQL Server database refreshed with Firebird data every night, so obviously make a job.
I looked around and saw a lot of tools and drivers that you need to get in order for this to work, and when I looked at them, they are ether a work in progress or a scam.
Does anyone have any ideas how to do this reliably?
Use SQL Server Integration Services (SSIS) that runs a job in SQL Agent. SSIS supports any OLE-DB or ODBC data source, just set your SQL Server instance as the destination.
Here's an example using Firebird, SSIS and InterBase - but you can skip the parts for InterBase: https://www.ibprovider.com/eng/documentation/ssis_firebird_interbase.html
I was wondering if this is possible: I want to create 2 tables in an Azure SQL database which I want to use as staging tables for some data selected from a SQL Server 2005 database on an on-premise server.
Is there any good way of doing this?
Update:
Followed the Linked-Server Guide and got this error: I need to add a linked server to a MS Azure SQL Server
The weird thing is i just managed to login to the Azure DB on with Those exact credentials. Am i missing some security configuration somewhere?
You don't necessarily need to create a linked server to move data from an on-premise SQL table to Azure SQL. Tools like SSIS come to mind, where a linked server isn't necessary. Or a tool like SSDT where you could use the Data Compare feature to move data. There is also Azure Data Factory.
Support for linked servers and distributed queries against a SQL Azure Database is a feature available since September 2012 as explained here. On my tests it does not work correctly on SQL 2012 and does not work on SQL Server 2008 R2 and earlier versions. You may need to upgrade to SQL Server 2014 to create a fully functional linked server.
Hope this helps.
We want to be able to query the Data Warehouse database from the SQL Server database both with the same server name in Azure. Select statements including the database name (e.g. select * from server.dbo.product) returns with error that a reference to the database and/or server name isn't supported in this version of SQL Server. There are articles on creating an external data source in the SQL Server database but we get error that the credentials don't have permission to perform this action.
Azure SQL (as of Azure SQL V12 in late-2016) does not support cross-database queries the same way that they do with a normal on-premises SQL Server (e.g. using the DatabaseName.schemaName.TableName syntax).
Given that Azure SQL and Azure Data Warehouse databases each reside in different physical servers it wouldn't work anyway, as the above syntax is intended for databases that all reside in the same server.
Azure SQL does support cross-database calls via the EXTERNAL DATA SOURCE feature, which we have in normal on-premises SQL Server already. This is documented here: https://azure.microsoft.com/en-us/blog/querying-remote-databases-in-azure-sql-db/
Note that performance won't be that great and you might be better-off doing the querying in your application code. For example complex JOINs which reduce data will run suboptimally.
I'm a newbie,Can you please specify any tools or methods for managing sql server database from sqlite or vice versa...or both,if possible..
What do you mean by managing? Neither MS SQL Server nor SQLite is a manager for SQL databases and specially not managers for each others.
For managing a SQL Server database, you can use SQL Server Management Studio.
For managing a SQLite database, you can use for example Firefox SQLite manager plugin
See also how to export from SQLite to SQL Server
Is it recommended to use two versions of SQL Server (2005 and 2008) for storing data of an application. We have a situation where we have an existing web application consuming SQL server 2005 as a database. Some enhancements in the application required us to solution a FILESTREAM data store. Now we have our data in SQL Server 2005 and associated FILESTREAM data in SQL Server 2008. Being very new to SQL Server I would like to ascertain how bad is this in terms of performance? How can we achieve atomicity across both the database versions, is it via using a linked server or some other mechanism? Any alternative solutions would be fine except that we just cannot migrate the existing application to SQL Server 2008.
To keep your transactions ACID, you can use distributed transactions at a stored procedure level, or from a code level using DTC (e.g. via a .net TransactionScope). DTC would need to be present on both SQL Servers, and on your App Server as well if you do the ACID from there. There is some overhead with DTC
Edit : You will also need to link the servers with sp_addlinkedserver and provide credentials with sp_addlinkedsrvlogin