Skip to content
Advertisement

Tag: sql-server

Best practice to connect WPF and SQL Server

I have been working using WPF for a while, but due to lack of resources I used Access Files as Databases. Recently I got the opportunity to get my hands on a SQL Database. When I created my WPF Application (a simple data entry, which writes and read from the database) one of the IT guys where I work started

Parameterising an IN clause in PHP with sqlsrv

I have a method which selects records based on an array of integers which works when specifically typed. However, when I try to replace that array with one passed in from the method parameter sqlsrv_query() returns false. I am sure this is something very simple, but the ‘obvious’ possibilities to me do not work. Working Version Not Working Version 1

Installing pdo_sqlsrv driver in PHP 7.4 using CentOS 8

I have successfully installed php 7.4 with Remi packages in my CentOS 8 VPS (Used this guide https://www.digitalocean.com/community/tutorials/how-to-run-multiple-php-versions-on-one-server-using-apache-and-php-fpm-on-centos-8) I have a VirtualHost in my Apache server, that points to my domain and load the required php version for that environment. How do you enable the pdo_sqlsrv extension to a php 7.4 installation using Remi? I’ve followed this guide: https://learn.microsoft.com/en-us/sql/connect/php/installation-tutorial-linux-mac?view=sql-server-ver15#installing-the-drivers-on-red-hat-7-and-8 but

SQLSRV skips a row when returning a query

The code above does what I want and returns number of rows that matches what the query returns. However, I hardcoded the three sqlsrv_next_result($result);. The query will change depending on @AmbassadorID, so that piece needs to be dynamic. I tried the following loop: But this loop skips the first row. How do I fix this? Thanks! Answer Use sqlsrv_has_rows(). This

select and count devices at a location based on coordinates of both

By using STContains function of SQL geography it was possible to calculate if a set of coordinates is within an area , however this revealed that if last received coordinates were just outside the area than these coordinates do not match any location. What would be an efficient way to display how many and which devices (out of 4000) are

SQL Server Time Format is not equal to Client Side Time format

I’m trying to compare the client side time format (“14:00”) to SQL Server time format (“14:00:00.0000000″) with SQL Query, technically is not equal because SQL Server time format has seconds and milliseconds, so I tried to concatenate the seconds and milliseconds to client side time format in PHP script like this 14:00.”:00.0000000″ and yet is not equal to SQL Server

Advertisement