Using varbinary parameter with Dapper.NET

I’m trying to use a varbinary parameter with Dapper.NET as follows string secret = “secret”; // from SELECT ENCRYPTBYPASSPHRASE(‘secret’, N’xx’) >>; string ciphertext = “0x01000000393FE233AE939CA815AB744DDC39667860B3B630C82F36F7″; using (var conn = new SqlConnection(…)) { var result = conn.ExecuteScalar(@”SELECT CONVERT(NVARCHAR(4000), DECRYPTBYPASSPHRASE(@secret, @ciphertext)) as decrypted”, new { secret, ciphertext = Encoding.Unicode.GetBytes(ciphertext) }); } However the result is null. But […]

using sqldatareader with where clause in query

I need to read a specific value from the table, to use it in my field. But when I insert the where clause in query, it gets me null value, nothing more. My code is: string query_select_id = “SELECT * from table1 WHERE column1=@value”; SqlConnection con = new SqlConnection(ConString); try { con.Open(); SqlCommand createCommand = […]

SSIS ETL execute MySQL Stored procedure on Destination Server

I am working on an SSIS ETL and I wanna know if there is a possibility to execute a MySQL Stored Procedure. Here is what I want to do : From an SQL Server Database, I want to get Information by an ETL (SSIS) and send them to a MySQL Database (by a stored procedure) […]

How to create txt or csv file by tsql

I have a temp table in sql server 2008 and I need to create a csv of txt file by tsql from that temp table. What is the correct way for it? Thanks.

circular relationship

I have a question that circulates a lot in my head, I’d like to find a response that can unlock me … in the field of database (DBMS and Modeling MPD). Is it possible to find a circular relationship between two (or more)tables such as: Create Table TA ( TA_ID INTEGER not null, A SMALLINT, […]

Creating Membership Tables in MVC4 and VS2013

I am new to MVC, i created new empty template project started with the development, now i want to integrate membership in my project, i followed steps from Adding AspNet SimpleMembership to an Existing MVC4 Project After making appropriate changes when i build the project and run the site, i got following error: Unable to […]

SQL Transaction connected with WAITFOR DELAY

I was looking through some posts but I couldn’t find similar case that could explain me if this solution is safe. I want to execute many UPDATE queries at once but due to server performance issues, I can run only limited number of queries at once. The solution seems to be easy by using WAITFOR […]

Unable to upload SQL database to Azure

Im using SQL server 2016 and SSMS to manage database, im trying to deploy my database to azure through the deploy wizard and end with failure. Pls find below steps: Right click database, select “Deploy database to azure VM” Sign in with azure account. Fill cloud name and virtual machine name, the thing to note […]

Transaction with Snapshot isolation gives inconsistent result

Environment: SQL Server 2012 Backend: C# + EntityFramework We use Change Tracking to obtain changes from multiple tables. All the operations are done inside one transaction with Snapshot isolation level. All queries inside that transaction are read-only. using (var context = new BackendContext()) { using (var transaction = context.Database.BeginTransaction(IsolationLevel.Snapshot)) { try { int count1= context.Reservation.Count(); […]

SQL Server: Return one match from left join (using month() function)

I am trying to join two tables together based on multiple criteria: policy number, transaction type, year of a date, month of a date The majority of the policies will work fine with this code, but there are a few that will have multiple rows of data that would satisfy the join criteria, therefore returning […]

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