Category "sql-server"

SQL Server : select from stored procedure

Currently, this is the only way I know Create @tempTable1 Insert into @tempTable1 Exec mySP1 input1, input2 Create @tempTable2 Insert into @tempTable2

Eliminating NULL Values in SQL

I have a complex subquery within a query giving me this: Col 1 Col 2 value1 NULL NULL value2 value3 NULL NULL value4 value5 value5 But instead, I need this ou

SQL Server SubQuery Error - Only one expression can be specified in the select list when the subquery is not introduced with EXISTS

I'm trying to select multiple values from 3 subqueries and combine them together. But I get the error "Only one expression can be specified in the select list w

how to know when we set turn on "optimize for ad hoc Workloads"?

Recently, I read an article with the below link and would like to know this property in my SQL server but the result is a kind of weird in my server. http://web

Using multi character delimiter while exporting SQL table as text file using python

I am trying to export SQL table as multi-character delimited text file in python. I have tried using Pandas, but it is only supporting single character as delim

Improving SQL Query to check condition

Currently, the sql code that I have is to check for the three fee_code records do any of them have election_code = NA. I'm trying to figure out how to change th

How JSP get Data from SQL server using Tag

I am trying to get the resultList to my jsp using tag. public class DBUtil { public String getData()throws SQLException, ClassNotFoundException{

How to declare scalar variable?

I get this error: System.Data.SqlClient.SqlException: 'Must declare the scalar variable "@refSlips".' Code: SqlConnection con = new SqlConnection(connectionSt

Django SQL Server studio backend doesn't support altering from/to AutoField

Please help me I tried to connect to the database The connection was successful and the rules were lifted, but I have this problem raise NotImplementedError("t

EF6 Entity framework sometimes slow query on SQL Server

We have started a new project in .NET Core. We are just starting out and we are hitting a Web API endpoint to get some reference data of 8 records. We noticed

Error trying modify some attributes of a database table in a controller C#

I´m trying to modify attributes using sql database and web api .Net 6 In a controller i have this method private void SetRefreshToken(RefreshToken newRefr

Azure SQL: generate JSON with column as key

I have the below data in my sql server table Name Value ValueHash country aaa zzz lastname ccc yyy email [email protected] xxx firstName bbb www And I want the below Js

How to use Backup-SqlDatabase with SAS token?

I'm trying to implement log shipping using Backup-sqldatabase command, but SqlCredential is a required parameter for Azure Storage uploads according to the docs

Inserting rows into Microsoft SQL Server using pandas raises precision error

I am trying to insert data into a mssql database. I needed as fast method for this so I set the fast_executemany param to true. The upload works fine for most p

ApplicationIntent=ReadOnly with SQL Server Import and Export Wizard

I pull data down from an Azure based SQL Server every now and then using the SQL Server Import and Export Wizard (which I already know isn't the best way to go

EF core Invalid column name after reverse engineering database using EF Power Tools

I have an API using ASP.NET Core 6 & EF6 and I reverse engineered my database (SQL Server) using the EF Core Powers Tool extension. When I try to insert a P

SQL Server - Regex pattern match only alphanumeric characters

I have an nvarchar(50) column myCol with values like these 16-digit, alphanumeric values, starting with '0': 0b00d60b8d6cfb19, 0b00d60b8d6cfb05, 0b00d60b8d57a2b

Removing leading zeros from a string in SQL Server

i have removed all leading Zeros in my column but what if the same column has a space its replaced by '0'.. Example: batch number has 000123, 0000145 but when t

Using a public key on Azure server, and the private key on-premise

This question is about how to use a public key/private key pair to encrypt sensitive customer data. The data will be input by the customer in a web portal in az

Most current price based on effective date

I am using SQL Server Management Studio and want to show the most current price for every day in a date calendar table. There are two tables: the Calendar table