all groups > sql server dts > february 2004 >
You're in the

sql server dts

group:

Need to create a script to insert records



Need to create a script to insert records JerryK
2/27/2004 6:06:25 PM
sql server dts: Hi,

I need to create a script that will insert a subset of the records in a
table into another copy of the table on a remote system. I do not have
access to the remote system via Enterprise Manager. Rather, I need to email
the script and have an operator execute the script in Query Analyzer. Can
DTS or Enterprise
Manager generate this script?

Thanks,

Jerry

Re: Need to create a script to insert records Allan Mitchell
2/28/2004 7:58:41 AM
What about

1. A Format File (pre generated)
2. DTS to text file the subset of rows
3. Mail the format file + output file and include a script which uses BULK
INSERT to do in the inserting.

The operator will simply change the location of the Format file.



--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.allisonmitchell.com - Expert SQL Server Consultancy.
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


[quoted text, click to view]

Re: Need to create a script to insert records Narayana Vyas Kondreddi
2/28/2004 8:01:39 PM
Just to add to Allan's suggestion, you could BCP out the data to a file,
mail the file across, and let the remote operator BCP in the data.

If all this is too complicated for the remote DBA, and you are not talking
about a huge number of rows, then you could use my stored procedure, that
generates INSERT statements from existing data. You simply will have to
email the generated INSERT statements, and the remote DBA will copy paste
them into Query Analyzer and run them:
http://vyaskn.tripod.com/code.htm#inserts
--
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm




[quoted text, click to view]
Hi,

I need to create a script that will insert a subset of the records in a
table into another copy of the table on a remote system. I do not have
access to the remote system via Enterprise Manager. Rather, I need to email
the script and have an operator execute the script in Query Analyzer. Can
DTS or Enterprise
Manager generate this script?

Thanks,

Jerry



AddThis Social Bookmark Button