sql-server

How do I join 4+ tables in Access with a combination inner/outer?

为君一笑 提交于 2021-02-19 01:40:10
问题 I have not been able to find a way to join 4 or more tables using outer join in MSAccess. It works in SQL Server, but not Access. I don't believe it is possible. I have tables A, B, C, D and E. I need to join the tables like so: A left outer join B A left outer join C A inner join D B inner join E Access won't let you use conventional joins in the where clause when you use LEFT/RIGHT/INNER JOINS in the FROM clause. If you do, I get very, very vague errors like "JOIN expression not supported"

Server is not configured for RPC

邮差的信 提交于 2021-02-18 23:46:27
问题 Looking for my job history I foudn the error below: 06/18/2018 00:00:01,MBS_Lojas_ExportaMR_OutrasLojas,Error,1,WIN-VRT-01\SQL2008,MBS_Lojas_ExportaMR_OutrasLojas,Passo1,,Executed as user: WIN-VRT-01\integracao. Server 'x.y.z' is not configured for RPC. [SQLSTATE 42000] (Error 7411). The step failed.,01:11:15,16,7411,,,,0 I have this linked server with the option RPC and RPC Out with the values assigned to true. In the job I have this EXEC master.dbo.sp_serveroption @server=N'x.y.z', @optname

Server is not configured for RPC

前提是你 提交于 2021-02-18 23:43:32
问题 Looking for my job history I foudn the error below: 06/18/2018 00:00:01,MBS_Lojas_ExportaMR_OutrasLojas,Error,1,WIN-VRT-01\SQL2008,MBS_Lojas_ExportaMR_OutrasLojas,Passo1,,Executed as user: WIN-VRT-01\integracao. Server 'x.y.z' is not configured for RPC. [SQLSTATE 42000] (Error 7411). The step failed.,01:11:15,16,7411,,,,0 I have this linked server with the option RPC and RPC Out with the values assigned to true. In the job I have this EXEC master.dbo.sp_serveroption @server=N'x.y.z', @optname

Does a .NET SqlDataReader object use a database cursor, or the whole result set is loaded into RAM?

流过昼夜 提交于 2021-02-18 22:59:12
问题 Here is a sample code of using the SqlDataReader : // Working with SQLServer and C# // Retrieve all rows cmd.CommandText = "SELECT some_field FROM data"; using (var reader = cmd.ExecuteReader()) { while (reader.Read()) { Console.WriteLine(reader.GetString(0)); } } EDIT : I mean I want to understand whether there is the same mechanism when retrieving data from database in a while-loop (in case of SqlDataReader ) as it does when working with the SQLite. // working with SQLite and Java if

MS SQL 2012 : In SQL Shift columns to left side if column contains 0

微笑、不失礼 提交于 2021-02-18 22:21:42
问题 I need to shift data(columns) to left side if first columns(left side columns) have 0 value and NULL should be added in right side columns. Once non-zero value found in any columns then 0 value in later column should remain as it is. Input Data:- cust_id month1 month2 month3 month4 month5 c1 100 200 300 400 500 c2 0 0 50 250 350 c3 0 0 100 0 0 c4 100 0 100 0 500 c5 0 0 0 0 0 Expected Output Result:- cust_id month1 month2 month3 month4 month5 c1 100 200 300 400 500 c2 50 250 350 NULL NULL c3

What are the alternatives to using an ORDER BY in a Subquery in the JPA Criteria API?

喜你入骨 提交于 2021-02-18 22:01:57
问题 Consider the following two tables: Project ( id, project_name) Status ( id, id_project, status_name) Where Status contains all statuses in which a Project has been. Lets say we want to query all projects for which the latest status has the name "new". The Sql query that I come up with is: SELECT q.id_project FROM status q WHERE q.status_name like 'new' AND q.id IN ( SELECT TOP 1 sq.id from status sq WHERE q.id_project = sq.id_project ORDER BY sq.id DESC ) I'm trying to replicate the above

What are the alternatives to using an ORDER BY in a Subquery in the JPA Criteria API?

末鹿安然 提交于 2021-02-18 22:00:39
问题 Consider the following two tables: Project ( id, project_name) Status ( id, id_project, status_name) Where Status contains all statuses in which a Project has been. Lets say we want to query all projects for which the latest status has the name "new". The Sql query that I come up with is: SELECT q.id_project FROM status q WHERE q.status_name like 'new' AND q.id IN ( SELECT TOP 1 sq.id from status sq WHERE q.id_project = sq.id_project ORDER BY sq.id DESC ) I'm trying to replicate the above

Calculate loads and avoiding cursors

[亡魂溺海] 提交于 2021-02-18 20:45:36
问题 Given the following table structure, which is a representation of a bus route where passengers get on and off the bus with a door sensor. And, there is a person who sits on that bus with a clipboard holding a spot count. CREATE TABLE BusLoad( ROUTE CHAR(4) NOT NULL, StopNumber INT NOT NULL, ONS INT, OFFS INT, SPOT_CHECK INT) go INSERT BusLoad VALUES('AAAA', 1, 5, 0, null) INSERT BusLoad VALUES('AAAA', 2, 0, 0, null) INSERT BusLoad VALUES('AAAA', 3, 2, 1, null) INSERT BusLoad VALUES('AAAA', 4,

Calculate loads and avoiding cursors

怎甘沉沦 提交于 2021-02-18 20:45:26
问题 Given the following table structure, which is a representation of a bus route where passengers get on and off the bus with a door sensor. And, there is a person who sits on that bus with a clipboard holding a spot count. CREATE TABLE BusLoad( ROUTE CHAR(4) NOT NULL, StopNumber INT NOT NULL, ONS INT, OFFS INT, SPOT_CHECK INT) go INSERT BusLoad VALUES('AAAA', 1, 5, 0, null) INSERT BusLoad VALUES('AAAA', 2, 0, 0, null) INSERT BusLoad VALUES('AAAA', 3, 2, 1, null) INSERT BusLoad VALUES('AAAA', 4,

How do I make a copy of an SQL Server database and connect to it?

廉价感情. 提交于 2021-02-18 19:42:06
问题 I'm working on vb.NET 2013 and SQL server 2008R2. I have this situation to resolve: I have a database "DB1". I want to create a copy of this database on the same SQL server with another name "DB2", and after make this database ready to connect. How can I do this through code from Vb.NET? 回答1: Check out this tech net link for restore with new file names. http://technet.microsoft.com/en-us/library/ms190447(v=sql.105).aspx. Take a backup of database one (DB1). Verify backup is valid. Get correct