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