Showing posts with label schema. Show all posts
Showing posts with label schema. Show all posts

Thursday, March 8, 2012

about XML View Function.

I Know that we can show the view that it is made by Singleton XML Schema.

But I want to show a view what it is made by NO Singleton XML Schema.

Please let me know that if you have any knowledges.

Thanks for you.

just try it like this

Content of XML-Field:

<MyParameters>

<Parameter>

<ParaNr></ParaNr>

<ParaText></ParaText>

</Parameter>

<Parameter>

<ParaNr></ParaNr>

<ParaText></ParaText>

</Parameter>

<Parameter>

<ParaNr></ParaNr>

<ParaText></ParaText>

</Parameter>

</MyParameters>

Statement for the Query (My_ID is just another nonXML column of the table):

SELECT MY_ID

ref.value('./ParaNr', 'nvarchar(2)') AS [PARA_NR],

ref.value('./ParaText', 'nvarchar(200)') AS [PARA_TEXT]
FROM MY_SCEMA.MY_TABLE

CROSS apply MY_XMLCOLUMN.nodes('/MyParameters/Parameter') AS T (ref)

I Hope this helps

best regards

Raimund

about XML View Function.

I Know that we can show the view that it is made by Singleton XML Schema.

But I want to show a view what it is made by NO Singleton XML Schema.

Please let me know that if you have any knowledges.

Thanks for you.

just try it like this

Content of XML-Field:

<MyParameters>

<Parameter>

<ParaNr></ParaNr>

<ParaText></ParaText>

</Parameter>

<Parameter>

<ParaNr></ParaNr>

<ParaText></ParaText>

</Parameter>

<Parameter>

<ParaNr></ParaNr>

<ParaText></ParaText>

</Parameter>

</MyParameters>

Statement for the Query (My_ID is just another nonXML column of the table):

SELECT MY_ID

ref.value('./ParaNr', 'nvarchar(2)') AS [PARA_NR],

ref.value('./ParaText', 'nvarchar(200)') AS [PARA_TEXT]
FROM MY_SCEMA.MY_TABLE

CROSS apply MY_XMLCOLUMN.nodes('/MyParameters/Parameter') AS T (ref)

I Hope this helps

best regards

Raimund

Thursday, February 9, 2012

about clone database schema problem

Hi :
If I want to do the follow :
I create 2 database in localhost
one is dev_db
one is clone_db
Where dev_db have data in the database, but clone_db is just a data
structure but need to synchronize with dev_db schema.
If I add table in dev_db , clone_db will auto add same table structure from
dev_db.
If I change the column (include add, change data type), clone_db will auto
to change.
If I change the script (both view, stored procedure, view, user define
function and trigger), , clone_db will auto to change.
Base on above situation, can sql server 2K do this ?
and how to set ?
Thanks for your helpTom
To get a 'clone' you can generate a sql script of all objects. But SQL
Server cannot add automaticly each object that was created in the X
database to the Y database. You will have to write a script to do the job.
"Tom" <pclan@.tomgroup.com> wrote in message
news:eLp4DZNYFHA.2380@.tk2msftngp13.phx.gbl...
> Hi :
> If I want to do the follow :
> I create 2 database in localhost
> one is dev_db
> one is clone_db
> Where dev_db have data in the database, but clone_db is just a data
> structure but need to synchronize with dev_db schema.
> If I add table in dev_db , clone_db will auto add same table structure
from
> dev_db.
> If I change the column (include add, change data type), clone_db will auto
> to change.
> If I change the script (both view, stored procedure, view, user define
> function and trigger), , clone_db will auto to change.
> Base on above situation, can sql server 2K do this ?
> and how to set ?
> Thanks for your help
>|||There are also some good third-party tools out there that will allow you to
script out "diffs" between two databases and configurable as to what you
consider differences: DDL only, DML only, and/or both DDL and DML, not to
mention security.
RedGate is one of these, but there are several.
Good luck.
Sincerely,
Anthony Thomas
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uyQh75OYFHA.2420@.TK2MSFTNGP12.phx.gbl...
Tom
To get a 'clone' you can generate a sql script of all objects. But SQL
Server cannot add automaticly each object that was created in the X
database to the Y database. You will have to write a script to do the job.
"Tom" <pclan@.tomgroup.com> wrote in message
news:eLp4DZNYFHA.2380@.tk2msftngp13.phx.gbl...
> Hi :
> If I want to do the follow :
> I create 2 database in localhost
> one is dev_db
> one is clone_db
> Where dev_db have data in the database, but clone_db is just a data
> structure but need to synchronize with dev_db schema.
> If I add table in dev_db , clone_db will auto add same table structure
from
> dev_db.
> If I change the column (include add, change data type), clone_db will auto
> to change.
> If I change the script (both view, stored procedure, view, user define
> function and trigger), , clone_db will auto to change.
> Base on above situation, can sql server 2K do this ?
> and how to set ?
> Thanks for your help
>

about clone database schema problem

Hi :
If I want to do the follow :
I create 2 database in localhost
one is dev_db
one is clone_db
Where dev_db have data in the database, but clone_db is just a data
structure but need to synchronize with dev_db schema.
If I add table in dev_db , clone_db will auto add same table structure from
dev_db.
If I change the column (include add, change data type), clone_db will auto
to change.
If I change the script (both view, stored procedure, view, user define
function and trigger), , clone_db will auto to change.
Base on above situation, can sql server 2K do this ?
and how to set ?
Thanks for your help
Tom
To get a 'clone' you can generate a sql script of all objects. But SQL
Server cannot add automaticly each object that was created in the X
database to the Y database. You will have to write a script to do the job.
"Tom" <pclan@.tomgroup.com> wrote in message
news:eLp4DZNYFHA.2380@.tk2msftngp13.phx.gbl...
> Hi :
> If I want to do the follow :
> I create 2 database in localhost
> one is dev_db
> one is clone_db
> Where dev_db have data in the database, but clone_db is just a data
> structure but need to synchronize with dev_db schema.
> If I add table in dev_db , clone_db will auto add same table structure
from
> dev_db.
> If I change the column (include add, change data type), clone_db will auto
> to change.
> If I change the script (both view, stored procedure, view, user define
> function and trigger), , clone_db will auto to change.
> Base on above situation, can sql server 2K do this ?
> and how to set ?
> Thanks for your help
>
|||There are also some good third-party tools out there that will allow you to
script out "diffs" between two databases and configurable as to what you
consider differences: DDL only, DML only, and/or both DDL and DML, not to
mention security.
RedGate is one of these, but there are several.
Good luck.
Sincerely,
Anthony Thomas

"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uyQh75OYFHA.2420@.TK2MSFTNGP12.phx.gbl...
Tom
To get a 'clone' you can generate a sql script of all objects. But SQL
Server cannot add automaticly each object that was created in the X
database to the Y database. You will have to write a script to do the job.
"Tom" <pclan@.tomgroup.com> wrote in message
news:eLp4DZNYFHA.2380@.tk2msftngp13.phx.gbl...
> Hi :
> If I want to do the follow :
> I create 2 database in localhost
> one is dev_db
> one is clone_db
> Where dev_db have data in the database, but clone_db is just a data
> structure but need to synchronize with dev_db schema.
> If I add table in dev_db , clone_db will auto add same table structure
from
> dev_db.
> If I change the column (include add, change data type), clone_db will auto
> to change.
> If I change the script (both view, stored procedure, view, user define
> function and trigger), , clone_db will auto to change.
> Base on above situation, can sql server 2K do this ?
> and how to set ?
> Thanks for your help
>

about clone database schema problem

Hi :
If I want to do the follow :
I create 2 database in localhost
one is dev_db
one is clone_db
Where dev_db have data in the database, but clone_db is just a data
structure but need to synchronize with dev_db schema.
If I add table in dev_db , clone_db will auto add same table structure from
dev_db.
If I change the column (include add, change data type), clone_db will auto
to change.
If I change the script (both view, stored procedure, view, user define
function and trigger), , clone_db will auto to change.
Base on above situation, can sql server 2K do this ?
and how to set ?
Thanks for your helpTom
To get a 'clone' you can generate a sql script of all objects. But SQL
Server cannot add automaticly each object that was created in the X
database to the Y database. You will have to write a script to do the job.
"Tom" <pclan@.tomgroup.com> wrote in message
news:eLp4DZNYFHA.2380@.tk2msftngp13.phx.gbl...
> Hi :
> If I want to do the follow :
> I create 2 database in localhost
> one is dev_db
> one is clone_db
> Where dev_db have data in the database, but clone_db is just a data
> structure but need to synchronize with dev_db schema.
> If I add table in dev_db , clone_db will auto add same table structure
from
> dev_db.
> If I change the column (include add, change data type), clone_db will auto
> to change.
> If I change the script (both view, stored procedure, view, user define
> function and trigger), , clone_db will auto to change.
> Base on above situation, can sql server 2K do this ?
> and how to set ?
> Thanks for your help
>|||There are also some good third-party tools out there that will allow you to
script out "diffs" between two databases and configurable as to what you
consider differences: DDL only, DML only, and/or both DDL and DML, not to
mention security.
RedGate is one of these, but there are several.
Good luck.
Sincerely,
Anthony Thomas
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:uyQh75OYFHA.2420@.TK2MSFTNGP12.phx.gbl...
Tom
To get a 'clone' you can generate a sql script of all objects. But SQL
Server cannot add automaticly each object that was created in the X
database to the Y database. You will have to write a script to do the job.
"Tom" <pclan@.tomgroup.com> wrote in message
news:eLp4DZNYFHA.2380@.tk2msftngp13.phx.gbl...
> Hi :
> If I want to do the follow :
> I create 2 database in localhost
> one is dev_db
> one is clone_db
> Where dev_db have data in the database, but clone_db is just a data
> structure but need to synchronize with dev_db schema.
> If I add table in dev_db , clone_db will auto add same table structure
from
> dev_db.
> If I change the column (include add, change data type), clone_db will auto
> to change.
> If I change the script (both view, stored procedure, view, user define
> function and trigger), , clone_db will auto to change.
> Base on above situation, can sql server 2K do this ?
> and how to set ?
> Thanks for your help
>