Category "sql-server"

Make directory in Using SQL xp_create_subdir

CREATE PROCEDURE SPCheckDirectoryExists ( @chkdirectory as nvarchar(4000) ) AS SET NOCOUNT ON BEGIN DECLARE @folder_exists as int DECLA

MsSQL driver which could not establish a secure connection by using Secure Sockets Layer (SSL)?

I use standard driver com.microsoft.sqlserver.jdbc.SQLServerDriver to connect to a MSSQL server. I run my program in Eclipse and encounter error: Failed to obta

How can I generate an entity–relationship (ER) diagram of a database using Microsoft SQL Server Management Studio?

I want to generate an ER diagram of an SQL database using Microsoft SQL Server Management Studio (SMSS). However, I don’t know how to. I found this techni

JAVA/MSSQL: com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed

I have got a problem with database queries, when I try to run them from my groovy script. Sometimes, but very often, I've got an error: com.microsoft.sqlserve

Checking variable for NULL kills performance

I have following queries: DECLARE @application_number CHAR(8)= '37832904'; SELECT la.LEASE_NUMBER AS lease_number, la.[LEASE_APPLICATION] AS applicatio

How to soft delete a selected row in a DataGrid View using a button

So I have a DataGridView called MyMovieDataDrid which is connected to a sql server, and I already have my IsDeleted property, and a delete repository which is s

C# DbContext Connection Type and Server

I have a WinForm application developed on one laptop connected to an SQL server on the same laptop. I have a new laptop and have created a docker setup for an S

There are more columns in the INSERT statement than values specified in the VALUES clause [closed]

I want to save new record in SQL table. one of this table field is "username" that I want to add record by using session and other fields are

How to view the roles and permissions granted to any database user in Azure SQL server instance?

Could you guide me on how to view the current roles/permissions granted to any database user in Azure SQL Database or in general for a MSSQL Server instance?

How to get rid of this error: An OLE DB Provider was not specified in the ConnectionString. An example would be, 'Provider=SQLOLEDB;'

The purpose of my application is when a user types in a customer, their username and a message into the respective textboxes, it's supposed to be recorded into

How to add username column into trigger in SQL Server for audit trail

My audit trigger,shown below, works great except that I am required to record who exactly made the change. As written the system user field was supposed to do t

How to minimize transaction log sqlserver database .?

I have database size is more than 125 GB . and every 1 hour the database is not respond . the message is every time say (The transaction log for database MESP_2

calculating each day sum and last 7 days sum for max date to last 7 days and 14 days and 21 days sum in new columns

I have the following data set: which is daily sum. Based on this, how do i get last 7 days sum, 14 days sum and 21 days for each row in new columns. I have trie

SQL Server 2012 Random string from a list

say I have 3 values, Bill, Steve, Jack. and I want to randomly update a table with those values, eg Update contacts set firstname = ('Bill','Steve','Jack') whe

Change projection in MSSQL for web mapping (Leaflet,Openlayer, OpenStreetMaps, GoogleAPI, ...) to WSG48 or any other format

I have some WKT/WKB data in the MSSQL server like this and would like to show them on the map with the help of leaflet, Openlayer, OpenStreetMaps, or GoogleAPI.

How can I remove JSON property stored in a SQL Server column?

I have a task to remove a JSON property saved in a SQL Server database table's column. Here is the structure of my table OrderId Name JSON In the JSON c

How to copy file without using XP_CMDSHELL?

I am using SQL Server 2008. I would like to give users possibility to copy files. Is it possible without using XP_CMDSHELL procedure? Cause i should not change

scaffold-DbContext , command results in exception: System.Reflection.TargetInvocationException

When attempted to run a scaffold command I am now receieving the exception noted below. It may be important to note that this stopped working all of a sudden. C

a function calculate has been used in a true/false expression that is used as a table filter expression which is not allowed

I have a to check the current month and current year value for a measure in ssas tabular model but due to type mismatch i am not able to do this. For this, i ha

Problem with InsertCommand in SqlDataSource. ERROR: System.Data.SqlClient.SqlException: 'You must declare the scalar variable'@EXPEDIENTE'.'

I am a newbie and I have recently started working developing a web application, I do not have much experience so if you are able to solve the problem and explai