Tag: c#

dynamically Convert SQL query to Mongo Shell scritp using C#

We are upgrading to MongoDB from SQL Server. All our writes are happening to SQL + Mongo and reads happen on MONGO. As per our application architecture, we save some SQL queries stored in a table and execute them on need. Since we now are doing all our reads from Mongo, I was wondering if […]

QODBC SQL timeout

I have a C++ QT application running on many devices, which needs to communicate to MS SQL server. I’m using QODBC3 (unixODBC) driver. The SQL connection is once initialized and connected and then used repeatedly. Thanks to this, the query runs fast (max 20ms). Everythink works fine when there is no connection issue. When network […]

Incorrect syntax near the keyword 'file' for one database

I am getting this error: System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near the keyword ‘file’. Query looks like this: UPDATE t SET name = s.[Value] FROM [dbo].[file] t JOIN [dbo].[#TempTable] s ON t.[name] = s.[Key] Temp table created: CREATE TABLE [#TempTable] ([Key] varchar(500), [Value] varchar(500)) Same thing in code: var commandText = “UPDATE t ” + $”SET […]

Check Directory accessibility for SQL Server backups

I am trying to implement an SQL Server backup client using SMO. The system is designed so that the user can manually configure where SQL Server stores its backups, by default its set to the Windows TEMP directory but the user can change that to whichever directory he desires. The problem is SQL Server might […]

DataTable Data List with Related Column on Asp.Net

I have the below table in SQL: PARENT_CODE CHILD_CODE ATTRIBUTE_NAME ATTRIBUTE_DESCRIPT R_YEAR ————- ———— ————– —————— ———– 1 001 ATT1 Description1 2016 1 001 ATT2 Description2 2016 1 001 ATT3 Description3 2016 1 001 ATT4 Description4 2016 1 001 ATT5 Description5 2016 1 001 ATT6 Description6 2016 1 002 ATT1 Description1 2016 1 002 ATT2 […]

Visual studio remote server link issue

Hi I am new to visual studio( currently working on VS Community) and developing a web app for a client as my project. they have given me an invitation to join visual stuido via email. So my questions are: i) Whenever I connect to their server , the option for viewing the output in web […]

Login failed for user 'sc' even after

I am trying to run a web application but I just cannot login with a user account (sc). I keep getting Login failed for user ‘sc’. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in […]

Stored procedure with user-defined table as parameter using EF

I need to pass a list of string to my stored procedure Sp_Calculate_TimeSheet_Global_Info So I created these two types : CREATE TYPE [dbo].[Type_cmd] AS TABLE ( [TypeName] [varchar](50) NULL ) GO CREATE TYPE [dbo].[Etape_cmd] AS TABLE ( [EtapeName] [varchar](50) NULL ) GO the signature of the stored procedure is the following : DECLARE @return_value int […]

SqlConnection.InfoMessage Stops Firing

When I have my EF model mapping for a stored procedure set to a complex type I’m losing messages output by the stored procedure. CREATE PROCEDURE dbo.[TestPrints] AS PRINT ‘hello world 1’ SELECT 1 AS ‘Test Column’ PRINT ‘hello world 2’ RETURN 0 var res = new Entities(); var sqlConn = (SqlConnection)res.Database.Connection; sqlConn.InfoMessage += (obj, […]

SIze of SSIS Package and performance

Can you please tell me, has the size of ssis package influence on the performance of package execution? Now I am having a package of ~50mb size cause of included classes in script components. Should I try to reduce the package size, or does it not matter?

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.