Use server registered database connection in published gptool?

Have published a python gptool to server and while it is working, I've noticed that is has copied my connection file rather than referencing an existing database connection, registered in datastore. Can anyone provide insight on how to enter a variable in python that will instruct server to use a preregistered database connection when it runs the gptool, rather than always copying my connection file when I republish it? Thanks.

I understand how to register an sde connection, I have already registered the connection I wish to use. However my python gptool is not registering that it exists. Do you know how to correctly reference this in a python script so that when I publish the script as a gptool to arcgis server it will use it?

Hi, I am sorry. I didn't understand it. Are you looking for avoid Copy Data to Server or Copy connection file. I trust, for registered database it should copy connection file in to respective GP service v101 folder in ArcGIS server directories to pointed to actual data, rather than copy data to server.