Friday, February 10, 2012

Building / Modifying an SQL Database remotely

Hi Folks,

I should begin by saying I'm fairly new to SQL Server. I'm an application
developer who has built front ends atop Server, but have never done much in
the way of design / development.

My question is in two parts;

1). What is the best way to remotely "create" an SQL Server database? I've
been told that this can be done with SQL Statements, but thought that there
may be a way using XML.

2). Can I use this same method to propogate updates to the remote database
without affecting the data?

To give you a better idea of what I'm trying to do, I have a client that
lives quite a ways up north. I'm building an application that will be
installed up there. I'd like a method to be able to make changes to this
database on my end (the development copy), create an XML file of the
"database structure" and have the other database or application import this
XML file, and add tables, fields and relationships if they don't already
exist.

Any help would be appreciated.

Thanks!
RickRWC (rcollens_SPAMONATOR_@.hemmingway.com) writes:
> I should begin by saying I'm fairly new to SQL Server. I'm an
> application developer who has built front ends atop Server, but have
> never done much in the way of design / development.
> My question is in two parts;
> 1). What is the best way to remotely "create" an SQL Server database?
> I've been told that this can be done with SQL Statements, but thought
> that there may be a way using XML.

I don't know whether you can create databases and change metadata from
SQLXML. It does sound a bit akward to me, though. The normal way is
to use CREATE DATABASE, CREATE TABLE and that sort of SQL Statements.

> 2). Can I use this same method to propogate updates to the remote database
> without affecting the data?

You mean changes to the metadata? Normally, the point with updates is
to affect the data? :-)

Composing an update script is a task that requires care. For simple
changes it may be as easy as a couple of ALTER TABLE statements. For
complex changes, it may be a task that requires quite some development.
Whatever you do, careful testing is needed before you do it in the
live databaase.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

No comments:

Post a Comment