Why this query uses two table scans?

I have this simple query on SQL Server 2008 R2: SELECT Art.ID_Articulo, conv.Factor AS PesoToneladas FROM dbo.Articulos Art LEFT JOIN dbo.Conversiones conv ON conv.ID_Articulo = Art.ID_Articulo AND conv.ID_Unidad1 = Art.ID_Unidad Table Articulos is indexed individually by ID_Articulo and ID_Unidad. Table Conversiones is indexed individually by ID_Articulo and ID_Unidad1. Execution plans shows table scan for both […]

SQL Server msdb.dbo.sp_send_dbmail

I want to publish some query results in the e-mail in a structured format. I’m using the @body_format as ‘HTML’. I want to do like: Declare @processed_rows int declare @Sourcetype varchar(100) select @sourcetype = (some SQL query) select @processed_rows = (some SQL query) exec msdb.dbo.sp_send_dbmail @body=’some HTML’ , @subject = ‘IGD-DEVELOPMENT SERVER UPDATED’, @profile_name = […]

how to re-start from package from where it stopped on user selection

We have a Master SSIS package and it calls few other child packages and some tasks,We have UI portal build for it to start the master package and to check the status of the package.Whenever package fails(i.e.because of network issues or other errors which can be rectified by user.) at particular task either in master […]

Hash passwords using crypto and then save to database

Currently i have this code // POST: users/Create // To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see http://go.microsoft.com/fwlink/?LinkId=317598. [HttpPost] [ValidateAntiForgeryToken] public ActionResult Create([Bind(Include = “id,naam,wachtwoord,email,isadmin”)] user user) { user.wachtwoord = Crypto.HashPassword(user.wachtwoord); if (ModelState.IsValid) { db.users.Add(user); db.SaveChanges(); return RedirectToAction(“Index”); } return View(user); } now […]

How to fetch query execution statistics using Oracle DB?

I am new to database. I try to run a simple query on SQL Server 2014 and Oracle 12c. This is the execution plan I get using SQL Server. It contains information about I/O cost and CPU cost in seconds. However I can’t find the same information using Oracle. The CPU cost shown in the […]

SQL Server EVENTDATA() not working from MAC SQL Pro for SQL Server

SQL Server EVENTDATA() is not working from MAC SQL Pro for SQL Server. I’m using a trigger to validate the IP address of the users that get logged in to SQL Server. This is my trigger: CREATE TRIGGER [trLogOnCheckIP] ON ALL SERVER WITH EXECUTE AS ‘sa’ FOR LOGON AS BEGIN DECLARE @IPAddress NVARCHAR(50) SET @IPAddress […]

How to send email based group

How to send email based group? I have three data group 1 = email1@xxmail.com = 2 select items group 2 = email2@xxmail.com = 1 select items I use the following method , the first group I get 2 items But in groups of two I get 3 items SET ANSI_NULLS ON SET QUOTED_IDENTIFIER ON GO […]

how to differentiate between my Order Model and the order sql function in Asp.Net MVC view page

there seems to be a problem with my query statement in my view page for my reports. I’m unable to execute this query because (I think) my Order table is clashing with the order sql statement function. Does any one know a solution to this? I know how to differentiate in the query builder, as […]

SQL Server : Query not running as needed

I am working with Sage Evolution and do a lot of the back end stuff to customize it for our company. I need to write a query where, when a user enters a negative quantity the system must not allow the transaction, however when the user enters a negative quantity and the product belongs to […]

parameterized insertion of data half selected from other column half constant gives invalid pseudocolum

I have the following query “INSERT INTO t1 select $v1,c2 FROM t2 WHERE c3= $v2”; which is executed as SqlCommand cmd= new SqlCommand(query, conn); cmd.Parameters.AddWithValue(“$v2”, data); foreach (string value in list) { cmd.Parameters.AddWithValue(“$v1”, value); cmd.ExecuteNonQuery(); } however this results in an error: An unhandled exception of type ‘System.Data.SqlClient.SqlException’ occurred in System.Data.dll Additional information: Invalid pseudocolumn […]

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