mssql commands

Five Stars

mssql commands

I am new to talend and am in need of executing a set of mssql commands in a sqlserver2008 Master and not finding a good way to do this. 

I need to run the following in open studio 7.01

 

IF EXISTS(SELECT * FROM master.sys.sysdatabases WHERE name = 'rawExport')
DROP DATABASE rawExport;
CREATE DATABASE rawExport;
IF EXISTS(SELECT * FROM master.sys.sysdatabases WHERE name = 'newResults')
DROP DATABASE newResults;
CREATE DATABASE newResults;

--Alter db back to multi user mode
ALTER DATABASE rawExport SET MULTI_USER
ALTER DATABASE newResults SET MULTI_USER"

 

and I need to run this as one step in a series where I am executing other ...bat files, which I have figured out using the tsystem job component.

thanks, for any help


Accepted Solutions
Employee

Re: mssql commands

Hi,

 

    One way is to use the tMSSQLRow component and another trick is to embed all the commands under a Stored proc and call the Stored Procedure using tMSSQLSp component.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved :-)

View solution in original post


All Replies
Employee

Re: mssql commands

Hi,

 

    One way is to use the tMSSQLRow component and another trick is to embed all the commands under a Stored proc and call the Stored Procedure using tMSSQLSp component.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved :-)

View solution in original post

Five Stars

Re: mssql commands

it took a bit, but worked through how to use the tmssqlrow component to make this work properly.

thanks, Chris

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog