Showing posts with label primary. Show all posts
Showing posts with label primary. Show all posts

Friday, March 9, 2012

Newbie at Replication

There aren't many primary keys on the tables in the Publishers. If I add primary keys to the tables on the replicated database, when I subscribe again to the Publications, will they disappear from my replicated database (i.e. will the schema be overwritten)?The response below is from a Merge replication perspective:

Firstly, after adding the new PKs to the tables at the Publisher, adding a new subscription to it will not overwrite the publisher schema. All reinitializing an existing subscriber will not overwrite the Publisher schema (It will however overwrite the subscriber schema, provided you ran the snapshot)

However if you want the added PKs to propagate to the subscriber, then you will fall into one of the cases below:

If you add the new PKs on the publisher before the snapshot is generated and delivered to the subscriber, the subscriber will get the new PKs.

However if the subscriber already has the snapshot and is synched up, and then you add the new PKs at the publisher, the subscriber will not get PKs incrementally on subsequent synchs. You will either need to explicitly create them at the subscriber, or add the PKs at the publisher, regenerate the snapshot, and reinitialize the subscriber.

Please refer to Books Online for furhter information on Initial Synchronization, Subsequent Synchronization, Incremental changes and replicating DDL changes.|||Yes it does help very much, thank you! By trial and error I arrived at the same answer. Thank you for the reference to the solution in Books Online. Sometimes I don't have the right keywords in my search.

Monday, February 20, 2012

Newbee questions

I am trying to execute these set of statements...
CREATE DATABASE Sales1
ON
PRIMARY(NAME=SalesPrimary,
FILENAME='C:\Kim\SalesPrimary.mdf',
SIZE = 500MB,
MAXSIZE = 200,
FILEGROWTH = 20),
FILEGROUP SalesFG
(NAME = SalesData1,
FILENAME = 'C:\Kim\SalesData1.ndf',
SIZE = 200MB,
MAXSIZE = 800,
FILEGROWTH = 100),
(FILENAME='C:\Kim\SalesData2.ndf',
SIZE = 400MB,
MAXSIZE = 1200,
FILEGROWTH = 300),
FILEGROUP SalesHistoryFG
(NAME = SalesHistory1,
FILENAME='C:\Kim\SalesHistory1.ndf',
SIZE=100MB,
MAXSIZE=500,
FILEGROWTH=50)
LOG ON
(NAME=Archlog1,
FILENAME='C:\Kim\SalesLog.ldf',
SIZE=300MB,
MAXSIZE=800,
FILEGROWTH=100)
I am using SSMS and typind this in the New Query Editor window.
But when I execute it...it gives me an error saying...
Msg 1036, Level 16, State 2, Line 1
File option NAME is required in this CREATE/ALTER DATABASE statement.
But I already gave the database name as SALES1...what is the problem
here'
Appreciate your help
Thanks in advance!Just glancing, it looks like the NAME is missing for salesdata2.ndf
No idea if the rest is correct or not...
--
Kevin Hill
3NF Consulting
http://www.3nf-inc.com/NewsGroups.htm
Real-world stuff I run across with SQL Server:
http://kevin3nf.blogspot.com
"freeblue11" <freeblue11@.gmail.com> wrote in message
news:1164656369.028134.98250@.j72g2000cwa.googlegroups.com...
>I am trying to execute these set of statements...
> CREATE DATABASE Sales1
> ON
> PRIMARY(NAME=SalesPrimary,
> FILENAME='C:\Kim\SalesPrimary.mdf',
> SIZE = 500MB,
> MAXSIZE = 200,
> FILEGROWTH = 20),
> FILEGROUP SalesFG
> (NAME = SalesData1,
> FILENAME = 'C:\Kim\SalesData1.ndf',
> SIZE = 200MB,
> MAXSIZE = 800,
> FILEGROWTH = 100),
> (FILENAME='C:\Kim\SalesData2.ndf',
> SIZE = 400MB,
> MAXSIZE = 1200,
> FILEGROWTH = 300),
> FILEGROUP SalesHistoryFG
> (NAME = SalesHistory1,
> FILENAME='C:\Kim\SalesHistory1.ndf',
> SIZE=100MB,
> MAXSIZE=500,
> FILEGROWTH=50)
> LOG ON
> (NAME=Archlog1,
> FILENAME='C:\Kim\SalesLog.ldf',
> SIZE=300MB,
> MAXSIZE=800,
> FILEGROWTH=100)
> I am using SSMS and typind this in the New Query Editor window.
> But when I execute it...it gives me an error saying...
> Msg 1036, Level 16, State 2, Line 1
> File option NAME is required in this CREATE/ALTER DATABASE statement.
> But I already gave the database name as SALES1...what is the problem
> here'
> Appreciate your help
> Thanks in advance!
>|||This is a multi-part message in MIME format.
--=_NextPart_000_07DC_01C7121B.7A817570
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Good formatting often makes things so easy to see. Notes inline...
CREATE DATABASE Sales1
ON PRIMARY
( NAME=3DSalesPrimary,
FILENAME=3D'D:\Temp\SalesPrimary.mdf',
SIZE =3D 500MB,
MAXSIZE =3D 500, --Maxsize has to be at least the same as Size
FILEGROWTH =3D 20
),
FILEGROUP SalesFG
( NAME =3D SalesData1,
FILENAME =3D 'D:\Temp\SalesData1.ndf',
SIZE =3D 200MB,
MAXSIZE =3D 800,
FILEGROWTH =3D 100
),
( , --Missing Filename here
FILENAME=3D'D:\Temp\SalesData2.ndf',
SIZE =3D 400MB,
MAXSIZE =3D 1200,
FILEGROWTH =3D 300
),
FILEGROUP SalesHistoryFG
( NAME =3D SalesHistory1,
FILENAME=3D'D:\Temp\SalesHistory1.ndf',
SIZE=3D100MB,
MAXSIZE=3D500,
FILEGROWTH=3D50
)
LOG ON
( NAME=3DArchlog1,
FILENAME=3D'D:\Temp\SalesLog.ldf',
SIZE=3D300MB,
MAXSIZE=3D800,
FILEGROWTH=3D100
)
-- Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience. Most experience comes from bad judgment. - Anonymous
You can't help someone get up a hill without getting a little closer to =the top yourself.
- H. Norman Schwarzkopf
"freeblue11" <freeblue11@.gmail.com> wrote in message =news:1164656369.028134.98250@.j72g2000cwa.googlegroups.com...
>I am trying to execute these set of statements...
> > CREATE DATABASE Sales1
> ON
> PRIMARY(NAME=3DSalesPrimary,
> FILENAME=3D'C:\Kim\SalesPrimary.mdf',
> SIZE =3D 500MB,
> MAXSIZE =3D 200,
> FILEGROWTH =3D 20),
> FILEGROUP SalesFG
> (NAME =3D SalesData1,
> FILENAME =3D 'C:\Kim\SalesData1.ndf',
> SIZE =3D 200MB,
> MAXSIZE =3D 800,
> FILEGROWTH =3D 100),
> (FILENAME=3D'C:\Kim\SalesData2.ndf',
> SIZE =3D 400MB,
> MAXSIZE =3D 1200,
> FILEGROWTH =3D 300),
> FILEGROUP SalesHistoryFG
> (NAME =3D SalesHistory1,
> FILENAME=3D'C:\Kim\SalesHistory1.ndf',
> SIZE=3D100MB,
> MAXSIZE=3D500,
> FILEGROWTH=3D50)
> LOG ON
> (NAME=3DArchlog1,
> FILENAME=3D'C:\Kim\SalesLog.ldf',
> SIZE=3D300MB,
> MAXSIZE=3D800,
> FILEGROWTH=3D100)
> > I am using SSMS and typind this in the New Query Editor window.
> But when I execute it...it gives me an error saying...
> > Msg 1036, Level 16, State 2, Line 1
> File option NAME is required in this CREATE/ALTER DATABASE statement.
> But I already gave the database name as SALES1...what is the problem
> here'
> > Appreciate your help
> > Thanks in advance!
>
--=_NextPart_000_07DC_01C7121B.7A817570
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

Good formatting often makes things so =easy to see. Notes inline...
CREATE DATABASE =Sales1 ON PRIMARY ( NAME=3DSalesPrimary, =FILENAME=3D'D:\Temp\SalesPrimary.mdf', &=nbsp; SIZE =3D 500MB, =MAXSIZE =3D 500, --Maxsize has to be at least the same as Size FILEGROWTH =3D 20 ), FILEGROUP SalesFG ( NAME =3D SalesData1, FILENAME ==3D 'D:\Temp\SalesData1.ndf', &n=bsp; SIZE =3D 200MB, =MAXSIZE =3D 800, FILEGROWTH =3D 100 =), ( , --Missing Filename here FILENAME=3D'D:\Temp\SalesData2.ndf', &nb=sp; SIZE =3D 400MB, =MAXSIZE =3D 1200, FILEGROWTH =3D =300 ), FILEGROUP SalesHistoryFG ( NAME =3D SalesHistory1, FILENAME=3D'D:\Temp\SalesHistory1.ndf', = SIZE=3D100MB, MAXSIZE=3D500, FILEGROWTH=3D50 ) LOG ON ( NAME=3DArchlog1, FILENAME=3D'D:\Temp\SalesLog.ldf',  =; SIZE=3D300MB, MAXSIZE=3D800, FILEGROWTH=3D100 )
-- Arnie Rowland, =Ph.D.Westwood Consulting, Inc
Most good judgment comes from =experience. Most experience comes from bad judgment. - Anonymous
You can't help someone get up a hill =without getting a little closer to the top yourself.- H. Norman Schwarzkopf
"freeblue11" =wrote in message news:1164656369.028134.98250@.j72g2000cwa.googlegroups.com=...>I =am trying to execute these set of statements...> > CREATE DATABASE Sales1> ON> PRIMARY(NAME=3DSalesPrimary,> FILENAME=3D'C:\Kim\SalesPrimary.mdf',> SIZE =3D 500MB,> =MAXSIZE =3D 200,> FILEGROWTH =3D 20),> FILEGROUP SalesFG> (NAME ==3D SalesData1,> FILENAME =3D 'C:\Kim\SalesData1.ndf',> SIZE ==3D 200MB,> MAXSIZE =3D 800,> FILEGROWTH =3D 100),> (FILENAME=3D'C:\Kim\SalesData2.ndf',> SIZE =3D 400MB,> =MAXSIZE =3D 1200,> FILEGROWTH =3D 300),> FILEGROUP =SalesHistoryFG> (NAME =3D SalesHistory1,> =FILENAME=3D'C:\Kim\SalesHistory1.ndf',> SIZE=3D100MB,> MAXSIZE=3D500,> FILEGROWTH=3D50)> =LOG ON> (NAME=3DArchlog1,> FILENAME=3D'C:\Kim\SalesLog.ldf',> SIZE=3D300MB,> MAXSIZE=3D800,> FILEGROWTH=3D100)> => I am using SSMS and typind this in the New Query Editor window.> But =when I execute it...it gives me an error saying...> > Msg 1036, =Level 16, State 2, Line 1> File option NAME is required in this =CREATE/ALTER DATABASE statement.> But I already gave the database name as SALES1...what is the problem> here'> > =Appreciate your help> > Thanks in advance!>

--=_NextPart_000_07DC_01C7121B.7A817570--|||Kevin, Arnie
My oversite!!
Thank you very much!
Arnie Rowland wrote:
> Good formatting often makes things so easy to see. Notes inline...
> CREATE DATABASE Sales1
> ON PRIMARY
> ( NAME=SalesPrimary,
> FILENAME='D:\Temp\SalesPrimary.mdf',
> SIZE = 500MB,
> MAXSIZE = 500, --Maxsize has to be at least the same as Size
> FILEGROWTH = 20
> ),
> FILEGROUP SalesFG
> ( NAME = SalesData1,
> FILENAME = 'D:\Temp\SalesData1.ndf',
> SIZE = 200MB,
> MAXSIZE = 800,
> FILEGROWTH = 100
> ),
> ( , --Missing Filename here
> FILENAME='D:\Temp\SalesData2.ndf',
> SIZE = 400MB,
> MAXSIZE = 1200,
> FILEGROWTH = 300
> ),
> FILEGROUP SalesHistoryFG
> ( NAME = SalesHistory1,
> FILENAME='D:\Temp\SalesHistory1.ndf',
> SIZE=100MB,
> MAXSIZE=500,
> FILEGROWTH=50
> )
> LOG ON
> ( NAME=Archlog1,
> FILENAME='D:\Temp\SalesLog.ldf',
> SIZE=300MB,
> MAXSIZE=800,
> FILEGROWTH=100
> )
>
> --
> Arnie Rowland, Ph.D.
> Westwood Consulting, Inc
> Most good judgment comes from experience.
> Most experience comes from bad judgment.
> - Anonymous
> You can't help someone get up a hill without getting a little closer to the top yourself.
> - H. Norman Schwarzkopf
>
> "freeblue11" <freeblue11@.gmail.com> wrote in message news:1164656369.028134.98250@.j72g2000cwa.googlegroups.com...
> >I am trying to execute these set of statements...
> >
> > CREATE DATABASE Sales1
> > ON
> > PRIMARY(NAME=SalesPrimary,
> > FILENAME='C:\Kim\SalesPrimary.mdf',
> > SIZE = 500MB,
> > MAXSIZE = 200,
> > FILEGROWTH = 20),
> > FILEGROUP SalesFG
> > (NAME = SalesData1,
> > FILENAME = 'C:\Kim\SalesData1.ndf',
> > SIZE = 200MB,
> > MAXSIZE = 800,
> > FILEGROWTH = 100),
> > (FILENAME='C:\Kim\SalesData2.ndf',
> > SIZE = 400MB,
> > MAXSIZE = 1200,
> > FILEGROWTH = 300),
> > FILEGROUP SalesHistoryFG
> > (NAME = SalesHistory1,
> > FILENAME='C:\Kim\SalesHistory1.ndf',
> > SIZE=100MB,
> > MAXSIZE=500,
> > FILEGROWTH=50)
> > LOG ON
> > (NAME=Archlog1,
> > FILENAME='C:\Kim\SalesLog.ldf',
> > SIZE=300MB,
> > MAXSIZE=800,
> > FILEGROWTH=100)
> >
> > I am using SSMS and typind this in the New Query Editor window.
> > But when I execute it...it gives me an error saying...
> >
> > Msg 1036, Level 16, State 2, Line 1
> > File option NAME is required in this CREATE/ALTER DATABASE statement.
> > But I already gave the database name as SALES1...what is the problem
> > here'
> >
> > Appreciate your help
> >
> > Thanks in advance!
> >
> --=_NextPart_000_07DC_01C7121B.7A817570
> Content-Type: text/html; charset=iso-8859-1
> Content-Transfer-Encoding: quoted-printable
> X-Google-AttachSize: 5412
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> &

>
>
>
>
>
> Good formatting often makes things so easy to see.
> Notes inline...
>
> CREATE DATABASE Sales1 ON
> PRIMARY (
> NAME=SalesPrimary,
> FILENAME='D:\Temp\SalesPrimary.mdf',
> SIZE = 500MB, MAXSIZE => 500, --Maxsize has to be at least the same as
> Size FILEGROWTH => 20 ), FILEGROUP
> SalesFG ( NAME => SalesData1, FILENAME => 'D:\Temp\SalesData1.ndf',
> SIZE = 200MB, MAXSIZE => 800, FILEGROWTH => 100 ),
> ( , --Missing Filename
> here
> FILENAME='D:\Temp\SalesData2.ndf',
> SIZE = 400MB, MAXSIZE => 1200, FILEGROWTH => 300 ), FILEGROUP
> SalesHistoryFG ( NAME => SalesHistory1,
> FILENAME='D:\Temp\SalesHistory1.ndf',
> SIZE=100MB,
> MAXSIZE=500,
> FILEGROWTH=50 ) LOG
> ON (
> NAME=Archlog1,
> FILENAME='D:\Temp\SalesLog.ldf',
> SIZE=300MB,
> MAXSIZE=800,
> FILEGROWTH=100 )
>
> -- Arnie Rowland, Ph.D.Westwood
> Consulting, Inc
>
> Most good judgment comes from experience. Most
> experience comes from bad judgment. - Anonymous
>
> You can't help someone get up a hill without
> getting a little closer to the top yourself.- H. Norman
> Schwarzkopf
>
>
> "freeblue11" < href="http://links.10026.com/?link=mailto:freeblue11@.gmail.com"> size=2>freeblue11@.gmail.com> wrote in
> message href="http://links.10026.com/?link=news:1164656369.028134.98250@.j72g2000cwa.googlegroups.com"> face=Arial
> size=2>news:1164656369.028134.98250@.j72g2000cwa.googlegroups.com face=Arial size=2>...>I am trying to
> execute these set of statements...> > CREATE DATABASE
> Sales1> ON> PRIMARY(NAME=SalesPrimary,>
> FILENAME='C:\Kim\SalesPrimary.mdf',> SIZE = 500MB,> MAXSIZE => 200,> FILEGROWTH = 20),> FILEGROUP SalesFG> (NAME => SalesData1,> FILENAME = 'C:\Kim\SalesData1.ndf',> SIZE => 200MB,> MAXSIZE = 800,> FILEGROWTH = 100),>
> (FILENAME='C:\Kim\SalesData2.ndf',> SIZE = 400MB,> MAXSIZE => 1200,> FILEGROWTH = 300),> FILEGROUP SalesHistoryFG> (NAME
> = SalesHistory1,> FILENAME='C:\Kim\SalesHistory1.ndf',>
> SIZE=100MB,> MAXSIZE=500,> FILEGROWTH=50)> LOG ON>
> (NAME=Archlog1,> FILENAME='C:\Kim\SalesLog.ldf',>
> SIZE=300MB,> MAXSIZE=800,> FILEGROWTH=100)> > I am
> using SSMS and typind this in the New Query Editor window.> But when I
> execute it...it gives me an error saying...> > Msg 1036, Level 16,
> State 2, Line 1> File option NAME is required in this CREATE/ALTER
> DATABASE statement.> But I already gave the database name as
> SALES1...what is the problem> here'> > Appreciate your
> help> > Thanks in advance!>

> --=_NextPart_000_07DC_01C7121B.7A817570--