-
How to append contents of files?
I have two files containing the SQL statements to drop and create two stored procedures, "StoredProcedure1.sql" and "StoredProcedure2.sql".
It is possible to (1) create a new file (2) take the contents of both files and append the contents of both files into this new file using T-SQL?
-
Not without resorting to such hacks as xp_cmdshell.
I would use your favorite scripting language (python, dos, javascript, vbscript, whatever) to do this.
-
Whatever is available in T-SQL
I've tried looking at xp_cmdshell, but I can't seem to find a solution even with xp_cmdshell.
-
with xp_cmdshell, you can do *anything*. that's why you shouldn't use it :}
if you must know, however, you can use this DOS command in windows to concatenate two files to a third file:
copy file1.txt+file2.txt file3.txt
so you would just pass this to xp_cmdshell to do what you are asking.
Last edited by jezemine; 10-11-2006 at 11:06 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|