Showing posts with label script. Show all posts
Showing posts with label script. Show all posts

Friday, March 30, 2012

How to create seperate Differential Backup Files

Instead of creating one file with the different Differential Backups in it, I
would like to create seperate files so I can script it easier - like the DB
Maintenance Plan wizard generates a job which creates seperate files for each
of the Full Backups.
I cannot seem to find the option to specify this thru the GUI/Script for
Differential DB Backups though. Using All Tasks->DB BAckup (only way to
create diff backup except via script?) you only get the choice of Append or
Overwrite Existing Media. Or alt, how do I specify which Backup in my file of
multiple backups to restore via script.
Any help much appreciated -Thanks
Amelia
Read this greate article
<http://vyaskn.tripod.com/sql_server_...ices.htm#Step1
> --administaiting best practices
"Amelia" <Amelia@.discussions.microsoft.com> wrote in message
news:6A9FF6C5-079E-4963-BECE-A0C5CABAA490@.microsoft.com...
> Instead of creating one file with the different Differential Backups in
it, I
> would like to create seperate files so I can script it easier - like the
DB
> Maintenance Plan wizard generates a job which creates seperate files for
each
> of the Full Backups.
> I cannot seem to find the option to specify this thru the GUI/Script for
> Differential DB Backups though. Using All Tasks->DB BAckup (only way to
> create diff backup except via script?) you only get the choice of Append
or
> Overwrite Existing Media. Or alt, how do I specify which Backup in my file
of
> multiple backups to restore via script.
> Any help much appreciated -Thanks
|||Thanks Uri,
I read the article. It was good but similar to the Backup Strategy's I've
read in the Online Books in SQL Server.
I have the plan I want to implement but was stuck on my original question.
Regards
"Uri Dimant" wrote:

> Amelia
> Read this greate article
> <http://vyaskn.tripod.com/sql_server_...ices.htm#Step1
> "Amelia" <Amelia@.discussions.microsoft.com> wrote in message
> news:6A9FF6C5-079E-4963-BECE-A0C5CABAA490@.microsoft.com...
> it, I
> DB
> each
> or
> of
>
>

How to create seperate Differential Backup Files

Instead of creating one file with the different Differential Backups in it,
I
would like to create seperate files so I can script it easier - like the DB
Maintenance Plan wizard generates a job which creates seperate files for eac
h
of the Full Backups.
I cannot seem to find the option to specify this thru the GUI/Script for
Differential DB Backups though. Using All Tasks->DB BAckup (only way to
create diff backup except via script?) you only get the choice of Append or
Overwrite Existing Media. Or alt, how do I specify which Backup in my file o
f
multiple backups to restore via script.
Any help much appreciated -ThanksAmelia
Read this greate article
<http://vyaskn.tripod.com/ sql_serve...r />
.htm#Step1
> --administaiting best practices
"Amelia" <Amelia@.discussions.microsoft.com> wrote in message
news:6A9FF6C5-079E-4963-BECE-A0C5CABAA490@.microsoft.com...
> Instead of creating one file with the different Differential Backups in
it, I
> would like to create seperate files so I can script it easier - like the
DB
> Maintenance Plan wizard generates a job which creates seperate files for
each
> of the Full Backups.
> I cannot seem to find the option to specify this thru the GUI/Script for
> Differential DB Backups though. Using All Tasks->DB BAckup (only way to
> create diff backup except via script?) you only get the choice of Append
or
> Overwrite Existing Media. Or alt, how do I specify which Backup in my file
of
> multiple backups to restore via script.
> Any help much appreciated -Thanks|||Thanks Uri,
I read the article. It was good but similar to the Backup Strategy's I've
read in the Online Books in SQL Server.
I have the plan I want to implement but was stuck on my original question.
Regards
"Uri Dimant" wrote:

> Amelia
> Read this greate article
> <[url]http://vyaskn.tripod.com/ sql_server_administration_best_practices
.htm#Step1[/ur
l]
> "Amelia" <Amelia@.discussions.microsoft.com> wrote in message
> news:6A9FF6C5-079E-4963-BECE-A0C5CABAA490@.microsoft.com...
> it, I
> DB
> each
> or
> of
>
>

How to create seperate Differential Backup Files

Instead of creating one file with the different Differential Backups in it, I
would like to create seperate files so I can script it easier - like the DB
Maintenance Plan wizard generates a job which creates seperate files for each
of the Full Backups.
I cannot seem to find the option to specify this thru the GUI/Script for
Differential DB Backups though. Using All Tasks->DB BAckup (only way to
create diff backup except via script?) you only get the choice of Append or
Overwrite Existing Media. Or alt, how do I specify which Backup in my file of
multiple backups to restore via script.
Any help much appreciated -ThanksAmelia
Read this greate article
<http://vyaskn.tripod.com/sql_server_administration_best_practices.htm#Step1
> --administaiting best practices
"Amelia" <Amelia@.discussions.microsoft.com> wrote in message
news:6A9FF6C5-079E-4963-BECE-A0C5CABAA490@.microsoft.com...
> Instead of creating one file with the different Differential Backups in
it, I
> would like to create seperate files so I can script it easier - like the
DB
> Maintenance Plan wizard generates a job which creates seperate files for
each
> of the Full Backups.
> I cannot seem to find the option to specify this thru the GUI/Script for
> Differential DB Backups though. Using All Tasks->DB BAckup (only way to
> create diff backup except via script?) you only get the choice of Append
or
> Overwrite Existing Media. Or alt, how do I specify which Backup in my file
of
> multiple backups to restore via script.
> Any help much appreciated -Thanks|||Thanks Uri,
I read the article. It was good but similar to the Backup Strategy's I've
read in the Online Books in SQL Server.
I have the plan I want to implement but was stuck on my original question.
Regards
"Uri Dimant" wrote:
> Amelia
> Read this greate article
> <http://vyaskn.tripod.com/sql_server_administration_best_practices.htm#Step1
> > --administaiting best practices
> "Amelia" <Amelia@.discussions.microsoft.com> wrote in message
> news:6A9FF6C5-079E-4963-BECE-A0C5CABAA490@.microsoft.com...
> > Instead of creating one file with the different Differential Backups in
> it, I
> > would like to create seperate files so I can script it easier - like the
> DB
> > Maintenance Plan wizard generates a job which creates seperate files for
> each
> > of the Full Backups.
> >
> > I cannot seem to find the option to specify this thru the GUI/Script for
> > Differential DB Backups though. Using All Tasks->DB BAckup (only way to
> > create diff backup except via script?) you only get the choice of Append
> or
> > Overwrite Existing Media. Or alt, how do I specify which Backup in my file
> of
> > multiple backups to restore via script.
> >
> > Any help much appreciated -Thanks
>
>

How to create scripts (drop then create) in sql 2005

I'm using sql 2005. One thing I could do in sql 2k which I don't see in sql
05 is when I script objects in EM it would check to see if the object exists
first, and if so, it would drop it before creating it. I don't see such an
option in sql 05 SSMS. Its a much better scripting wizard but seems to be
missing the most basic functions.
any advice?
Thanks.
moondaddy@.noemail.noemailAs far as I know there is no such choice in the wizard, you would need to
run it twice, one for 'Generate DROP statements only' and one for 'Generate
CREATE statements only'.
Note that the SP1 description still shows 'Generate the script as DROP
statements, CREATE statements, or DROP statements followed by CREATE
statements."
Ben Nevarez, MCDBA, OCP
Database Administrator
"moondaddy" wrote:

> I'm using sql 2005. One thing I could do in sql 2k which I don't see in s
ql
> 05 is when I script objects in EM it would check to see if the object exis
ts
> first, and if so, it would drop it before creating it. I don't see such a
n
> option in sql 05 SSMS. Its a much better scripting wizard but seems to be
> missing the most basic functions.
> any advice?
> Thanks.
> --
> moondaddy@.noemail.noemail
>
>|||Check out http://www.sqlteam.com/item.asp?ItemID=23185 and
http://weblogs.sqlteam.com/billg/ar...1/22/8414.aspx.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"moondaddy" <moondaddy@.noemail.noemail> wrote in message
news:uLMUBQWdGHA.3712@.TK2MSFTNGP03.phx.gbl...
> I'm using sql 2005. One thing I could do in sql 2k which I don't see in s
ql 05 is when I script
> objects in EM it would check to see if the object exists first, and if so,
it would drop it before
> creating it. I don't see such an option in sql 05 SSMS. Its a much bette
r scripting wizard but
> seems to be missing the most basic functions.
> any advice?
> Thanks.
> --
> moondaddy@.noemail.noemail
>

How to create schem

Hello all,
I've always tried to write my SQL script so that they could run
multiple times without error so when I was creating a new schema i get
an error
USE AdventureWorks
GO
IF NOT EXISTS(SELECT * FROM sys.schemas where [name] = 'temp')
CREATE SCHEMA temp AUTHORIZATION dbo
--END IF
GO
this code works
USE AdventureWorks
GO
IF NOT EXISTS(SELECT * FROM sys.schemas where [name] = 'temp')
PRINT 'CREATE SCHEMA temp AUTHORIZATION dbo'
--END IF
GO
and this code works
USE AdventureWorks
GO
CREATE SCHEMA temp AUTHORIZATION dbo
GO
can anyone shed some light on this.
Thanks in advance for your help.
Regards,
HJ
Try something like:
USE AdventureWorks
GO
IF NOT EXISTS(SELECT * FROM sys.schemas where [name] =
'temp')
EXEC('CREATE SCHEMA temp AUTHORIZATION dbo')
-Sue
On 23 Mar 2006 09:26:13 -0800, hanklvr@.yahoo.com wrote:

>Hello all,
>I've always tried to write my SQL script so that they could run
>multiple times without error so when I was creating a new schema i get
>an error
>USE AdventureWorks
>GO
>IF NOT EXISTS(SELECT * FROM sys.schemas where [name] = 'temp')
> CREATE SCHEMA temp AUTHORIZATION dbo
>--END IF
>GO
>this code works
>USE AdventureWorks
>GO
>IF NOT EXISTS(SELECT * FROM sys.schemas where [name] = 'temp')
> PRINT 'CREATE SCHEMA temp AUTHORIZATION dbo'
>--END IF
>GO
>and this code works
>USE AdventureWorks
>GO
>CREATE SCHEMA temp AUTHORIZATION dbo
>GO
>can anyone shed some light on this.
>Thanks in advance for your help.
>Regards,
>HJ

How to create schem

Hello all,
I've always tried to write my SQL script so that they could run
multiple times without error so when I was creating a new schema i get
an error
USE AdventureWorks
GO
IF NOT EXISTS(SELECT * FROM sys.schemas where [name] = 'temp')
CREATE SCHEMA temp AUTHORIZATION dbo
--END IF
GO
this code works
USE AdventureWorks
GO
IF NOT EXISTS(SELECT * FROM sys.schemas where [name] = 'temp')
PRINT 'CREATE SCHEMA temp AUTHORIZATION dbo'
--END IF
GO
and this code works
USE AdventureWorks
GO
CREATE SCHEMA temp AUTHORIZATION dbo
GO
can anyone shed some light on this.
Thanks in advance for your help.
Regards,
HJTry something like:
USE AdventureWorks
GO
IF NOT EXISTS(SELECT * FROM sys.schemas where [name] =
'temp')
EXEC('CREATE SCHEMA temp AUTHORIZATION dbo')
-Sue
On 23 Mar 2006 09:26:13 -0800, hanklvr@.yahoo.com wrote:

>Hello all,
>I've always tried to write my SQL script so that they could run
>multiple times without error so when I was creating a new schema i get
>an error
>USE AdventureWorks
>GO
>IF NOT EXISTS(SELECT * FROM sys.schemas where [name] = 'temp')
> CREATE SCHEMA temp AUTHORIZATION dbo
>--END IF
>GO
>this code works
>USE AdventureWorks
>GO
>IF NOT EXISTS(SELECT * FROM sys.schemas where [name] = 'temp')
> PRINT 'CREATE SCHEMA temp AUTHORIZATION dbo'
>--END IF
>GO
>and this code works
>USE AdventureWorks
>GO
>CREATE SCHEMA temp AUTHORIZATION dbo
>GO
>can anyone shed some light on this.
>Thanks in advance for your help.
>Regards,
>HJ

How to create schem

Hello all,
I've always tried to write my SQL script so that they could run
multiple times without error so when I was creating a new schema i get
an error
USE AdventureWorks
GO
IF NOT EXISTS(SELECT * FROM sys.schemas where [name] = 'temp')
CREATE SCHEMA temp AUTHORIZATION dbo
--END IF
GO
this code works
USE AdventureWorks
GO
IF NOT EXISTS(SELECT * FROM sys.schemas where [name] = 'temp')
PRINT 'CREATE SCHEMA temp AUTHORIZATION dbo'
--END IF
GO
and this code works
USE AdventureWorks
GO
CREATE SCHEMA temp AUTHORIZATION dbo
GO
can anyone shed some light on this.
Thanks in advance for your help.
Regards,
HJTry something like:
USE AdventureWorks
GO
IF NOT EXISTS(SELECT * FROM sys.schemas where [name] ='temp')
EXEC('CREATE SCHEMA temp AUTHORIZATION dbo')
-Sue
On 23 Mar 2006 09:26:13 -0800, hanklvr@.yahoo.com wrote:
>Hello all,
>I've always tried to write my SQL script so that they could run
>multiple times without error so when I was creating a new schema i get
>an error
>USE AdventureWorks
>GO
>IF NOT EXISTS(SELECT * FROM sys.schemas where [name] = 'temp')
> CREATE SCHEMA temp AUTHORIZATION dbo
>--END IF
>GO
>this code works
>USE AdventureWorks
>GO
>IF NOT EXISTS(SELECT * FROM sys.schemas where [name] = 'temp')
> PRINT 'CREATE SCHEMA temp AUTHORIZATION dbo'
>--END IF
>GO
>and this code works
>USE AdventureWorks
>GO
>CREATE SCHEMA temp AUTHORIZATION dbo
>GO
>can anyone shed some light on this.
>Thanks in advance for your help.
>Regards,
>HJ

Wednesday, March 28, 2012

How to create nested sql scripts

Hello,

I want to be able to create the tables in a database from multiple scripts.

I have a separate sql script for each table and I want to make one master sql script that call all separate table scripts.

I searched for hours now in the documentation and the internet and I can't find a simple solution. I hope somebody here can help me. I just want to run a sql script from another sql script...

Bernard Dijkstra

This is a solution:

1. I made in c:\ the file master.sql that contain


EXEC xp_cmdshell 'sqlcmd -i "c:\child1.sql"';

EXEC xp_cmdshell 'sqlcmd -i "c:\child2.sql"';

2. child1.sql contain : select 'This is script 1'

child2.sql contain : select 'This is script 2'

3.if i run in command:c:>sqlcmd -i "c:\master.sql" the output is :


--
--
--


-

This is script 1

NULL

(1 rows affected)

NULL

output

--
--
--


-

This is script 2

NULL

(1 rows affected)

NULL


C:\>

hth

so, the ideea is to use sqlcmd to run scripts

|||

Thanks for your idea, but I think it is no solution for me.

So there is no simple solution that also can be used in the Query Analyzer and other tools. :-(

|||

For SQL 2000 i think you can replace sqlcmd (that it is for 2005) with isql or osql; xp_cmdshell is in 2000 too.

Try it, don't be angry !

hth

|||

This still won't work for me, since I want to be able to run the script in the Query Analyzer since that's the tool our customers use to run SQL scripts.

I want them to select the database in the Query Analyzer, then load a script and run it.

With this solution this won't work (easily). So I have to put everything in one script, what will be a problem with version management on object level...

I'm not angry, but I'm disappointed...

Thanks for your help anyway|||I think you can do :

exec("use YourDB")
go
EXEC xp_cmdshell 'sqlcmd -i "c:\master.sql"';

|||

I tried this and it seems that the context isn't preserved.

I will write a simple program that will generate a master script that can be used to create the database...

How to create multiple connection in T_SQL script

How to create multiple connection in the same T-SQL script and apply this in a query.

*I can do that?

Exemple like that (is not working...!)
========================
Server Name:ServerName1
User:user_srv1
Password : PW_srv2
Server Name:ServerName2
User:user_srv2
Password : PW_srv2

SELECT a.FieldID, b.FieldID FROM
ServerName1.DatabaseName.dbo.TableName a,
ServerName2.DatabaseName.dbo.TableName b
WHERE a.FieldID=b.FieldIDCreate server1 and server2 as link servers, then you can execute the query.

Monday, March 26, 2012

How to create database from script file?

Hi
I use SQLServer 2000 with SP3
I have script file that has been created using "generate SQL script"
command from SQL server Enterprise manager.
But I can't find how to create database using this script file. Is there
any way to create database from script file?
I appreciate your help!Copy the script to the clipboard during the "generate sql script" command.
Start the query analyzer and past the script
Run the script.
(You could also save the script and open it in the query analyzer)
Nico De Greef
Belgium
Freelance Software Architect
MCP, MCSD, .NET certified
"JK" <invalid@.address> wrote in message
news:e0JzX2Q$DHA.808@.TK2MSFTNGP12.phx.gbl...
> Hi
> I use SQLServer 2000 with SP3
> I have script file that has been created using "generate SQL script"
> command from SQL server Enterprise manager.
> But I can't find how to create database using this script file. Is there
> any way to create database from script file?
>
> I appreciate your help!
>|||In the Options tab of generate script, you have the option to "Script
Database". This will include the CREATE DATABASE statement.
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=...ublic.sqlserver
"JK" <invalid@.address> wrote in message
news:e0JzX2Q$DHA.808@.TK2MSFTNGP12.phx.gbl...
> Hi
> I use SQLServer 2000 with SP3
> I have script file that has been created using "generate SQL script"
> command from SQL server Enterprise manager.
> But I can't find how to create database using this script file. Is there
> any way to create database from script file?
>
> I appreciate your help!
>sql

Friday, March 23, 2012

How to create database from script file?

Hi
I use SQLServer 2000 with SP3
I have script file that has been created using "generate SQL script"
command from SQL server Enterprise manager.
But I can't find how to create database using this script file. Is there
any way to create database from script file?
I appreciate your help!check out www.dbghost.com
>--Original Message--
>Hi
>I use SQLServer 2000 with SP3
>I have script file that has been created using "generate
SQL script"
>command from SQL server Enterprise manager.
>But I can't find how to create database using this
script file. Is there
>any way to create database from script file?
>
>I appreciate your help!
>
>.
>|||Copy the script to the clipboard during the "generate sql script" command.
Start the query analyzer and past the script
Run the script.
(You could also save the script and open it in the query analyzer)
--
Nico De Greef
Belgium
Freelance Software Architect
MCP, MCSD, .NET certified
"JK" <invalid@.address> wrote in message
news:e0JzX2Q$DHA.808@.TK2MSFTNGP12.phx.gbl...
> Hi
> I use SQLServer 2000 with SP3
> I have script file that has been created using "generate SQL script"
> command from SQL server Enterprise manager.
> But I can't find how to create database using this script file. Is there
> any way to create database from script file?
>
> I appreciate your help!
>|||In the Options tab of generate script, you have the option to "Script
Database". This will include the CREATE DATABASE statement.
--
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"JK" <invalid@.address> wrote in message
news:e0JzX2Q$DHA.808@.TK2MSFTNGP12.phx.gbl...
> Hi
> I use SQLServer 2000 with SP3
> I have script file that has been created using "generate SQL script"
> command from SQL server Enterprise manager.
> But I can't find how to create database using this script file. Is there
> any way to create database from script file?
>
> I appreciate your help!
>

Monday, March 19, 2012

how to create a script to execute a package?

hello,

I am loading data from one DB to another. I wish to load them every day at night. I know to do that, I must write a script. But how to do it? I don't know. Could someone help me?

thanks in advance

Let se I got it right.

If you have a package or set of packages; you can use SQL Server agent to create a Job that rons on a scheduled basis. Why would you need an script?

|||

The easiest way to create a script is to use DTEXECUI.EXE to build the necessary command-line parameters for DTEXEC.EXE. You can then copy this into a batch file and schedule it using whatever tool you want.

With this said, Rafael is right - using SQL Server Agent is probably the simplest way to execute your packages on a schedule.

how to create a script to execute a package?

hello,

I am loading data from one DB to another. I wish to load them every day at night. I know to do that, I must write a script. But how to do it? I don't know. Could someone help me?

thanks in advance

Let se I got it right.

If you have a package or set of packages; you can use SQL Server agent to create a Job that rons on a scheduled basis. Why would you need an script?

|||

The easiest way to create a script is to use DTEXECUI.EXE to build the necessary command-line parameters for DTEXEC.EXE. You can then copy this into a batch file and schedule it using whatever tool you want.

With this said, Rafael is right - using SQL Server Agent is probably the simplest way to execute your packages on a schedule.

Friday, March 9, 2012

How to create a datasource which Connection type is SQL Server Anlysis Service in rss script?

I am making a rss script to deploy the reports and datasources.
I need to create a datasource which Connection type is SQL Server Anlysis Service. Thanks.

Does anyone know that? Or I am asking a stupid question?|||

I assume this has already been resolved but for anyone else;

Create a Datasouce in VS (or BIDS) of the Connection Type that you require and then open up the resulting .rds to

view the resulting connection type code.

i.e. For Analysis Services Connection Types

<Extension>OLEDB-MD</Extension> = Extension Code is "OLEDB-MD"

How to create a datasource which Connection type is SQL Server Anlysis Service in rss script?

I am making a rss script to deploy the reports and datasources.
I need to create a datasource which Connection type is SQL Server Anlysis Service. Thanks.

Does anyone know that? Or I am asking a stupid question?|||

I assume this has already been resolved but for anyone else;

Create a Datasouce in VS (or BIDS) of the Connection Type that you require and then open up the resulting .rds to

view the resulting connection type code.

i.e. For Analysis Services Connection Types

<Extension>OLEDB-MD</Extension> = Extension Code is "OLEDB-MD"

Friday, February 24, 2012

How to copy the content of 3000 Oracle tables into SQLServer?

I have to copy a large (3000) amount of different tables from a Oracle machine into an
SQLServer machine.
I am able to do this using a (VB) script.
I use now several methods:

1) INSERT INTO TABLE1 SELECT * FROM SID1..DB.TABLE1 (SID1 is a linked server)

2) INSERT INTO TABLE1 SELECT * FROM OPENQUERY(SID1,'SELECT * FROM DB.TABLE1')

3) Also used OPENROWSET method (similar to 2)

For small tables this is fine, however for BIG tables (15M Rows/150Cols) the methods above are too slow.
If I compare the same copy action with a simple DTS, the DTS is 3 times faster.
Also, the DTS seems to bulk copy the data directly into the desired database while the
mentioned methods first fill the tempdb, then the transaction log of the desired database and
then finally the desired table (need very much extra space on your filesystem).
The total size of data is about 300GB.

Can anyone supply me with a simple example how to copy data from an Oracle table into a
SQLServer table in script (or SQL) that is as fast as the DTS and not filling my logfiles??
I read the bcp (which I use for import/export files) and bulk insert commands, but
I do not understand how to use them in this question.Your best bet is going to be to dump the data out to delimited files from Oracle and bcp them in to SQL Server...

I would say your going to have at least Date conversion issues...|||I'm sorry. Did you say three THOUSAND tables?
Might I suggest that now might be a good time to redesign your application? A crappy database is still a crappy database, whether it resides on Oracle or SQL Server.|||..the "crappy application" is a quite well known ERP system... (FYI even M$ Navision has over 2000 tables for a single company).
It is a merge of over 30 different companies that went bankrupt recently which of a part will continue to exist while the other must be kept alive for the time being on another platform for the administrators of the company.

Indeed, a dump (master.dbo.xp_cmdshell 'bcp ""dbx.dbo.table1"" in ""\\OLS1\ddumps\Od1.dmp"" -q -k -N -U ""sa"" -P""xyz""') proposed by Brett runs a little (30%) faster (unfortunately Unicode is needed), however not the factor 3 that I can reach with a DTS.
The difference in this speed is (12hours vs 4 hours), that I am able to do an extraction every night (which is a must) or just once a week.|||Well, at least we agree upon its crappiness.|||No other solution(s) in mind?
I am really desperate... No experience with DTS scripting etc?|||Set your SQL Server database's recovery model option to "Simple" to reduce logging. Use DTS to transfer the data directly from your Oracle source, or use BCP to transfer it from a file.
Yes, BCP syntax is esoteric, but it is still the fastest method of loading data.
It seems to me that you are able to transfer the data, but are balking about individually coding all 3000 tables. I don't see any way around that unless you write a batch file to loop through BCPing each file.
Maybe there is a 3rd party utility that will do this for you.

Sunday, February 19, 2012

how to copy file from server to pc

i have other question here, i would like to copy file from server to a PC. I create a script (.dat file):
xcopy \\serverName\Users\yyu
\\ComputerName\c\yyu
Can you guy help me? Many thanks.Other than you may want a batch file (*.bat) rather than *.dat that should work./..what is the problem? Is there an error?|||You are right, it should be .bat. Not .dat. Thanks. But i tried, but it gave me the network path was not found. That means it can't find the computerName. Can you help me again?|||The only other thing I can suggest is that your destination should have a '$' after the drive letter like this:

\\ComputerName\c$\yyu

If your server can't see your computer than you have a network issue rather than a database issue and you may want to find a forum for that type of problem|||How can i make copy that the source folder name has a space.
E.g, XCOPY \\ServerName\Users\Y Yu

Many thanks.|||XCOPY "\\ServerName\Users\Y Yu"-PatP|||Thanks. i got it.

How to copy DB users/permissions to another DB?

Hi,
I would like to copy only database users and their permissions from one
Database A to Database B. Is there a script that would do this or is DTS a
possiblilty. What is the best way.
How to transfer logins and passwords between instances of SQL Server
http://support.microsoft.com/kb/246133
"sdmusicmaker" wrote:

> Hi,
> I would like to copy only database users and their permissions from one
> Database A to Database B. Is there a script that would do this or is DTS a
> possiblilty. What is the best way.
|||It's the same version SQL 2000 on the two machines, but different databases
that have the same names. I need the users on one to be in the other one.
"Edgardo Valdez, MCTS, MCITP, MCSD, MCDBA" wrote:
[vbcol=seagreen]
> How to transfer logins and passwords between instances of SQL Server
> http://support.microsoft.com/kb/246133
> "sdmusicmaker" wrote:
|||You will need to edit the output script for the specific users you need to
transfer.
"sdmusicmaker" wrote:
[vbcol=seagreen]
> It's the same version SQL 2000 on the two machines, but different databases
> that have the same names. I need the users on one to be in the other one.
> "Edgardo Valdez, MCTS, MCITP, MCSD, MCDBA" wrote:
|||not sure i know what you mean?
"Edgardo Valdez, MCTS, MCITP, MCSD, MCDBA" wrote:
[vbcol=seagreen]
> You will need to edit the output script for the specific users you need to
> transfer.
> "sdmusicmaker" wrote:
|||Here is a reference:
How to Script User and Role Object Permissions in SQL Server
http://www.sql-server-performance.com/bm_object_permission_scripts.asp
"sdmusicmaker" wrote:
[vbcol=seagreen]
> not sure i know what you mean?
> "Edgardo Valdez, MCTS, MCITP, MCSD, MCDBA" wrote:
|||Run the script mentioned in the Microsoft KB. This will generate a result
which is actually a SQL script. Since this will insert all user accounts to
the new instance, you can modify the script so it will only insert the users
you want
MCP MCDBA MCAD MCSD MCT MCTS MCITP:DBA
"Helping people grow and develop their full potential as God has plan for
them"
"Edgardo Valdez, MCTS, MCITP, MCSD, MCDBA" wrote:
[vbcol=seagreen]
> Here is a reference:
> How to Script User and Role Object Permissions in SQL Server
> http://www.sql-server-performance.com/bm_object_permission_scripts.asp
> "sdmusicmaker" wrote:

How to copy DB users/permissions to another DB?

Hi,
I would like to copy only database users and their permissions from one
Database A to Database B. Is there a script that would do this or is DTS a
possiblilty. What is the best way.How to transfer logins and passwords between instances of SQL Server
http://support.microsoft.com/kb/246133
"sdmusicmaker" wrote:

> Hi,
> I would like to copy only database users and their permissions from one
> Database A to Database B. Is there a script that would do this or is DTS a
> possiblilty. What is the best way.|||It's the same version SQL 2000 on the two machines, but different databases
that have the same names. I need the users on one to be in the other one.
"Edgardo Valdez, MCTS, MCITP, MCSD, MCDBA" wrote:
[vbcol=seagreen]
> How to transfer logins and passwords between instances of SQL Server
> http://support.microsoft.com/kb/246133
> "sdmusicmaker" wrote:
>|||You will need to edit the output script for the specific users you need to
transfer.
"sdmusicmaker" wrote:
[vbcol=seagreen]
> It's the same version SQL 2000 on the two machines, but different database
s
> that have the same names. I need the users on one to be in the other one.
> "Edgardo Valdez, MCTS, MCITP, MCSD, MCDBA" wrote:
>|||not sure i know what you mean?
"Edgardo Valdez, MCTS, MCITP, MCSD, MCDBA" wrote:
[vbcol=seagreen]
> You will need to edit the output script for the specific users you need to
> transfer.
> "sdmusicmaker" wrote:
>|||Here is a reference:
How to Script User and Role Object Permissions in SQL Server
http://www.sql-server-performance.c...ion_scripts.asp
"sdmusicmaker" wrote:
[vbcol=seagreen]
> not sure i know what you mean?
> "Edgardo Valdez, MCTS, MCITP, MCSD, MCDBA" wrote:
>|||Run the script mentioned in the Microsoft KB. This will generate a result
which is actually a SQL script. Since this will insert all user accounts to
the new instance, you can modify the script so it will only insert the users
you want
--
MCP MCDBA MCAD MCSD MCT MCTS MCITP:DBA
"Helping people grow and develop their full potential as God has plan for
them"
"Edgardo Valdez, MCTS, MCITP, MCSD, MCDBA" wrote:
[vbcol=seagreen]
> Here is a reference:
> How to Script User and Role Object Permissions in SQL Server
> http://www.sql-server-performance.c...ion_scripts.asp
> "sdmusicmaker" wrote:
>

How to copy DB users/permissions to another DB?

Hi,
I would like to copy only database users and their permissions from one
Database A to Database B. Is there a script that would do this or is DTS a
possiblilty. What is the best way.How to transfer logins and passwords between instances of SQL Server
http://support.microsoft.com/kb/246133
"sdmusicmaker" wrote:
> Hi,
> I would like to copy only database users and their permissions from one
> Database A to Database B. Is there a script that would do this or is DTS a
> possiblilty. What is the best way.|||It's the same version SQL 2000 on the two machines, but different databases
that have the same names. I need the users on one to be in the other one.
"Edgardo Valdez, MCTS, MCITP, MCSD, MCDBA" wrote:
> How to transfer logins and passwords between instances of SQL Server
> http://support.microsoft.com/kb/246133
> "sdmusicmaker" wrote:
> > Hi,
> > I would like to copy only database users and their permissions from one
> > Database A to Database B. Is there a script that would do this or is DTS a
> > possiblilty. What is the best way.|||You will need to edit the output script for the specific users you need to
transfer.
"sdmusicmaker" wrote:
> It's the same version SQL 2000 on the two machines, but different databases
> that have the same names. I need the users on one to be in the other one.
> "Edgardo Valdez, MCTS, MCITP, MCSD, MCDBA" wrote:
> > How to transfer logins and passwords between instances of SQL Server
> > http://support.microsoft.com/kb/246133
> >
> > "sdmusicmaker" wrote:
> >
> > > Hi,
> > > I would like to copy only database users and their permissions from one
> > > Database A to Database B. Is there a script that would do this or is DTS a
> > > possiblilty. What is the best way.|||not sure i know what you mean?
"Edgardo Valdez, MCTS, MCITP, MCSD, MCDBA" wrote:
> You will need to edit the output script for the specific users you need to
> transfer.
> "sdmusicmaker" wrote:
> > It's the same version SQL 2000 on the two machines, but different databases
> > that have the same names. I need the users on one to be in the other one.
> >
> > "Edgardo Valdez, MCTS, MCITP, MCSD, MCDBA" wrote:
> >
> > > How to transfer logins and passwords between instances of SQL Server
> > > http://support.microsoft.com/kb/246133
> > >
> > > "sdmusicmaker" wrote:
> > >
> > > > Hi,
> > > > I would like to copy only database users and their permissions from one
> > > > Database A to Database B. Is there a script that would do this or is DTS a
> > > > possiblilty. What is the best way.|||Here is a reference:
How to Script User and Role Object Permissions in SQL Server
http://www.sql-server-performance.com/bm_object_permission_scripts.asp
"sdmusicmaker" wrote:
> not sure i know what you mean?
> "Edgardo Valdez, MCTS, MCITP, MCSD, MCDBA" wrote:
> > You will need to edit the output script for the specific users you need to
> > transfer.
> >
> > "sdmusicmaker" wrote:
> >
> > > It's the same version SQL 2000 on the two machines, but different databases
> > > that have the same names. I need the users on one to be in the other one.
> > >
> > > "Edgardo Valdez, MCTS, MCITP, MCSD, MCDBA" wrote:
> > >
> > > > How to transfer logins and passwords between instances of SQL Server
> > > > http://support.microsoft.com/kb/246133
> > > >
> > > > "sdmusicmaker" wrote:
> > > >
> > > > > Hi,
> > > > > I would like to copy only database users and their permissions from one
> > > > > Database A to Database B. Is there a script that would do this or is DTS a
> > > > > possiblilty. What is the best way.|||Run the script mentioned in the Microsoft KB. This will generate a result
which is actually a SQL script. Since this will insert all user accounts to
the new instance, you can modify the script so it will only insert the users
you want
--
MCP MCDBA MCAD MCSD MCT MCTS MCITP:DBA
"Helping people grow and develop their full potential as God has plan for
them"
"Edgardo Valdez, MCTS, MCITP, MCSD, MCDBA" wrote:
> Here is a reference:
> How to Script User and Role Object Permissions in SQL Server
> http://www.sql-server-performance.com/bm_object_permission_scripts.asp
> "sdmusicmaker" wrote:
> > not sure i know what you mean?
> >
> > "Edgardo Valdez, MCTS, MCITP, MCSD, MCDBA" wrote:
> >
> > > You will need to edit the output script for the specific users you need to
> > > transfer.
> > >
> > > "sdmusicmaker" wrote:
> > >
> > > > It's the same version SQL 2000 on the two machines, but different databases
> > > > that have the same names. I need the users on one to be in the other one.
> > > >
> > > > "Edgardo Valdez, MCTS, MCITP, MCSD, MCDBA" wrote:
> > > >
> > > > > How to transfer logins and passwords between instances of SQL Server
> > > > > http://support.microsoft.com/kb/246133
> > > > >
> > > > > "sdmusicmaker" wrote:
> > > > >
> > > > > > Hi,
> > > > > > I would like to copy only database users and their permissions from one
> > > > > > Database A to Database B. Is there a script that would do this or is DTS a
> > > > > > possiblilty. What is the best way.