SQL stored procedure to insert data into Mongo DB [closed] - sql-server

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
At present we got a windows service which runs a stored procedure to transfer data from one table to another. Now we need to change the stored procedure to transfer data from SQL table to Mongo collection. Could some one with Mongodb experience point me in right direction?

You will probably need to get the MongoDB .NET Driver and do one of the following:
Create a new application that connects to SQL Server, gets data from the desired table, and then connects to MongoDB to insert that data.
Create a SQLCLR Stored Procedure that reads from the desired table and connects to MongoDB to insert the data.
Option 2 is more of a drop-in replacement as it doesn't interfere with the current structure of the Windows Service, but it might take a little bit of work to get the MongoDB .NET driver working correctly inside of SQL Server (I have not tried it so I am not sure what requirements that particular code has).

Related

Most straightforward way to consolidate data from multiple different RDBMS systems into a queryable database [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I have few tables that I have to sync between 3 different RDBMS systems (PostgreSQL databases, a SQL Server and a Firebird Database).
Currently I simply connect to my Firebird database and pull the few relevant tables to my PostgreSQL database, but as databases change, new tables require querying and with the addition of a SQL Server database to the mix I feel this solution is ill fitting.
I've done some research on BI tools , but I still need to query data from this data source and show them inside a Windows Forms application.
PS: it's not a migration and I only need to query the data from these "satellite" databases
Using PostgreSQL as your hub, you can use Foreign Data Wrappers to reach out to the other two databases whenever a query wants their data. Then it will always be up to date, but performance might suffer compared to actually importing the data. For reaching SQL Server, you can use tds_fdw, and for firebird you can use firebird_fdw. I have never used either one of these, so this is just a starting point.
You could probably pick SQL Server as your hub and accomplish the same thing, it calls them "linked servers" rather than Foreign Data Wrappers, see for example.

How to set a column to today's date in SQL Server when user modifies another column in table in MS Access [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
My setup is as such. I have an MS Access front end which points to a linked table in SQL Server. Via the form, the user updates one of the fields in the linked table throughout the day. My query is how do I update another column with today's date whenever a user changes it manually in the MS Access front end?
Thanks in advance for your time and help.
There is a nice discusion of this problem here: Best way to implement a last-modified column in Sql Server 2005?
The accepted answer that time around was to use a TRIGGER.
There are lots of good reasons to avoid triggers (see http://devproconnections.com/sql-server/reasons-avoid-triggers). But auditing can be hard to achieve by other methods.

Is SQL written for SQLite interchangeable with SQL for an Access database? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have written a project in C# which currently uses a SQLite database with 7 tables. Now I made a little mistake in selecting my database and since the application is going to be accessed by multiple users (~100) on a network the SQLite solution won't work because only one user can write at a time.
Now I want to switch to an Access (2010) database but my question is:
If I create the Access database with the same scheme as my SQLite database, do I have to change any of the SQL statements that I have written in my application? Or does this work interchangeable?
Also some side notes of why I am switching to an Access database instead of something like a SQL Server... Time does not allow this and costs neither.
Does anyone know what the impact will be if I'd simply replace the SQLite database with the Access database. And are there any differences in the SQL for these two for simple queries? I'm using things like 'INNER JOIN, IS NULL, SUM, COUNT'.
Thanks in advance!
are there any differences in the SQL for these two for simple queries?
For the simplest of queries, not really. For example, the specific language features you mentioned (INNER JOIN, IS NULL, SUM, COUNT) will likely work without modification, with the possible exception that Access SQL often requires parentheses when a statement contains multiple JOINs (example here).
Does anyone know what the impact will be if I'd simply replace the SQLite database with the Access database.
That is impossible to predict without a complete code review. You will really just have to try it and see what (if anything) breaks.

how to create a new database after a trigger fired from a table [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I got a requirement from client to create a new database when somebody insert new record in a specific table. I want to have all the tables, stored procedure and other things in the new database from the current database.
I am planning to restore the current database with the new Name.
Can anybody tell me how to do this.
Although this seems a pretty strange thing to do, if you really have to then create an Agent job that simply restores the database from a backup. In the trigger, you could run the job with:
EXEC msdb..sp_start_job #job_name = 'JobName'
I imagine you also need to pass some parameters to that job. You can store those in a table in a database (preferably a central one).
Anyway, I'd be more in favor of creating the database from scripts (schema and data), since it's easier to maintain.

Scheduler Get Data From SQL Server to Oracle [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I want create a task as scheduler to get Data From SQL Server 2000 to Oracle ?
how i can do it ? thanks
This kind of processes are called ETL automation.
You should first write appropriate code accomplish the data transformation and extraction prior loading to other system. You have several options. One of them is using SQL. You may use either oracle to get data from SQL server or vice versa.
It is better to convert this code to a batch executable to able to run from command line.
Choose a scheduler to execute the job according to your business requirements.
Alternatives are cron for ux platforms, windows task scheduler for ms platforms, open source frameworks to implement your own (like quartz), open source products if you do not have budget or more professional commercial ones like TlosLite.
In Sql server you can create DTS job to transfer the data from SQL server table to Oracle table.Later using SQL server Agent,you can schedule this job.

Resources