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:
VLM As Classifier,Google Gemma API,MoonshotAI Kimi,Stitch OCR Detections,Qwen2.5-VL,Anthropic Claude,Detection Event Log,SIFT Comparison,S3 Sink,SmolVLM2,LMM For Classification,Microsoft SQL Server Sink,Roboflow Custom Metadata,Google Vision OCR,Twilio SMS Notification,Dynamic Zone,Qwen-VL,JSON Parser,Email Notification,Roboflow Vision Events,PTZ Tracking (ONVIF),Stitch OCR Detections,Google Gemma,Event Writer,Qwen3.5-VL,Llama 3.2 Vision,Email Notification,Twilio SMS/MMS Notification,Identify Outliers,SIFT Comparison,OPC UA Writer Sink,Identify Changes,Llama 3.2 Vision,Model Monitoring Inference Aggregator,OpenRouter,OpenAI,Florence-2 Model,OpenAI-Compatible LLM,MoonshotAI Kimi,OpenAI,Single-Label Classification Model,OCR Model,VLM As Detector,Motion Detection,Qwen3.5,CogVLM,Instance Segmentation Model,Anthropic Claude,Google Gemini,Qwen 3.6 API,Clip Comparison,Google Gemini,Detections Consensus,CSV Formatter,Webhook Sink,Multi-Label Classification Model,LMM,OpenAI,Florence-2 Model,PLC Reader,Current Time,OpenAI,Qwen3-VL,VLM As Detector,Google Gemini,Roboflow Visual Search,Slack Notification,EasyOCR,Roboflow Dataset Upload,Roboflow Dataset Upload,PLC Writer,Qwen 3.5 API,Anthropic Claude,Object Detection Model,Local File Sink,MQTT Writer,Keypoint Detection Model,VLM As Classifier,GLM-OCR,Roboflow Asset Library Attributes - outputs:
Line Counter,MoonshotAI Kimi,Stability AI Image Generation,Trace Visualization,Path Deviation,Image Stack,Anthropic Claude,Icon Visualization,SIFT Comparison,Morphological Transformation,Color Visualization,LMM For Classification,Single-Label Classification Model,Perspective Correction,Corner Visualization,Roboflow Custom Metadata,Halo Visualization,Dynamic Zone,Keypoint Detection Model,Qwen-VL,Email Notification,Halo Visualization,Object Detection Model,Google Gemma,Background Color Visualization,Ellipse Visualization,Email Notification,Twilio SMS/MMS Notification,Text Display,Polygon Visualization,Crop Visualization,Image Preprocessing,Template Matching,Model Monitoring Inference Aggregator,OpenRouter,OpenAI,Florence-2 Model,Motion Detection,Heatmap Visualization,OpenAI,Perception Encoder Embedding Model,Blur Visualization,Depth Estimation,Instance Segmentation Model,Stability AI Outpainting,Anthropic Claude,YOLO-World Model,Google Gemini,Clip Comparison,Google Gemini,Keypoint Visualization,Webhook Sink,Florence-2 Model,Current Time,Contrast Equalization,OpenAI,Moondream2,Line Counter,Google Gemini,Slack Notification,Triangle Visualization,Time in Zone,CLIP Embedding Model,Multi-Label Classification Model,Local File Sink,Keypoint Detection Model,Pixel Color Count,GLM-OCR,Roboflow Asset Library Attributes,Polygon Zone Visualization,Time in Zone,Google Gemma API,Stitch OCR Detections,Line Counter Visualization,Semantic Segmentation Model,Distance Measurement,Image Threshold,Multi-Label Classification Model,Camera Calibration,QR Code Generator,S3 Sink,Microsoft SQL Server Sink,Twilio SMS Notification,Google Vision OCR,Image Blur,Morphological Transformation,Roboflow Vision Events,Size Measurement,PTZ Tracking (ONVIF),Stability AI Inpainting,Classification Label Visualization,Stitch OCR Detections,Event Writer,Qwen3.5-VL,Mask Visualization,Llama 3.2 Vision,Reference Path Visualization,Label Visualization,OPC UA Writer Sink,Dot Visualization,Cache Set,Dynamic Crop,Detections Stitch,Circle Visualization,Llama 3.2 Vision,BoT-SORT Tracker,Path Deviation,SAM3 Video Tracker,Gaze Detection,Segment Anything 2 Model,OpenAI-Compatible LLM,MoonshotAI Kimi,Single-Label Classification Model,CogVLM,Object Detection Model,SAM 3 Interactive,Qwen 3.6 API,Detections Consensus,Bounding Box Visualization,Multi-Label Classification Model,LMM,OpenAI,SAM 3,Instance Segmentation Model,Roboflow Visual Search,Roboflow Dataset Upload,SAM 3,Cache Get,Instance Segmentation Model,Detections Classes Replacement,Pixelate Visualization,Keypoint Detection Model,Instance Segmentation Model,Roboflow Dataset Upload,PLC Writer,Qwen 3.5 API,Object Detection Model,Anthropic Claude,Time in Zone,MQTT Writer,Polygon Visualization,SAM 3,Model Comparison Visualization,Single-Label Classification Model,Seg Preview
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
}