Push data to Azure SQL database

I am pretty new using Azure SQL database. I have been given a task to push a 100 million record text file to Azure SQL database. I'm looking for suggestions how to do it in an efficient manner. ...
more »

2017-12-03 21:12 (2) Answers

How to combine results of 3 Joins?

I am trying to make a table per employee that will give the information per employee that was present/absent/work from home.For that I am writing a SQL query that is fetching the records using JOINS. However, I am writing 3 Join statements that are r...
more »

2017-12-03 10:12 (3) Answers

2 Functional Dependencies in a single table

I'm trying to create a schema based on these 2 Functional Dependencies. A -> B, C, D B -> D I'm trying to create a single table including both of these FDs with the following constraint: A pair tuple (B, D) can be repetitive...
more »

2017-12-03 03:12 (1) Answers

JDBC nested while loop

there. I am a beginner using java. I want to do a nested while loop for my SQL query results. My original result was like following, eno ename title date_visit ssn pname charge 103 Jekyl Doctor 20170717 946883650 Gers...
more »

2017-12-02 23:12 (1) Answers

Counting instructors in a database

I think I have the right idea to solve this function, but I'm not sure why I get this error when I try to test it. Can anyone please help me fix this? cur.execute(q) sqlite3.OperationalError: near "HAVING": syntax error Courses Table: ID, Course, S...
more »

2017-12-02 21:12 (1) Answers

Searching data for current date in SQL Server

Why is the first query taking less time than the second one in SQL Server? This query takes 4 seconds to complete: select * from salesinvmaster where day(salesdate) = day(getdate()) and month(salesdate) = month(getdate()) and year(sales...
more »

2017-12-02 12:12 (2) Answers

Efficient query to join three tables

My app has a users table, a teams table, a teams_users table, and an assessments table. Oversimplified: **users** id **teams** id **teams_users** team_id user_id **assessments** id user_id team_id A user can have many assessments. When I grab ...
more »

2017-12-02 00:12 (1) Answers

How to order/limit an inner join in MySQL?

I am bad at SQL. I need to get certain information out of my database. This information is a list of User ID's and their username under a single account. There are 3 tables involved. CUSTOMER customer_id CUSTOMER_RELATIONSHIP relationship_type...
more »

2017-12-01 22:12 (2) Answers

Selecting Top Occurance of Record by Date

Table Structure: ScheduledDate Date Commodity varchar Example Data ScheduledDate | Commodity --------------+------------ 2017-11-27 | KIDNEY BEANS 2017-11-27 | KIDNEY BEANS 2017-11-27 | RED BEANS 2017-11-28 | LARGE GREEN LENTIL 2...
more »

2017-12-01 20:12 (1) Answers

Kerberos Authentication for SQL Server

I am still seeing the following exception while trying to access SQL Server using Kerberos. What am I missing? Connecting to jdbc:sqlserver://SERVER:PORT;databaseName=DB_NAME;integratedSecurity=true;authenticationScheme=JavaKerberos;applicationName...
more »

2017-12-01 20:12 (0) Answers

Duplication of XML namespaces in SQL

I have the following problem, I need to remove the "cfdi_" for "cfdi:" I used the namespaces to solve that but they are duplicated by each node and I can not eliminate them, If you could help me I would appreciate it declare @Mydoc xml; set @Mydoc...
more »

2017-12-01 18:12 (2) Answers

c# - Data won't save in my database

My data won't save on my database. Instead of going into "Product has been added", it goes to "Product ID already exist" even though it's not. Here is the code: private void btnAddProduct_Click(object sender, EventArgs e) { if(txtNewProd...
more »

2017-12-01 13:12 (1) Answers

Multiple Hyper links in a same cell in SSRS Report

I am working on a SSRS report having hyperlinks to CRM. I need to implement a logic where a single textbox will have multiple CRM links. I have implemented a logic as below =(join(Code.RemoveDuplicates(lookupset(Fields!Deal.Value ,Fields!Deal.Value ...
more »

2017-12-01 10:12 (0) Answers

Retrieve values from dynamic sql

I have a strange setup at a client. The have a table that defines some categories. One of the fields is a view that contains the details for this category. These categories are setup dynamically hence the view column in the table. What I want to acco...
more »

2017-12-01 10:12 (1) Answers

SQL Server Query Error on WHERE

SQL Server 2005 via C# (VS 20015). Any idea why WHERE won't work? SQL statement is: SELECT AA003Employee.idEmployee, AA001Person.LastName, AA001Person.FirstName, AA017JobTitle.JobTitle, AA017JobTitle.Department, AA003Employee.Di...
more »

2017-12-01 03:12 (3) Answers

Common SQL query in Zend-Framework

How i can use a sql-query code that i already have on Zend-Framework using Model and Controller? I'm tried of many ways and i can't solve this. This is a example of "common sql-query code" to test: "SELECT id_arquivos_retorno FROM sa_arquivos_retor...
more »

2017-11-30 14:11 (1) Answers

SSIS expression to SQL statement

I am trying to convert "Derived Columns" Expressions to SQL statements to be able to add and replace column values and names. I am having some issues in finding the correct help to understand nested formulas in SSIS. Formula i have in SSIS is, [...
more »

2017-11-30 08:11 (2) Answers

NameSpaces in xml sql

How can I declare the namespaces in a query? I get an error when declaring the namespaces Declare @Mydoc xml set @Mydoc = ( select importe, algo,XD, (select impuesto,tasa,transferencia from CfdiDet ...
more »

2017-11-29 18:11 (1) Answers

Get ID of selected value in drop down

I am trying to save data in my database, as part of that I am trying to get the ID (primary key) of my selected item in my drop down. It keeps saving the same ID all the time. It only saves the first ID of any chosen item. How can I adjust my code s...
more »

2017-11-29 07:11 (2) Answers

Can I execute multiple SQL statements?

I am running an sql database for movies and I am working on this function so that whenever a user checks out a movie, the movie would be updated saying it has been checked out, then the checked out movie would be added to a table for checked out movi...
more »

2017-11-29 01:11 (5) Answers

Must Declare Scalar Value?

I am working with SQL and c# for my assignment. For this assignment I am running a movie database and I am stuck on this part where I have to check out a movie. I keep getting a 'must declare scalar value' but I am unsure how to do that. My code: &...
more »

2017-11-28 16:11 (1) Answers