Wednesday, March 21, 2012
Script the difference between two database having same structure but different d
I want to find out the Script for the difference between two database having same structure but different data.
The problem is SQL server does the differential data backup only on the database last backed up, but if i want to find out the difference between the data in two databases and update the old database with the values of the latest database, it doesn't allow to do so.
Is there any other way of doing this task.
Thanks
AmuI know few of the third party tools can offer this functionality that would cater your needs, may refer to this link (http://www.sql-server-performance.com/lockwoodtech_sqldiff_spotlight.asp) for more information.
HTHsql
Tuesday, March 20, 2012
script structure and data tool
i need a tool, to do a script of my database, BUT, not only the database
structure but also the data. The tool, should also create the insert
lines for data.
Anyone knows where to find something with similar features, Free or cheap ;)
thank you
Hi,
Database structure can be extraced using SQl Server Enterprise manager --
Click database-- All tasks -- Generate SQl scripts.
For Insert statement , there a good from Vyas:-
http://vyaskn.tripod.com/code/generate_inserts.txt
Thanks
Hari
MCDBA
"John Zing" <johnzing2003@.yahoo.com> wrote in message
news:OqXQmjHWEHA.2408@.tk2msftngp13.phx.gbl...
> Hi,
> i need a tool, to do a script of my database, BUT, not only the database
> structure but also the data. The tool, should also create the insert
> lines for data.
> Anyone knows where to find something with similar features, Free or cheap
;)
> thank you
|||http://www.karaszi.com/SQLServer/inf...ate_script.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"John Zing" <johnzing2003@.yahoo.com> wrote in message news:OqXQmjHWEHA.2408@.tk2msftngp13.phx.gbl...
> Hi,
> i need a tool, to do a script of my database, BUT, not only the database
> structure but also the data. The tool, should also create the insert
> lines for data.
> Anyone knows where to find something with similar features, Free or cheap ;)
> thank you
|||John Zing wrote:
> i need a tool, to do a script of my database, BUT, not only the database
> structure but also the data. The tool, should also create the insert
> lines for data.
For a good schema comparison tool check out:
http://www.berryware.com/sqlmatcher/
It doesn't do the data comparison just yet... but that'll be coming
soon. :-) We've just added full Unicode support if that's important to
you... you can try out the 2.1 Beta for free in the meantime.
Regards,
Kevin.
|||Have you tried sqlXpress Script from sqlXpress http://www.sqlxpress.com
Bryan
"John Zing" <johnzing2003@.yahoo.com> wrote in message
news:OqXQmjHWEHA.2408@.tk2msftngp13.phx.gbl...
> Hi,
> i need a tool, to do a script of my database, BUT, not only the database
> structure but also the data. The tool, should also create the insert
> lines for data.
> Anyone knows where to find something with similar features, Free or cheap
;)
> thank you
|||Have you tried sqlXpress Script from sqlXpress http://www.sqlxpress.com
Bryan
"John Zing" <johnzing2003@.yahoo.com> wrote in message
news:OqXQmjHWEHA.2408@.tk2msftngp13.phx.gbl...
> Hi,
> i need a tool, to do a script of my database, BUT, not only the database
> structure but also the data. The tool, should also create the insert
> lines for data.
> Anyone knows where to find something with similar features, Free or cheap
;)
> thank you
|||Hi,
try http://www.sqlscripter.com to script your data.
You can create INSERT, UPDATE and DELETE code,
it's free.
Thomas
"John Zing" wrote:
> Hi,
> i need a tool, to do a script of my database, BUT, not only the database
> structure but also the data. The tool, should also create the insert
> lines for data.
> Anyone knows where to find something with similar features, Free or cheap ;)
> thank you
>
Wednesday, March 7, 2012
Script / Function ... to find difference b/w 2 similar tables
I m searching for some Script / Function ... to find difference in data
b/w 2 similar tables (exactly same fields structure) in sql 2000.
plz update me asap !
thanks in advance !On 11 Jan 2005 22:34:27 -0800, AzGhanv/. wrote:
>I m searching for some Script / Function ... to find difference in data
>b/w 2 similar tables (exactly same fields structure) in sql 2000.
>plz update me asap !
Hi AzGhanv/.,
SELECT CASE
WHEN a.KeyCol = 1 THEN 'FirstTable'
ELSE 'SecondTable'
END AS Origin,
COALESCE (a.KeyCol1, b.KeyCol1) AS KeyCol1,
COALESCE (a.KeyCol2, b.KeyCol2) AS KeyCol2,
....
COALESCE (a.KeyColN, b.KeyColN) AS KeyColN,
COALESCE (a.DataCol1, b.DataCol1) AS DataCol1,
COALESCE (a.DataCol2, b.DataCol2) AS DataCol2,
....
COALESCE (a.DataColN, b.DataColN) AS DataColN
FROM FirstTable AS a
FULL OUTER JOIN SecondTable AS b
ON a.KeyCol1 = b.KeyCol1
AND a.KeyCol2 = b.KeyCol2
....
AND a.KeyColN = b.KeyColN
AND a.DataCol1 = b.DataCol1
AND a.DataCol2 = b.DataCol2
....
AND a.DataColN = b.DataColN
NOTE: The above assumes that no column may contain NULLS. For each data
column that allow NULLS, you'll have to replace
AND a.DataColX = b.DataColX
with
AND (a.DataColX = b.DataColX
OR (a.DataColX IS NULL AND b.DataColX IS NULL))
or, alternatively
AND NULLIF (a.DataColX, b.DataColX) IS NULL
AND NULLIF (b.DataColX, a.DataColX) IS NULL
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)|||Assuming by differences you mean rows in A not in B as well as vice
versa, a good solution would be
create table t1 (a int,b int)
create table t2 (a int,b int)
insert into t1 values (1,2)
insert into t1 values(3,4)
insert into t1 values(5,6)
insert into t2 values(1,2)
insert into t2 values(3,7)
insert into t2 values(5,6)
select sum(t) ,a,b from
(select 1 as t,* from t1
union all
select 2 as t,* from t2
) as both
group by a,b
this way you see both kinds of differences as 1 or 2, and 3 means no
difference (you can add having sum(t)<3 not to see them)
hope this helps
Tzvika
Saturday, February 25, 2012
script
Hello
I want to create sql script for my database. I know about “Generate SQL Server Scripts Wizard” but it just give me script for structure of my database and I want all records of my tables too.
And I’ve tried “Script table as / Insert to“via right click on my table too and it doesn’t give me a script to insert all records!
How can I create script to insert all records of a table to another table with same column properties?does exist any things to do it for me?
Thanks in advance.
Best to just create a database backup and create a TSQL script to restore it.
Or, you need to bulk copy the data out into a file and use bcp.exe or bulk insert to re-populate the table.
|||Hi,
In order to generate insert statments for a table, you can use a very well written script that can be found at http://vyaskn.tripod.com/code.htm#inserts
Here you will find both the versions of the script (for SQL2000 and SQL2005) and its very easy to use.
Regards,
Neeraj