Showing posts with label user. Show all posts
Showing posts with label user. Show all posts

Monday, March 26, 2012

Importing Sqldatabase and Publishing it

HI,

I am working on a project in which a user can upload his database to the server...then he is able to view all the schema or execute any kind of query. Then he goes to some other machine and login and wants to download the database.

For example Alex have uploaded the database consisting of 1000 records to mysite. Then He goes to texas to find some oil wells. He is on another machine ... I download the database ... inseert new records and upload it back.

Its an example basically I want to know how to include the users' uploaded into my sqlserver and when required publish with data on his machine...

Thanks.

I suppose you're thinking about some disconnected scenario where you can upload a scheme, edit some rows, travel to a desert or mountain top, find oil, edit some rows offline and then synchronize the data with the server version. As far as I can see, you'll be needing a shared centralized SQL server and a personal/express edition on (let's say) a laptop. You can easily work offline and synchronize the two machines online either by replication or programmatically through a .NET application.

But since you're talking about a database with 1000 rows, you're thinking more of tables than databases. If this is true, you may consider exporting XML documents (with 1000 rows), edit the XML document (as if it were a real table) and upload the XML document later so the data can be synchronized. This is quite easy and commonly used. You can set up a database (many tables) where your customers can up- and download XML documents. You can use ASP.NET or SQL2005 to do the translation from XML to native data and back.

Greetings,

Robert

|||

Basically i am creating a web site where you will upload your database and then all the queries will be executed their.

Problem is your Databse should now be attached to my SQL Server. Attaching it programmatically is the basic problem right now. and then next when you want to download it to your local machine detaching it and publishing with data is my problem.

I tried my best to clear my problem...i think its clear now??

can you help on it.

Thanks

|||

Hi,shehbazbashir is not online. Last active: 04-23-2007, 6:54 AM

According to your question, I think that you should write a .sql file which can restore and backup the database and run it in the query analyzer. So you can download or upload the backup file and attach it to the SqlServer.

Hope it helps.

|||Thanks It workedBig Smile

Monday, March 12, 2012

Importing DB from Another Install

I have a MS SQL database generated from another user and
sent to me via email. I am trying to import it into my
install of SQL Server 2000. The two approaches I have
tried have not worked, but maybe I am missing a trick.
1) Set up tables with the query analyzer and use the
import wizard under All Tasks >> Import. Even after
registering the datasource for import in ODBC Datasources
control panel, the db for import does not appear in the
list of datasources for import with this wizard.
2) Create a new blank database and copy the datafile for
import to the directory indicated as the location of the
blank database datafile. When I do this the database is
greyed out in Enterprise Manager and marked 'suspect'. No
tables are viewable under the database after copying.
I've also tried this approach after setting up the table
structure with the Query Analyzer.Jennifer,
Short answer: search the SQL Server 2000 Books Online for the section
"Attaching and Detaching a Database"
Longer answer ... and assuming that you have Enterprise Manager and that
your user has sent you **both** the data (.mdf) and log (.ldf) files:
In EM: right-click the "Databases" folder: All Tasks | Attach Database
Chief Tenaya
"Jennifer Sanders" <anonymous@.discussions.microsoft.com> wrote in message
news:e7d601c41022$fe75ec10$a601280a@.phx.gbl...
> I have a MS SQL database generated from another user and
> sent to me via email. I am trying to import it into my
> install of SQL Server 2000. The two approaches I have
> tried have not worked, but maybe I am missing a trick.
> 1) Set up tables with the query analyzer and use the
> import wizard under All Tasks >> Import. Even after
> registering the datasource for import in ODBC Datasources
> control panel, the db for import does not appear in the
> list of datasources for import with this wizard.
> 2) Create a new blank database and copy the datafile for
> import to the directory indicated as the location of the
> blank database datafile. When I do this the database is
> greyed out in Enterprise Manager and marked 'suspect'. No
> tables are viewable under the database after copying.
> I've also tried this approach after setting up the table
> structure with the Query Analyzer.|||I found out it's a backup file.
>--Original Message--
>Jennifer,
>Short answer: search the SQL Server 2000 Books Online for
the section
>"Attaching and Detaching a Database"
>Longer answer ... and assuming that you have Enterprise
Manager and that
>your user has sent you **both** the data (.mdf) and log
(.ldf) files:
>In EM: right-click the "Databases" folder: All Tasks |
Attach Database
>Chief Tenaya
>
>"Jennifer Sanders" <anonymous@.discussions.microsoft.com>
wrote in message
>news:e7d601c41022$fe75ec10$a601280a@.phx.gbl...
Datasources
No
>
>.
>

Importing databases in SQL 2005

I'm having a lot of trouble importing/moving databases between SQL2005
servers.
-If i detach/copy files/attach, I get user security problems (ie. user
defined in database "does not exist" on new server, but cannot be removed
from database as owns schemas etc.)
-Same with Backup/restore
-If I try to copy or import data after creating a "blank" database with only
the user ID in question as dbo, I lose primary keys.
All actions are being performed through Management Console with the SQL
admin ID. Most databases are running in 2000 compatability mode following the
recent upgrades. Servers are not on Active Directory.
Can someone give me some hints about how to migrate databases?
Seems that some Login of the Source Server is not existing on the Target
Server. If it is so, then first create those Logins on the Target Server and
then try the Backup/Restore method.
"The Vogon" wrote:

> I'm having a lot of trouble importing/moving databases between SQL2005
> servers.
> -If i detach/copy files/attach, I get user security problems (ie. user
> defined in database "does not exist" on new server, but cannot be removed
> from database as owns schemas etc.)
> -Same with Backup/restore
> -If I try to copy or import data after creating a "blank" database with only
> the user ID in question as dbo, I lose primary keys.
> All actions are being performed through Management Console with the SQL
> admin ID. Most databases are running in 2000 compatability mode following the
> recent upgrades. Servers are not on Active Directory.
> Can someone give me some hints about how to migrate databases?
|||Thanks for the reply... I'll try that again and let you know...
"Absar Ahmad" wrote:
[vbcol=seagreen]
> Seems that some Login of the Source Server is not existing on the Target
> Server. If it is so, then first create those Logins on the Target Server and
> then try the Backup/Restore method.
> "The Vogon" wrote:

Importing databases in SQL 2005

I'm having a lot of trouble importing/moving databases between SQL2005
servers.
-If i detach/copy files/attach, I get user security problems (ie. user
defined in database "does not exist" on new server, but cannot be removed
from database as owns schemas etc.)
-Same with Backup/restore
-If I try to copy or import data after creating a "blank" database with only
the user ID in question as dbo, I lose primary keys.
All actions are being performed through Management Console with the SQL
admin ID. Most databases are running in 2000 compatability mode following th
e
recent upgrades. Servers are not on Active Directory.
Can someone give me some hints about how to migrate databases?Seems that some Login of the Source Server is not existing on the Target
Server. If it is so, then first create those Logins on the Target Server and
then try the Backup/Restore method.
"The Vogon" wrote:

> I'm having a lot of trouble importing/moving databases between SQL2005
> servers.
> -If i detach/copy files/attach, I get user security problems (ie. user
> defined in database "does not exist" on new server, but cannot be removed
> from database as owns schemas etc.)
> -Same with Backup/restore
> -If I try to copy or import data after creating a "blank" database with on
ly
> the user ID in question as dbo, I lose primary keys.
> All actions are being performed through Management Console with the SQL
> admin ID. Most databases are running in 2000 compatability mode following
the
> recent upgrades. Servers are not on Active Directory.
> Can someone give me some hints about how to migrate databases?|||Thanks for the reply... I'll try that again and let you know...
"Absar Ahmad" wrote:
[vbcol=seagreen]
> Seems that some Login of the Source Server is not existing on the Target
> Server. If it is so, then first create those Logins on the Target Server a
nd
> then try the Backup/Restore method.
> "The Vogon" wrote:
>

Importing databases in SQL 2005

I'm having a lot of trouble importing/moving databases between SQL2005
servers.
-If i detach/copy files/attach, I get user security problems (ie. user
defined in database "does not exist" on new server, but cannot be removed
from database as owns schemas etc.)
-Same with Backup/restore
-If I try to copy or import data after creating a "blank" database with only
the user ID in question as dbo, I lose primary keys.
All actions are being performed through Management Console with the SQL
admin ID. Most databases are running in 2000 compatability mode following the
recent upgrades. Servers are not on Active Directory.
Can someone give me some hints about how to migrate databases?Seems that some Login of the Source Server is not existing on the Target
Server. If it is so, then first create those Logins on the Target Server and
then try the Backup/Restore method.
"The Vogon" wrote:
> I'm having a lot of trouble importing/moving databases between SQL2005
> servers.
> -If i detach/copy files/attach, I get user security problems (ie. user
> defined in database "does not exist" on new server, but cannot be removed
> from database as owns schemas etc.)
> -Same with Backup/restore
> -If I try to copy or import data after creating a "blank" database with only
> the user ID in question as dbo, I lose primary keys.
> All actions are being performed through Management Console with the SQL
> admin ID. Most databases are running in 2000 compatability mode following the
> recent upgrades. Servers are not on Active Directory.
> Can someone give me some hints about how to migrate databases?|||Thanks for the reply... I'll try that again and let you know...
"Absar Ahmad" wrote:
> Seems that some Login of the Source Server is not existing on the Target
> Server. If it is so, then first create those Logins on the Target Server and
> then try the Backup/Restore method.
> "The Vogon" wrote:
> > I'm having a lot of trouble importing/moving databases between SQL2005
> > servers.
> > -If i detach/copy files/attach, I get user security problems (ie. user
> > defined in database "does not exist" on new server, but cannot be removed
> > from database as owns schemas etc.)
> > -Same with Backup/restore
> > -If I try to copy or import data after creating a "blank" database with only
> > the user ID in question as dbo, I lose primary keys.
> >
> > All actions are being performed through Management Console with the SQL
> > admin ID. Most databases are running in 2000 compatability mode following the
> > recent upgrades. Servers are not on Active Directory.
> >
> > Can someone give me some hints about how to migrate databases?