SQL Remote User's Guide
Command Reference for Adaptive Server Enterprise
To build a long SQL statement for passthrough.
sp_passthrough_piece string
Argument | Description |
---|---|
string | A piece of a statement to be executed in passthrough mode. |
sp_passthrough_subscription procedure
The sp_passthrough procedure is used to send statements directly to a set of remote users. Statements that are longer than 255 characters have to be built up piece by piece.
To build and send a long SQL statement, call sp_passthrough_piece for all but the final piece of the statement, and then call sp_passthrough for the final piece. This completes and replicates the statement.
All pieces of a passthrough statement must be built within a single transaction.
The following statements send a long passthrough statement to the current list of passthrough recipients:
begin transaction go exec sp_passthrough_piece 'CREATE TABLE DBA.employee ( emp_id integer NOT NULL, manager_id integer NULL, emp_fname char(20) NOT NULL, emp_lname char(20) NOT NULL,' go exec sp_passthrough_piece ' dept_id integer NOT NULL, street char(40) NOT NULL, city char(20) NOT NULL, state char(4) NOT NULL, zip_code char(9) NOT NULL, phone char(10) NULL,' go exec sp_passthrough_piece 'status char(1) NULL, ss_number char(11) NOT NULL, salary numeric(20,3) NOT NULL, start_date date NOT NULL, termination_date date NULL, birth_date date NULL,' go exec sp_passthrough ' bene_health_ins char(1) NULL, bene_life_ins char(1) NULL, bene_day_care char(1) NULL, sex char(1) NULL, PRIMARY KEY (emp_id), )' go commit go