Automation of create stored procedure

2 views
Skip to first unread message

Pramod Jamadagni

unread,
Mar 11, 2013, 1:46:03 PM3/11/13
to Mushir, ranjan...@thomsonreuters.com, balachandra...@genpact.com, dwhte...@googlegroups.com

Hi guys,

Here is the BCP command to generate the create script of stored proc. Due to lack of time am stopping this here, if someone can spend time and come up with the full package that would be fine. Putting all the required stored procedure names in a excel/ text file and run the package to get the script would be wonderful.

 

--Run it on Command prompt

bcp "SELECT definition + char(13) + 'GO' FROM UPSOM_TEST_DEV.sys.sql_modules s INNER JOIN UPSOM_TEST_DEV.sys.procedures p ON [s].[object_id] = [p].[object_id] WHERE p.name LIKE 'sp_SA_Graduation_%'" queryout "D:\official\Release1.4.6.2\SP_scripts.sql" -S 192.168.1.159 -c -t -U"UPSOM_TEST" -P"cu6eZaka"

 

Thanks,


Pramod Jamadagni,

Indecomm global services - Technology division,

#10, Brigade south parade,

MG Road, Bangalore - 560001.

 

ranjan...@thomsonreuters.com

unread,
Mar 13, 2013, 5:05:52 AM3/13/13
to Pramod.J...@indecomm.net, mus...@planwell.com, balachandra...@genpact.com, dwhte...@googlegroups.com

Bhai log,

I have added few data flow task in a container (diff source same dest connection). when I run the package it fails for one DFT. But if I ran individually DFT passes.

What setting need to change in the sq container. Any idea?

 

 

ranjan...@thomsonreuters.com

unread,
Mar 13, 2013, 5:13:18 AM3/13/13
to ranjan...@thomsonreuters.com, Pramod.J...@indecomm.net, mus...@planwell.com, balachandra...@genpact.com, dwhte...@googlegroups.com

Sorry guys. Gt the issue. Its related to sm table constraint.

Mushir Alam

unread,
Mar 13, 2013, 6:56:41 AM3/13/13
to Pramod Jamadagni, ranjan...@thomsonreuters.com, balachandra...@genpact.com, dwhte...@googlegroups.com

Have you tried Powershell ? I think it is another convenient way to do that. See attached script for more(Rename it to *.ps1 which is the extension for Powershell scripts). Much of it is just Ctrl+C from the www.

 

Thanks

MMA

1 - Copy.ps11

Pramod Jamadagni

unread,
Mar 14, 2013, 6:40:56 AM3/14/13
to Mushir Alam, ranjan...@thomsonreuters.com, balachandra...@genpact.com, dwhte...@googlegroups.com

Attached is the solution.

 

Thanks,


Pramod Jamadagni,

Indecomm global services - Technology division,

#10, Brigade south parade,

MG Road, Bangalore - 560001.

 

CreateProcScript.dtsx
ProcList.txt
Reply all
Reply to author
Forward
0 new messages