Skip to content

Instantly share code, notes, and snippets.

View atrox390's full-sized avatar
⌨️
Working on Backend

Eduardo Ortega atrox390

⌨️
Working on Backend
View GitHub Profile
DECLARE @object as int;
DECLARE @hr as int
DECLARE @ret AS INT
DECLARE @status AS INT;
DECLARE @statusText AS NVARCHAR(MAX);
DECLARE @Header AS NVARCHAR(MAX);
DECLARE @json as table(Json_Table nvarchar(MAX));
DECLARE @Method NVARCHAR(MAX) = 'POST';
DECLARE @ContentType NVARCHAR(MAX) = 'application/json';
import pyodbc
import time
conn_str = "DRIVER={ODBC Driver 17 for SQL Server};SERVER=your_server;DATABASE=your_db;UID=your_user;PWD=your_password"
while True:
try:
cnxn = pyodbc.connect(conn_str)
cursor = cnxn.cursor()
@atrox390
atrox390 / DataTableDynamicConverter.cs
Created July 11, 2024 19:04
DataTable Dynamic JSON Convert
using Newtonsoft.Json;
using Microsoft.AspNetCore.Mvc;
[Route("api/[controller]")]
[ApiController]
class Program : ControllerBase
{
[HttpGet("/")]
public IActionResult Index()
{