SQL examples for SQL Server
The ZappySys API Driver is a user-friendly interface designed to facilitate the seamless integration of various applications with the Asana API. With its intuitive design and robust functionality, the ZappySys API Driver simplifies the process of configuring specific API endpoints to efficiently read or write data from Asana.
On this page you will find some SQL examples which can be used for API ODBC Driver or Data Gateway API Connector.
Read Workspaces
Read all workspaces
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Workspaces';
EXEC (@MyQuery) AT [LS_TO_ASANA_IN_GATEWAY];
Learn more about this SQL query.
Read Projects
Read all projects
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Projects';
EXEC (@MyQuery) AT [LS_TO_ASANA_IN_GATEWAY];
Learn more about this SQL query.
Read Tasks (default project)
Read all tasks (default project)
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Tasks';
EXEC (@MyQuery) AT [LS_TO_ASANA_IN_GATEWAY];
Learn more about this SQL query.
Read Tasks for a specific project
Read all tasks for a specified project
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Tasks WITH (ProjectId=''1200652735638082'')';
EXEC (@MyQuery) AT [LS_TO_ASANA_IN_GATEWAY];
Learn more about this SQL query.
Read Sub Tasks - First Level (default project)
Read all first level sub tasks for default project. If you sub tasks for 3rd, 4th level deep then this wont capture.
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM SubTasks';
EXEC (@MyQuery) AT [LS_TO_ASANA_IN_GATEWAY];
Learn more about this SQL query.
Read Sub Tasks - First Level for specified project
Read all first level sub tasks for a specified project id. If you sub tasks for 3rd, 4th level deep then this wont capture.
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM SubTasks WITH (ProjectId=''1200652735638082'')';
EXEC (@MyQuery) AT [LS_TO_ASANA_IN_GATEWAY];
Learn more about this SQL query.
Read Sub Tasks for a specified parent task
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM SubTasks WITH(QueryBy=''task'', TaskId=''1207150838176996'')';
EXEC (@MyQuery) AT [LS_TO_ASANA_IN_GATEWAY];
Learn more about this SQL query.
Read Workspace Tasks (All Projects)
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM WorkspaceTasks';
EXEC (@MyQuery) AT [LS_TO_ASANA_IN_GATEWAY];
Learn more about this SQL query.
Search Tasks (Advanced Filters - Just like Asana Search UI)
DECLARE @MyQuery NVARCHAR(MAX) = '--//search text in task title or description
SELECT * FROM search_tasks WITH(Text=''Hotfix'')
--//search text in all tasks from any projects listed below
SELECT * FROM search_tasks WITH(Text=''Hotfix'', ProjectsAny=''1200652735638082,1206028542305053'')
--//list all tasks from any projects listed below
SELECT * FROM search_tasks WITH(Text=''Hotfix'', ProjectsAny=''1200652735638082,1206028542305053'')
--//list all tasks due on specified date (same way you can use CreatedOn, CompletedOn ...)
SELECT * FROM search_tasks WITH(DueOn=''2024-12-21'')
--//list all tasks with due date after specified date (same way you can use CreatedOnAfter, CompletedOnAfter ...)
SELECT * FROM search_tasks WITH(DueOnAfter=''2024-12-21'')
SELECT * FROM search_tasks WITH(DueOnAfter=''yearstart+1d'')
--//list all tasks with due date after specified date (same way you can use CreatedOnBefore, CompletedOnBefore ...)
SELECT * FROM search_tasks WITH(DueOnBefore=''2024-12-21'')
SELECT * FROM search_tasks WITH(DueOnBefore=''monthstart-5d'')
--//list all tasks with due date after specified datetime (same way you can use CreatedAtBefore, CompletedAtBefore ...)
SELECT * FROM search_tasks WITH(DueAtBefore=''2024-12-21T23:59:59'')
SELECT * FROM search_tasks WITH(DueAtBefore=''now-10h'')
--//list all tasks with attachment
SELECT * FROM search_tasks WITH(HasAttachment=''true'')';
EXEC (@MyQuery) AT [LS_TO_ASANA_IN_GATEWAY];
Learn more about this SQL query.
Download Attachment to Local Disk
Download Attachment to Local Disk File.
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM download_attachment
WITH (
AttachmentId=''1208216218258030''
, TargetFilePath=''c:\temp\1208216218258030_AWS-refund-request.png''
, FileOverwriteMode=0 --0=AlwaysOverwrite, 1=FailIfExists, 2=SkipIfExists
)';
EXEC (@MyQuery) AT [LS_TO_ASANA_IN_GATEWAY];
Learn more about this SQL query.
Download Multiple Attachments to Local Disk
Download Multiple Attachments for a specified Parent (e.g. Task, Project, ProjectBrief) to Local Disk Folder. Saved file name syntax is {AttachmentId}_{FileName}.
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM download_attachments
WITH (
ParentId=''1206673375982078'' --Id of Task , Project or ProjectBrief
, SaveFolder=''c:\temp''
, OverwriteFile=1
)';
EXEC (@MyQuery) AT [LS_TO_ASANA_IN_GATEWAY];
Learn more about this SQL query.
Read Portfolios for a specified Owner
Read Portfolios for a specified Owner (Default Workspace).
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Portfolios WITH(OwnerId=''1200442904128317'')';
EXEC (@MyQuery) AT [LS_TO_ASANA_IN_GATEWAY];
Learn more about this SQL query.
Read Portfolios for a specified Owner and Workspace
Read Portfolios for a specified Owner Id and Workspace id.
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Portfolios WITH(OwnerId=''1200442904128317'', WorkspaceId=''1200442900140748'')';
EXEC (@MyQuery) AT [LS_TO_ASANA_IN_GATEWAY];
Learn more about this SQL query.
Read Project Goals
Read Goals for a specified Project Id.
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Goals WITH(Project=''1206673375982078'')';
EXEC (@MyQuery) AT [LS_TO_ASANA_IN_GATEWAY];
Learn more about this SQL query.
Read Workspace Goals
Read Goals for a specified Workspace Id.
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Goals WITH(Workspace=''1200442900140748'')';
EXEC (@MyQuery) AT [LS_TO_ASANA_IN_GATEWAY];
Learn more about this SQL query.
Read Team Goals
Read Goals for a specified Team Id.
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Goals WITH(Team=''1200442900140748'')';
EXEC (@MyQuery) AT [LS_TO_ASANA_IN_GATEWAY];
Learn more about this SQL query.
Read Memberships for a project
Read Memberships for a specific project.
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Memberships WITH(ProjectId=1206673375982078)';
EXEC (@MyQuery) AT [LS_TO_ASANA_IN_GATEWAY];
Learn more about this SQL query.
Read Memberships for a project
Read Memberships for a specific project.
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM Memberships WITH(PortfolioId=1206673375982077)';
EXEC (@MyQuery) AT [LS_TO_ASANA_IN_GATEWAY];
Learn more about this SQL query.
Read Time Entries for a Task
Read Time Entries for a specific task.
DECLARE @MyQuery NVARCHAR(MAX) = 'SELECT * FROM TimeTrackingEntries WITH(TaskId=1207150837043133)';
EXEC (@MyQuery) AT [LS_TO_ASANA_IN_GATEWAY];
Learn more about this SQL query.
Getting Started with Examples
ZappySys API Driver is a powerful software solution designed to facilitate the extraction and integration of data from a wide range of sources through APIs. Its intuitive design and extensive feature set make it an essential asset for any organization dealing with complex data integration tasks.
To get started with examples using ZappySys API Driver, please click on the following applications:
Key features of the ZappySys API Driver include:
The API ODBC driver facilitates the reading and writing of data from numerous popular online services (refer to the complete list here) using familiar SQL language without learning complexity of REST API calls. The driver allows querying nested structure and output as a flat table. You can also create your own ODBC / Data Gateway API connector file and use it with this driver.
Intuitive Configuration: The interface is designed to be user-friendly, enabling users to easily set up the specific API endpoints within Asana without requiring extensive technical expertise or programming knowledge.
Customizable Endpoint Setup: Users can conveniently configure the API endpoint settings, including the HTTP request method, endpoint URL, and any necessary parameters, to precisely target the desired data within Asana.
Data Manipulation Capabilities: The ZappySys API Driver allows for seamless data retrieval and writing, enabling users to fetch data from Asana and perform various data manipulation operations as needed, all through an intuitive and straightforward interface.
Secure Authentication Integration: The driver provides secure authentication integration, allowing users to securely connect to the Asana API by inputting the necessary authentication credentials, such as API tokens or other authentication keys.
Error Handling Support: The interface is equipped with comprehensive error handling support, ensuring that any errors or exceptions encountered during the data retrieval or writing process are efficiently managed and appropriately communicated to users for prompt resolution.
Data Visualization and Reporting: The ZappySys API Driver facilitates the seamless processing and presentation of the retrieved data from Asana, enabling users to generate comprehensive reports and visualizations for further analysis and decision-making purposes.
Overall, the ZappySys API Driver serves as a powerful tool for streamlining the integration of applications with Asana, providing users with a convenient and efficient way to access and manage data, all through a user-friendly and intuitive interface.