Tuesday, March 27, 2012
Basic MSSQL Question
Haven't used MSSQL in a while and I have a question about this query:
Here is what I need to achieve:
Basically I need to know if the same DataTableName exists for two suppliers.
In this table there are two fields of concern: DataTableName, SupplierID.
The process is that when requested I change the supplierId to another ID to
move the dataTable to another supplier. I need to check that it won't creat
e
a duplicate. There are no database constraints in place to check for this.
I've done it this way for now, but are there better more efficient ways?
Select DataTableName
from tbl_DataTableMaster
Where DataTableName in
(select DataTableName
from tbl_DataTablemaster
Where SupplierID = 3202) AND
DataTableName in
(select DataTableName
from tbl_DataTableMaster
Where SupplierID = 235)
This gives me the results I want, but what about outer joins, or are any
other ways? It's not a very large table & it's not a query that will be run
often. I'm just back to work recently and I want to learn the right way, no
t
just one that works.
Thanks for your help.Lesley
> Select DataTableName
> from tbl_DataTableMaster
> Where DataTableName in
> (select DataTableName
> from tbl_DataTablemaster
> Where SupplierID = 3202) AND
> DataTableName in
> (select DataTableName
> from tbl_DataTableMaster
> Where SupplierID = 235)
SELECT DataTableName FROM
DataTablemaster WHERE SupplierID = 235 OR SupplierID = 3202
"Lesley" <Lesley@.discussions.microsoft.com> wrote in message
news:B6F2D6DB-7F7C-4F38-8041-7123D1C70A56@.microsoft.com...
> Hello everyone,
> Haven't used MSSQL in a while and I have a question about this query:
> Here is what I need to achieve:
> Basically I need to know if the same DataTableName exists for two
> suppliers.
> In this table there are two fields of concern: DataTableName, SupplierID.
> The process is that when requested I change the supplierId to another ID
> to
> move the dataTable to another supplier. I need to check that it won't
> create
> a duplicate. There are no database constraints in place to check for
> this.
> I've done it this way for now, but are there better more efficient ways?
> Select DataTableName
> from tbl_DataTableMaster
> Where DataTableName in
> (select DataTableName
> from tbl_DataTablemaster
> Where SupplierID = 3202) AND
> DataTableName in
> (select DataTableName
> from tbl_DataTableMaster
> Where SupplierID = 235)
>
> This gives me the results I want, but what about outer joins, or are any
> other ways? It's not a very large table & it's not a query that will be
> run
> often. I'm just back to work recently and I want to learn the right way,
> not
> just one that works.
> Thanks for your help.|||DUH (that DUH was for me)
Thanks, apparently my brain isn't thinking in simple mode.
"Uri Dimant" wrote:
> Lesley
>
>
> SELECT DataTableName FROM
> DataTablemaster WHERE SupplierID = 235 OR SupplierID = 3202
>
>
> "Lesley" <Lesley@.discussions.microsoft.com> wrote in message
> news:B6F2D6DB-7F7C-4F38-8041-7123D1C70A56@.microsoft.com...
>
>|||If I understand you correctly you want to check for duplicates?
then do like this
SELECT COL1,COL2 FROM TABLE GROUP BY COL1,COL2 HAVING COUNT(*)>1
However
Now it is time to have constraints and design properly.
Regards
R.D
"Lesley" wrote:
> Hello everyone,
> Haven't used MSSQL in a while and I have a question about this query:
> Here is what I need to achieve:
> Basically I need to know if the same DataTableName exists for two supplier
s.
> In this table there are two fields of concern: DataTableName, SupplierID.
> The process is that when requested I change the supplierId to another ID t
o
> move the dataTable to another supplier. I need to check that it won't cre
ate
> a duplicate. There are no database constraints in place to check for thi
s.
> I've done it this way for now, but are there better more efficient ways?
> Select DataTableName
> from tbl_DataTableMaster
> Where DataTableName in
> (select DataTableName
> from tbl_DataTablemaster
> Where SupplierID = 3202) AND
> DataTableName in
> (select DataTableName
> from tbl_DataTableMaster
> Where SupplierID = 235)
>
> This gives me the results I want, but what about outer joins, or are any
> other ways? It's not a very large table & it's not a query that will be r
un
> often. I'm just back to work recently and I want to learn the right way,
not
> just one that works.
> Thanks for your help.|||Sorry, that won't solve my problem.
That will return every datatablename for either supplierID - not where the
Datatablenames are the same.
Any other thoughts?
"Uri Dimant" wrote:
> Lesley
>
>
> SELECT DataTableName FROM
> DataTablemaster WHERE SupplierID = 235 OR SupplierID = 3202
>
>
> "Lesley" <Lesley@.discussions.microsoft.com> wrote in message
> news:B6F2D6DB-7F7C-4F38-8041-7123D1C70A56@.microsoft.com...
>
>|||That's what I'm looking for.
Yes I agree, the database should check for constraints - but I'm not the DBA
& I don't think this constraint would always hold true. This application
has been around for a LONG time.
Thanks!
"R.D" wrote:
> If I understand you correctly you want to check for duplicates?
> then do like this
> SELECT COL1,COL2 FROM TABLE GROUP BY COL1,COL2 HAVING COUNT(*)>1
> However
> Now it is time to have constraints and design properly.
> Regards
> R.D
>
> "Lesley" wrote:
>|||OK I need to think before I type. Can you delete responses on this forum?
I don't think that method will work either. Yes it will find existing
duplicates. But I need to find determine if duplicates will occur after I
change the supplierID field.
Thanks.
"R.D" wrote:
> If I understand you correctly you want to check for duplicates?
> then do like this
> SELECT COL1,COL2 FROM TABLE GROUP BY COL1,COL2 HAVING COUNT(*)>1
> However
> Now it is time to have constraints and design properly.
> Regards
> R.D
>
> "Lesley" wrote:
>|||Lesley
can you be specific what exactly you want to do.
1. You want check for duplicates after inserting? But it should insert ?
that is what are you looking for then, you got to use triggers
CREATE TRIGGER <TRIGGERNAME>
ON <TABLE NAME>
AFTER INSERT, UPDATE
IF EXISTS (SELECT COL1,COL2 FROM TABLE GROUP BY COL1,COL2 HAVING COUNT(*)>1)
BEGIN
RAISE ERROR('DUPLICATES INSERTED',16,1)
-- OR YOU CAN INSERT THAT ROW INTO TEMP TABLE
END
"Lesley" wrote:
> OK I need to think before I type. Can you delete responses on this forum
?
> I don't think that method will work either. Yes it will find existing
> duplicates. But I need to find determine if duplicates will occur after I
> change the supplierID field.
> Thanks.
>
> "R.D" wrote:
>|||I'm not inserting I'm just changing the supplierID. I want to be sure that
when I change the supplierID it won't create a duplicate. If it will create
a duplicate I'm creating a message that give the potential duplicate
DataTableName to the User. This piece is a small part of a transaction, if
a
duplicate will be created I'm rolling back any changes that have occured
within the transaction. So the user can proceed as they wish.
Does that clear things up or make it worse?
Thanks for your help.
"R.D" wrote:
> Lesley
> can you be specific what exactly you want to do.
> 1. You want check for duplicates after inserting? But it should insert ?
> that is what are you looking for then, you got to use triggers
> CREATE TRIGGER <TRIGGERNAME>
> ON <TABLE NAME>
> AFTER INSERT, UPDATE
> IF EXISTS (SELECT COL1,COL2 FROM TABLE GROUP BY COL1,COL2 HAVING COUNT(*)>
1)
> BEGIN
> RAISE ERROR('DUPLICATES INSERTED',16,1)
> -- OR YOU CAN INSERT THAT ROW INTO TEMP TABLE
> END
>
>
> "Lesley" wrote:
>|||You can use check constriants and disable when ever you want. However
previous trigger still works for update.
Regards
R.D
"Lesley" wrote:
> I'm not inserting I'm just changing the supplierID. I want to be sure th
at
> when I change the supplierID it won't create a duplicate. If it will crea
te
> a duplicate I'm creating a message that give the potential duplicate
> DataTableName to the User. This piece is a small part of a transaction, i
f a
> duplicate will be created I'm rolling back any changes that have occured
> within the transaction. So the user can proceed as they wish.
> Does that clear things up or make it worse?
> Thanks for your help.
> "R.D" wrote:
>
Sunday, March 25, 2012
Basic Design Question Currency Dimension or New Measure
I am in the middle of a decision and I would like to ask experts for their
ideas.
I have Sales Reporting System on MSSQL 2000 + AS + RS
So far I have used only USD as reporting currency, now I am going to add
EURO and Local Currencies. My Current Model has "Sales", "Performance%" etc
as measures and Items,Countries etc as dimensions.
The question is how should I add new currencies to the system ?
As new Measures Sales_EURO?
or
As adding them to the fact table as rows keeping only one Sales measure and
adding a Currency dimension ?
I have around 2 million record in my fact table and data is accessed via
Reporting Services reports and via an application using OWC Pivot Table.
Thanks in advance?
erdalErdal,
Check out Adventure Works Enterprise Analysis services sample. I believe it
solves your problem via a currency dimension.
"erdal akbulut" <erdalim21@.yahoo.com> wrote in message
news:eJWeL32cGHA.4576@.TK2MSFTNGP05.phx.gbl...
> Hi All,
> I am in the middle of a decision and I would like to ask experts for their
> ideas.
> I have Sales Reporting System on MSSQL 2000 + AS + RS
> So far I have used only USD as reporting currency, now I am going to add
> EURO and Local Currencies. My Current Model has "Sales", "Performance%"
> etc
> as measures and Items,Countries etc as dimensions.
> The question is how should I add new currencies to the system ?
> As new Measures Sales_EURO?
> or
> As adding them to the fact table as rows keeping only one Sales measure
> and
> adding a Currency dimension ?
> I have around 2 million record in my fact table and data is accessed via
> Reporting Services reports and via an application using OWC Pivot Table.
> Thanks in advance?
> erdal
>
>
>|||Tim Thanks for you reply.
Unfortunately I dont have SSAS 2005 installed, think that sample comes with
SSAS 2005. Do you know is there any documentation for that project that I
can use without installing the application itself?
erdal
"Tim Dot NoSpam" <Tim.NoSpam@.hughes.net> wrote in message
news:eD1tkPdeGHA.380@.TK2MSFTNGP04.phx.gbl...
> Erdal,
> Check out Adventure Works Enterprise Analysis services sample. I believe
it
> solves your problem via a currency dimension.
> "erdal akbulut" <erdalim21@.yahoo.com> wrote in message
> news:eJWeL32cGHA.4576@.TK2MSFTNGP05.phx.gbl...
their[vbcol=seagreen]
>|||Not that I'm aware of. Sorry.
-Tim
"erdal akbulut" <erdalim21@.yahoo.com> wrote in message
news:uE7najleGHA.4912@.TK2MSFTNGP05.phx.gbl...
> Tim Thanks for you reply.
> Unfortunately I dont have SSAS 2005 installed, think that sample comes
> with
> SSAS 2005. Do you know is there any documentation for that project that I
> can use without installing the application itself?
> erdal
> "Tim Dot NoSpam" <Tim.NoSpam@.hughes.net> wrote in message
> news:eD1tkPdeGHA.380@.TK2MSFTNGP04.phx.gbl...
> it
> their
>
Thursday, March 8, 2012
Backupstrategy for Database with Merge-Push Replication.
replication to approximately 20 Notebooks running MSDE.
backup on the Server is done once per night.
If I decide to go back one night on the server, changes which have been
replicated on the notebooks since then will be reapllied.
Is there a strategy better then stopping publication to all notebooks ,
restoring the backup on the server and repushing the publication to the
clients afterwards?Norbert,
Your plan sounds good to me, can't think of a better way.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
Kraft, Norbert wrote:
> I have a database on a MSSQL 2000 Server which is replicated by a merge pu
sh
> replication to approximately 20 Notebooks running MSDE.
> backup on the Server is done once per night.
> If I decide to go back one night on the server, changes which have been
> replicated on the notebooks since then will be reapllied.
> Is there a strategy better then stopping publication to all notebooks ,
> restoring the backup on the server and repushing the publication to the
> clients afterwards?
>
>|||Sounds to be a very cumbersom procedure if done by hand. Anyone who had
prepared a sql-DMO script for a similar case ?
"Mark Allison" <mark@.no.tinned.meat.mvps.org> wrote in message
news:%23wQQT%23T$EHA.3588@.TK2MSFTNGP10.phx.gbl...[vbcol=seagreen]
> Norbert,
> Your plan sounds good to me, can't think of a better way.
> --
> Mark Allison, SQL Server MVP
> http://www.markallison.co.uk
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602m.html
>
> Kraft, Norbert wrote:
push[vbcol=seagreen]
Backupstrategy for Database with Merge-Push Replication.
replication to approximately 20 Notebooks running MSDE.
backup on the Server is done once per night.
If I decide to go back one night on the server, changes which have been
replicated on the notebooks since then will be reapllied.
Is there a strategy better then stopping publication to all notebooks ,
restoring the backup on the server and repushing the publication to the
clients afterwards?Norbert,
Your plan sounds good to me, can't think of a better way.
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
Kraft, Norbert wrote:
> I have a database on a MSSQL 2000 Server which is replicated by a merge push
> replication to approximately 20 Notebooks running MSDE.
> backup on the Server is done once per night.
> If I decide to go back one night on the server, changes which have been
> replicated on the notebooks since then will be reapllied.
> Is there a strategy better then stopping publication to all notebooks ,
> restoring the backup on the server and repushing the publication to the
> clients afterwards?
>
>|||Sounds to be a very cumbersom procedure if done by hand. Anyone who had
prepared a sql-DMO script for a similar case ?
"Mark Allison" <mark@.no.tinned.meat.mvps.org> wrote in message
news:%23wQQT%23T$EHA.3588@.TK2MSFTNGP10.phx.gbl...
> Norbert,
> Your plan sounds good to me, can't think of a better way.
> --
> Mark Allison, SQL Server MVP
> http://www.markallison.co.uk
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602m.html
>
> Kraft, Norbert wrote:
> > I have a database on a MSSQL 2000 Server which is replicated by a merge
push
> > replication to approximately 20 Notebooks running MSDE.
> > backup on the Server is done once per night.
> > If I decide to go back one night on the server, changes which have been
> > replicated on the notebooks since then will be reapllied.
> > Is there a strategy better then stopping publication to all notebooks ,
> > restoring the backup on the server and repushing the publication to the
> > clients afterwards?
> >
> >
> >
Backupstrategy for Database with Merge-Push Replication.
replication to approximately 20 Notebooks running MSDE.
backup on the Server is done once per night.
If I decide to go back one night on the server, changes which have been
replicated on the notebooks since then will be reapllied.
Is there a strategy better then stopping publication to all notebooks ,
restoring the backup on the server and repushing the publication to the
clients afterwards?
Norbert,
Your plan sounds good to me, can't think of a better way.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
Kraft, Norbert wrote:
> I have a database on a MSSQL 2000 Server which is replicated by a merge push
> replication to approximately 20 Notebooks running MSDE.
> backup on the Server is done once per night.
> If I decide to go back one night on the server, changes which have been
> replicated on the notebooks since then will be reapllied.
> Is there a strategy better then stopping publication to all notebooks ,
> restoring the backup on the server and repushing the publication to the
> clients afterwards?
>
>
|||Sounds to be a very cumbersom procedure if done by hand. Anyone who had
prepared a sql-DMO script for a similar case ?
"Mark Allison" <mark@.no.tinned.meat.mvps.org> wrote in message
news:%23wQQT%23T$EHA.3588@.TK2MSFTNGP10.phx.gbl...[vbcol=seagreen]
> Norbert,
> Your plan sounds good to me, can't think of a better way.
> --
> Mark Allison, SQL Server MVP
> http://www.markallison.co.uk
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602m.html
>
> Kraft, Norbert wrote:
push[vbcol=seagreen]
Sunday, February 19, 2012
Backup/Restore MSSQL database from domain host?
Unfortunately it doesn't provide remote connections to their MS SQL server.
I can see no method of retrieving my database structure, or the database
populated with data, from the hosts control panel.
I'm sure that I could upload a script to my webspace that would allow me to
download and upload my database structures and data, but I have no idea
where to find a script that would allow this.
I'm hoping to be able to develop the database locally, then upload the
changes to the online database. Later I'd like to be able to download the
database to make modifications or just farm the data within them.
Any ideas?You need to ask your provider this. If they don't have a story on how you ca
n backup and get the
database and also upload such a backup, then change provider.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Noozer" <dont.spam@.me.here> wrote in message news:buMTf.164960$H%4.121289@.pd7tw2no...[colo
r=darkred]
> My domain host provides Windows hosting, including MS SQL database. Unfort
unately it doesn't
> provide remote connections to their MS SQL server. I can see no method of
retrieving my database
> structure, or the database populated with data, from the hosts control pan
el.
> I'm sure that I could upload a script to my webspace that would allow me t
o download and upload my
> database structures and data, but I have no idea where to find a script th
at would allow this.
> I'm hoping to be able to develop the database locally, then upload the cha
nges to the online
> database. Later I'd like to be able to download the database to make modif
ications or just farm
> the data within them.
> Any ideas?
>[/color]
Backup/Restore MSSQL database from domain host?
Unfortunately it doesn't provide remote connections to their MS SQL server.
I can see no method of retrieving my database structure, or the database
populated with data, from the hosts control panel.
I'm sure that I could upload a script to my webspace that would allow me to
download and upload my database structures and data, but I have no idea
where to find a script that would allow this.
I'm hoping to be able to develop the database locally, then upload the
changes to the online database. Later I'd like to be able to download the
database to make modifications or just farm the data within them.
Any ideas?
You need to ask your provider this. If they don't have a story on how you can backup and get the
database and also upload such a backup, then change provider.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"Noozer" <dont.spam@.me.here> wrote in message news:buMTf.164960$H%4.121289@.pd7tw2no...
> My domain host provides Windows hosting, including MS SQL database. Unfortunately it doesn't
> provide remote connections to their MS SQL server. I can see no method of retrieving my database
> structure, or the database populated with data, from the hosts control panel.
> I'm sure that I could upload a script to my webspace that would allow me to download and upload my
> database structures and data, but I have no idea where to find a script that would allow this.
> I'm hoping to be able to develop the database locally, then upload the changes to the online
> database. Later I'd like to be able to download the database to make modifications or just farm
> the data within them.
> Any ideas?
>
Sunday, February 12, 2012
Backup to Unix/Linux
backed up. Currently I'm using DTS on a Win2k desktop, but this isn't really
practical as this machine is used as a workstation.
Has anyone heard of any methods to backup to a Unix/Linux server?
Any help would be appreciated.
TIA JoIf the server can see a volume on the network then it should be possible to
write to it. If Windows can't see it then SQL Server won't either.
--
David Portas
SQL Server MVP
--|||"David Portas" wrote:
> If the server can see a volume on the network then it should be possible to
> write to it. If Windows can't see it then SQL Server won't either.
> --
> David Portas
> SQL Server MVP
> --
>
Thanks for the reply David. I can create a Samba share, but do you know of
any scripts or tools that can copy pull the data down? I only have DTS access
to my database on the hosting provider.
I realise most people have access to a Windows server, just wondering if
anyone had done/tried/heard of it.
Jo|||You can create a DTS package with one connection and a T-sql task... The
T-sql task would be a backup command ie.
backup database prod to disk = '\\myserver\mysharename\mybackup.bak' with
init
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Jo" <Jo@.discussions.microsoft.com> wrote in message
news:E1948BEF-BBF2-45A0-8695-14D766726225@.microsoft.com...
>
> "David Portas" wrote:
> > If the server can see a volume on the network then it should be possible
to
> > write to it. If Windows can't see it then SQL Server won't either.
> >
> > --
> > David Portas
> > SQL Server MVP
> > --
> >
> Thanks for the reply David. I can create a Samba share, but do you know of
> any scripts or tools that can copy pull the data down? I only have DTS
access
> to my database on the hosting provider.
> I realise most people have access to a Windows server, just wondering if
> anyone had done/tried/heard of it.
> Jo
Backup to Unix/Linux
backed up. Currently I'm using DTS on a Win2k desktop, but this isn't really
practical as this machine is used as a workstation.
Has anyone heard of any methods to backup to a Unix/Linux server?
Any help would be appreciated.
TIA Jo
If the server can see a volume on the network then it should be possible to
write to it. If Windows can't see it then SQL Server won't either.
David Portas
SQL Server MVP
|||"David Portas" wrote:
> If the server can see a volume on the network then it should be possible to
> write to it. If Windows can't see it then SQL Server won't either.
> --
> David Portas
> SQL Server MVP
> --
>
Thanks for the reply David. I can create a Samba share, but do you know of
any scripts or tools that can copy pull the data down? I only have DTS access
to my database on the hosting provider.
I realise most people have access to a Windows server, just wondering if
anyone had done/tried/heard of it.
Jo
|||You can create a DTS package with one connection and a T-sql task... The
T-sql task would be a backup command ie.
backup database prod to disk = '\\myserver\mysharename\mybackup.bak' with
init
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Jo" <Jo@.discussions.microsoft.com> wrote in message
news:E1948BEF-BBF2-45A0-8695-14D766726225@.microsoft.com...[vbcol=seagreen]
>
> "David Portas" wrote:
to
> Thanks for the reply David. I can create a Samba share, but do you know of
> any scripts or tools that can copy pull the data down? I only have DTS
access
> to my database on the hosting provider.
> I realise most people have access to a Windows server, just wondering if
> anyone had done/tried/heard of it.
> Jo
|||"Wayne Snyder" wrote:
> You can create a DTS package with one connection and a T-sql task... The
> T-sql task would be a backup command ie.
> backup database prod to disk = '\\myserver\mysharename\mybackup.bak' with
> init
>
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> www.mariner-usa.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
"Wayne Snyder" wrote:
> You can create a DTS package with one connection and a T-sql task... The
> T-sql task would be a backup command ie.
> backup database prod to disk = '\\myserver\mysharename\mybackup.bak' with
> init
Thanks for the reply Wayne. I'm still learning, but I'm not sure if I have
access to do this (this command would have to be run on the server?). The
database is sitting on a web host, I only have access (that I'm aware of?) by
using Enterprise Manager. I'm don't often work with MSSQL, but what I
initially thought was using a Perl or shell script that connects to the
correct port and runs some commands to initiate a backup. I was hoping that
someone had already written one too. I'm probably crazy :-P
The site I'm doing this for only has a Linux server that gets backed up
daily. Thanks for the help and patience guys :-)
Jo
Backup to Unix/Linux
backed up. Currently I'm using DTS on a Win2k desktop, but this isn't really
practical as this machine is used as a workstation.
Has anyone heard of any methods to backup to a Unix/Linux server?
Any help would be appreciated.
TIA JoIf the server can see a volume on the network then it should be possible to
write to it. If Windows can't see it then SQL Server won't either.
David Portas
SQL Server MVP
--|||"David Portas" wrote:
> If the server can see a volume on the network then it should be possible t
o
> write to it. If Windows can't see it then SQL Server won't either.
> --
> David Portas
> SQL Server MVP
> --
>
Thanks for the reply David. I can create a Samba share, but do you know of
any scripts or tools that can copy pull the data down? I only have DTS acces
s
to my database on the hosting provider.
I realise most people have access to a Windows server, just wondering if
anyone had done/tried/heard of it.
Jo|||You can create a DTS package with one connection and a T-sql task... The
T-sql task would be a backup command ie.
backup database prod to disk = '\\myserver\mysharename\mybackup.bak' with
init
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Jo" <Jo@.discussions.microsoft.com> wrote in message
news:E1948BEF-BBF2-45A0-8695-14D766726225@.microsoft.com...
>
> "David Portas" wrote:
>
to[vbcol=seagreen]
> Thanks for the reply David. I can create a Samba share, but do you know of
> any scripts or tools that can copy pull the data down? I only have DTS
access
> to my database on the hosting provider.
> I realise most people have access to a Windows server, just wondering if
> anyone had done/tried/heard of it.
> Jo|||"Wayne Snyder" wrote:
> You can create a DTS package with one connection and a T-sql task... The
> T-sql task would be a backup command ie.
> backup database prod to disk = '\\myserver\mysharename\mybackup.bak' with
> init
>
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> www.mariner-usa.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
"Wayne Snyder" wrote:
> You can create a DTS package with one connection and a T-sql task... The
> T-sql task would be a backup command ie.
> backup database prod to disk = '\\myserver\mysharename\mybackup.bak' with
> init
Thanks for the reply Wayne. I'm still learning, but I'm not sure if I have
access to do this (this command would have to be run on the server?). The
database is sitting on a web host, I only have access (that I'm aware of?) b
y
using Enterprise Manager. I'm don't often work with MSSQL, but what I
initially thought was using a PERL or shell script that connects to the
correct port and runs some commands to initiate a backup. I was hoping that
someone had already written one too. I'm probably crazy :-P
The site I'm doing this for only has a Linux server that gets backed up
daily. Thanks for the help and patience guys :-)
Jo
Friday, February 10, 2012
Backup to remote pc
I use shared space MSSQL server in my hosting server.
And I can't backup my DB to my remote server.
Please help how can I do it.
Thank you<anuke@.bk.ru> wrote in message
news:e23cb98a.0410080308.1596832a@.posting.google.c om...
> Hi there,
> I use shared space MSSQL server in my hosting server.
> And I can't backup my DB to my remote server.
> Please help how can I do it.
> Thank you
You can ask your hosting company to make a backup and put in on an FTP
server, or somewhere else for you to download it. If that's not possible,
and assuming you have access to your database with Enterprise Manager and
Query Analyzer, you can generate the scripts for all the objects in the
database, and run the scripts on your own server. That will recreate all the
objects, and you can use bcp.exe or DTS to pull the data from the hosted
server to your own server.
Simon|||"Simon Hayes" <sql@.hayes.ch> wrote in message news:<41668095
> You can ask your hosting company to make a backup and put in on an FTP
> server, or somewhere else for you to download it. If that's not possible,
> and assuming you have access to your database with Enterprise Manager and
> Query Analyzer, you can generate the scripts for all the objects in the
> database, and run the scripts on your own server. That will recreate all the
> objects, and you can use bcp.exe or DTS to pull the data from the hosted
> server to your own server.
> Simon
Thank you.
But i need to backup my database twice in day, in later maybe more.
MSSQL Server is in local area with my server. Can i share folder or
disk to copy backup by script to? Or MS SQL Server can't make backup
files on share-dick?
Thank you very much.|||<anuke@.bk.ru> wrote in message
news:e23cb98a.0410090412.2473a5ec@.posting.google.c om...
> "Simon Hayes" <sql@.hayes.ch> wrote in message news:<41668095
>> You can ask your hosting company to make a backup and put in on an FTP
>> server, or somewhere else for you to download it. If that's not possible,
>> and assuming you have access to your database with Enterprise Manager and
>> Query Analyzer, you can generate the scripts for all the objects in the
>> database, and run the scripts on your own server. That will recreate all
>> the
>> objects, and you can use bcp.exe or DTS to pull the data from the hosted
>> server to your own server.
>>
>> Simon
> Thank you.
> But i need to backup my database twice in day, in later maybe more.
> MSSQL Server is in local area with my server. Can i share folder or
> disk to copy backup by script to? Or MS SQL Server can't make backup
> files on share-dick?
> Thank you very much.
I think I didn't understand your question - if both servers are on the same
LAN and in the same domain, then there should be no problem. MSSQL can back
up to a UNC path, like \\server\sharename, but to do this the MSSQL service
account needs to have access to the target UNC path. So it must be running
under a domain account, not the LocalSystem account. Then you can do
something like this:
backup database MyDB to disk = '\\myserver\backups\mssql\mydb.bak'
See "Setting up Windows Services Accounts" and "BACKUP" in Books Online.
Simon