Questions tagged as 'sql-server'

2
answers

Select does not return anything

I have the following method: public DataTable Select(bool all = true, string campos = null) { if (all && campos == null) _sql.Append("SELECT * FROM "); else _sql.Append("SELECT " + campos + " FROM "); _sql.A...
asked by 02.01.2015 / 14:03
1
answer

Foreign key joint between index field and a possible string

I'm creating an application where I thought of a possibility to insert all the existing addresses in the system into a single table, for users, clients, suppliers, etc. the structure of my table would look like this: __id => CHAVE_PRIMÁRIA...
asked by 23.01.2015 / 20:53
3
answers

Create tables randomly

My question is: I have a table containing 25 records of people names. But I need to randomly divide it into 5 groups of 5 people. Being a 'Group A' table with 5 people, another table 'Group B' with 5 people and so on. You need to be in...
asked by 19.09.2014 / 21:31
1
answer

Invalid colum name

SQL Server is giving me the following warning: "Invalid column name", and the column name has nothing to do with it.     
asked by 03.02.2015 / 12:47
1
answer

Begin transaction is blocking my entire database

I have a problem, I have a script that makes reading large files in XML. Before starting the insertion of these data, I do a begin transaction and end the commit , however throughout the process it may take up to 20 minutes my database u...
asked by 03.02.2015 / 20:10
1
answer

Random results in SQL queries without repeating (Infinite Scroll)

I have been having this problem for a long time and I can not resolve it. I have a page with infinite scroll that returns a few lines from the database, but the results most often repeat. I am using the following query whenever the scroll rea...
asked by 01.07.2014 / 16:13
1
answer

Sorting rows in a table with SQL SERVER

I have a table (Customer) example: ID Nome Order 1 Joao 1 2 Ana 2 3 Marta 3 4 Joana 4 The goal is to sort the contents as follows: I get the ID (@ID) of the position to be changed and the new position (@novaOrdem) for th...
asked by 04.07.2014 / 10:35
1
answer

Error 229 in SQL Server

I created a user in SQL Server 2014 and then logged in with the created user. When I was updating the Table folder it appears this message: That is, the user I created is not allowed to view the tables. What should I do?     
asked by 12.11.2014 / 21:28
1
answer

Select type of columns that come in a SELECT

Hello, my question is the following: I have a Select in SQLServer of two tables with inner join, they return a set of 5 columns. I would like to know how to list the type of these columns. I know that I can show the type of columns with...
asked by 17.06.2014 / 14:44
1
answer

SQL Server 2008 Express Remote Connection

I have 2 servers (one physical and one local VM) in which one of them has SQL Server 2008 R2 Enterprise Edition (physical) installed and the other one (local VM) I have SQL Server 2008 Express Edition. After facing problems with the remote co...
asked by 28.08.2014 / 15:22