Questions tagged as 'sql-server'

1
answer

Composite primary key or primary key plus single index?

I am developing a report on my system to control the productivity of teams, the team table has the following information: (tblequipe) | id (pk) | nome | meta | | 1 | EQ01 | 5 | | 2 | EQ02 | 7 | | 3 | EQ03 | 6 | On...
asked by 28.01.2015 / 19:00
1
answer

Is there a way to know the name of the Database Server

Is there a sql commando that can inform the server and database where the select is running? I am available for more details     
asked by 07.01.2016 / 12:07
2
answers

Select random with SQLServer (mssql)

What is the correct way to make an unspecified (random) selection using PHP + SQLServer, since Microsoft queries do not accept MYSQL's ORDER BY RAND (). Using MYSQLI would look like this: $sql ="SELECT * FROM Tabela where campo=‘algum' ord...
asked by 15.01.2016 / 19:00
2
answers

Set Value Variable Local SQL Server

I would like to assign the value of the local variable within SELECT , as in the example below, but it displays the following error message:    "A SELECT statement that assigns a value to a variable must not be combined with data-retrie...
asked by 18.06.2014 / 21:18
1
answer

Release external access on sql server 2014

I have a machine in amazon, and the sql server is installed but I can not access from outside the server. I would like to know if there is any configuration other than to release the protocol in the Security group.     
asked by 11.08.2014 / 18:31
1
answer

Cubes of some clients in Analysis Services

I want to allow my clients to access your data to generate customized reports and use the power of Excel PowerPivot. Today all the clients (business) are in the same database and for the little that I know about cubes I draw the following strate...
asked by 09.10.2014 / 23:19
1
answer

Insert SQL Server records via ftp file.txt

I have the following structure in a .txt file from an FTP server: CodigoPedido: 120952 DataPedido: 2014-03-11-10:19 LocalVenda: MERCADO LIVRE Status: A ENVIAR Parceiro: 0 IdCliente: 103002 NomeCliente: Juliano Ramires Garcia | JRAMIRES G...
asked by 11.03.2014 / 15:11
1
answer

How to do PIVOT from a column, concatenating strings in SQLServer

Hello, I am doing a query in a database to identify all the columns that are primary key 's of the tables of a database and also to identify if they are identity . For this I use the query below: SELECT OBJECT_NAME(C.OBJECT_...
asked by 21.08.2018 / 16:21
2
answers

Timing when querying between 2 date ranges

I have a query where I query between 2 date ranges. On these dates, I apply DbFunctions.TruncateTime to filter searches for dates only, ignoring the time.    Note: these are DateTime fields .Where(p => DbFunctions.TruncateTime(p....
asked by 03.09.2018 / 20:58
3
answers

COMBOBOX dynamically in C # (SQL DB table data)

I need to load a combobox with data from a SQL table DEPARTMENT (with code and description / the description is displayed in the combobox but what is caught is the code) I used a dataSource (the one automatically configured by clicking on> on...
asked by 03.11.2014 / 14:50