Questions tagged as 'sql-server'

3
answers

How can I exclude the penultimate number of a period?

I'm trying to leave the period from 201601 to 20161 in SQL, but I can not do it at all! Can anyone help me? SELECT CONVERT(NUMERIC(5), CONVERT(VARCHAR(4), YEAR(Periodo_Mensal))+ CONVERT(VARCHAR(4), MONTH(Periodo_Mensal))) AS PERIODO...
asked by 01.11.2016 / 20:51
2
answers

Simple SQL Query

I have a proc that gets the ID of a product. If it gets NULL, then it should list all products. If you get the specific ID, you should only list that product. Is there any way to do this without having to create a dynamic query?     
asked by 06.11.2015 / 14:16
1
answer

Install SQLServer with the application

I am finalizing an application and will compile using Inno Setup . The system I am using SQLServer . I will install the system on other computers. Is the database installed on the computers that will receive the application or do I have...
asked by 07.08.2015 / 21:48
2
answers

How can I create array in SQL Server?

In SQL Server Management Studio 2012 have the possibility to create array in a procedure? I did a google search and did not find, it seems like a table variable is used to store more than one value from a select.     
asked by 22.05.2016 / 12:50
3
answers

How to compare the structure of two SQL Server databases?

I need to compare the DDL structure of two databases, where one is the production bench and the other is the system approval. What tools can be used to do this?     
asked by 24.05.2016 / 17:49
1
answer

Search only the smallest number of each letter

How do I find only the smallest number of letters in the Sql server? My table: Expected result: A - 1 B - 2 C - 1 D - 1 E - 3     
asked by 01.06.2016 / 15:47
2
answers

SQL Maximum value of another table

I'm doing a course project and I took the last step and would like a little help from you .. The project is a leased SQL database (contract for "rental" of cars.) The tables that import here and the values are: (there are more values, but...
asked by 27.04.2018 / 17:25
2
answers

Search performance involving multiple disks

Assuming a query that uses JOIN between two or more tables, such as: SELECT * FROM foo INNER JOIN bar ON foo.id = bar.id Is there performance gain if the data in the tables are in different HD's (due to having more heads reading a...
asked by 22.10.2014 / 22:49
1
answer

Enter X number of characters in SQL Server field

Hello, I have two banks BDMCOM1 and BDMCOM1_V3_ALEA, both of which have a table named ProductDrive and the field called CodigoProduct, in the database table BDMCOM1, theProductDocument has 5 digits, in the table of the other bank theProductDocume...
asked by 07.07.2016 / 21:40
2
answers

System modulation

I'm developing a C # system with WinForms of Livestock Control for a farm, and will communicate with a scale to improve the weighing process. Some of the features are (Invoice entry, vaccination, casualties, transfers, purchases, stock). I...
asked by 26.10.2016 / 16:09