Microsoft SQL Server Sink¶
Class: MicrosoftSQLServerSinkBlockV1
The Microsoft SQL Server Sink block enables users to send data from a Roboflow workflow directly to a Microsoft SQL Server database. This block allows seamless integration of inference results, metadata, and processed data into structured SQL databases for further analysis, reporting, or automation.
Database Connection Setup¶
The block supports two authentication methods:
- Windows Authentication (Default): Uses the current Windows credentials
- SQL Server Authentication: Uses username and password
Required connection parameters: * Host: The IP address or hostname of the Microsoft SQL Server instance * Port: The port number for SQL Server (default: 1433) * Database: The target database where data will be inserted * Table Name: The name of the table where the data will be inserted
Optional authentication parameters (for SQL Server Authentication): * Username: The SQL Server username for authentication * Password: The password associated with the username
If username and password are not provided, the block will use Windows Authentication (trusted connection).
Data Input Format¶
The block expects data in a dictionary format or list of dictionaries that map to the target table columns:
# Single row
{
"timestamp": "2025-02-12T10:30:00Z",
"part_detected": "Defective Part",
"confidence": 0.92,
"camera_id": "CAM_001"
}
# Multiple rows
[
{
"timestamp": "2025-02-12T10:30:00Z",
"part_detected": "Defective Part",
"confidence": 0.92,
"camera_id": "CAM_001"
},
{
"timestamp": "2025-02-12T10:31:00Z",
"part_detected": "Good Part",
"confidence": 0.95,
"camera_id": "CAM_002"
}
]
Important Notes¶
- The specified table must already exist in the database
- The authenticated user must have INSERT permissions
- Column names in the data must match the table schema
- When using Windows Authentication, ensure the service account has proper permissions
- The pyodbc package must be installed
Type identifier¶
Use the following identifier in step "type" field: roboflow_core/microsoft_sql_server_sink@v1to add the block as
as step in your workflow.
Properties¶
| Name | Type | Description | Refs |
|---|---|---|---|
name |
str |
Enter a unique identifier for this step.. | ❌ |
host |
str |
SQL Server host address. | ✅ |
port |
int |
SQL Server port. | ✅ |
database |
str |
Target database name. | ✅ |
username |
str |
SQL Server username. | ✅ |
password |
str |
SQL Server password. | ✅ |
table_name |
str |
Target table name. | ✅ |
data |
Union[Dict[Any, Any], List[Dict[Any, Any]]] |
Data to insert into the database. Can be a single dictionary or list of dictionaries.. | ✅ |
fire_and_forget |
bool |
Run in asynchronous mode for faster processing. | ✅ |
The Refs column marks possibility to parametrise the property with dynamic values available
in workflow runtime. See Bindings for more info.
Available Connections¶
Compatible Blocks
Check what blocks you can connect to Microsoft SQL Server Sink in version v1.
- inputs:
Roboflow Asset Library Attributes,Florence-2 Model,Email Notification,VLM As Classifier,EasyOCR,Object Detection Model,Twilio SMS Notification,Local File Sink,VLM As Classifier,Qwen 3.5 API,Model Monitoring Inference Aggregator,Keypoint Detection Model,Qwen-VL,OpenAI,CogVLM,JSON Parser,Google Vision OCR,OpenRouter,Florence-2 Model,Roboflow Dataset Upload,Qwen3.5-VL,Roboflow Vision Events,Qwen3-VL,Qwen2.5-VL,OpenAI,SIFT Comparison,S3 Sink,MoonshotAI Kimi,Twilio SMS/MMS Notification,SIFT Comparison,Google Gemini,Single-Label Classification Model,SmolVLM2,Stitch OCR Detections,Dynamic Zone,Webhook Sink,OCR Model,Roboflow Dataset Upload,Detection Event Log,Roboflow Custom Metadata,VLM As Detector,LMM For Classification,OpenAI-Compatible LLM,Anthropic Claude,Clip Comparison,Multi-Label Classification Model,Current Time,OpenAI,Llama 3.2 Vision,Anthropic Claude,MQTT Writer,Motion Detection,MoonshotAI Kimi,Google Gemini,Identify Changes,PTZ Tracking (ONVIF),Google Gemma,Detections Consensus,Google Gemma API,OPC UA Writer Sink,Slack Notification,Email Notification,LMM,Identify Outliers,Google Gemini,Instance Segmentation Model,Event Writer,GLM-OCR,Qwen 3.6 API,Qwen3.5,VLM As Detector,Llama 3.2 Vision,Stitch OCR Detections,CSV Formatter,OpenAI,Microsoft SQL Server Sink,Anthropic Claude - outputs:
Detections Classes Replacement,Morphological Transformation,Image Preprocessing,Email Notification,Halo Visualization,Morphological Transformation,Object Detection Model,Time in Zone,BoT-SORT Tracker,Text Display,Template Matching,Pixel Color Count,Image Threshold,Model Monitoring Inference Aggregator,Pixelate Visualization,Keypoint Detection Model,Time in Zone,Qwen-VL,OpenAI,CogVLM,Crop Visualization,SAM 3,Dot Visualization,Google Vision OCR,Florence-2 Model,Roboflow Dataset Upload,Qwen3.5-VL,Roboflow Vision Events,Polygon Zone Visualization,Polygon Visualization,S3 Sink,Twilio SMS/MMS Notification,QR Code Generator,SIFT Comparison,Single-Label Classification Model,Cache Get,Stitch OCR Detections,Dynamic Zone,Color Visualization,Roboflow Dataset Upload,Gaze Detection,Roboflow Custom Metadata,LMM For Classification,OpenAI-Compatible LLM,Line Counter Visualization,Stability AI Inpainting,Image Blur,Object Detection Model,Blur Visualization,Path Deviation,Current Time,SAM 3,Perspective Correction,Keypoint Visualization,Anthropic Claude,MQTT Writer,MoonshotAI Kimi,Google Gemini,SAM 3,Depth Estimation,Detections Consensus,Ellipse Visualization,Detections Stitch,Google Gemma API,Object Detection Model,Slack Notification,Time in Zone,Image Stack,Google Gemini,Cache Set,Bounding Box Visualization,Label Visualization,Keypoint Detection Model,Stitch OCR Detections,Size Measurement,Keypoint Detection Model,Multi-Label Classification Model,OpenAI,Perception Encoder Embedding Model,Anthropic Claude,Roboflow Asset Library Attributes,Moondream2,CLIP Embedding Model,Florence-2 Model,Seg Preview,YOLO-World Model,Multi-Label Classification Model,Segment Anything 2 Model,Twilio SMS Notification,Local File Sink,Single-Label Classification Model,Triangle Visualization,Icon Visualization,Qwen 3.5 API,Path Deviation,OpenRouter,Instance Segmentation Model,Distance Measurement,Instance Segmentation Model,OpenAI,Background Color Visualization,MoonshotAI Kimi,Google Gemini,Corner Visualization,Reference Path Visualization,Single-Label Classification Model,Line Counter,Halo Visualization,Webhook Sink,Dynamic Crop,Instance Segmentation Model,Stability AI Outpainting,Anthropic Claude,Multi-Label Classification Model,Clip Comparison,OpenAI,Llama 3.2 Vision,Motion Detection,PTZ Tracking (ONVIF),Camera Calibration,Model Comparison Visualization,Trace Visualization,Google Gemma,OPC UA Writer Sink,Line Counter,Circle Visualization,Email Notification,LMM,Event Writer,Instance Segmentation Model,Heatmap Visualization,Contrast Equalization,GLM-OCR,Qwen 3.6 API,Classification Label Visualization,Llama 3.2 Vision,Mask Visualization,Microsoft SQL Server Sink,Stability AI Image Generation,Semantic Segmentation Model,Polygon Visualization
Input and Output Bindings¶
The available connections depend on its binding kinds. Check what binding kinds
Microsoft SQL Server Sink in version v1 has.
Bindings
-
input
host(string): SQL Server host address.port(string): SQL Server port.database(string): Target database name.username(string): SQL Server username.password(secret): SQL Server password.table_name(string): Target table name.data(dictionary): Data to insert into the database. Can be a single dictionary or list of dictionaries..fire_and_forget(boolean): Run in asynchronous mode for faster processing.
-
output
Example JSON definition of step Microsoft SQL Server Sink in version v1
{
"name": "<your_step_name_here>",
"type": "roboflow_core/microsoft_sql_server_sink@v1",
"host": "localhost",
"port": 1433,
"database": "production_db",
"username": "db_user",
"password": "$inputs.sql_password",
"table_name": "detections",
"data": {
"object_detected": "Defective Part",
"timestamp": "2025-02-12T10:30:00Z"
},
"fire_and_forget": true
}