Questions tagged as 'sql-server'

1
answer

How to convert a varchar type from a column to datetime within a view using SQL?

I have a view with a column of type varchar and I am trying to convert this column to a type date time my code is here: update temp_vertical_dashboard set data = convert (datetime,data,101) temp_vertical_dashboard is my view and date is the...
asked by 21.06.2017 / 13:42
1
answer

Use SQL Server DISTINCT Clause

Hello, I need some help! I need to do a query and bring the NIF's, without repeating. I do it like this: SELECT DISTINCT NIF FROM CustomerRegistrations But I want to bring in more columns from this table as well. But I can not do this: SE...
asked by 14.06.2017 / 16:35
1
answer

How to recover date from SQL Server correctly? [closed]

I created a simple CRUD using the ASP.NET MVC and I can save my records normally. If I looked in the database, my date ( DataCriation ) was stored like this:    2017-06-01 00: 01: 23,750 But when I try to edit the same record with a...
asked by 06.06.2017 / 00:01
1
answer

Count the number of records of my IF

IF (count (UCID)> 1, count (UCID), '0') , it brings me approximately 500 record lines, being numbers 2 above, I want to be able to do a COUNT in that IF to display those 500's in a separate column. Anyone have a suggestion? Thanks in advance....
asked by 06.06.2017 / 20:23
1
answer

Help with Trigger that adds / subtracts

I need help to create a Trigger in SQL Server that takes a value INTEIRO , and two STRING(FK) , inserted in a tabela X , and check if the second value is 1 or 2 , if for 1 it must add this value INTEIRO...
asked by 01.07.2017 / 05:25
2
answers

Select in Sql Server

Good morning. I have a table with columns Version , Updated , LastChanged . I want to make a query to select the highest value of the version, with its LastChanged , corresponding to Updated = 1; I did, but it d...
asked by 18.05.2017 / 12:14
2
answers

Search Records that are not in another table

Good morning .. I have table [BCT_PESSOA] with PK [ID_PESSOA] this table has relationship with table [BCS_USUARIO] with column [ID_PESSOA] I would like to return all records in the [BCT_PESSOA] table that...
asked by 11.05.2017 / 18:20
1
answer

Sql server 2008 connection

Good evening I installed Microsoft SQl Server Management Studio 2008 on my machine for local testing, but I can not access it. Even though it is free, how can I instantiate access, will I have to reinstall the bank? Following error:     
asked by 08.06.2017 / 01:49
2
answers

Find out which column would be truncated (data would be truncated)

Good evening! When I try to insert a record in SQLServer through my application I am getting a truncated data message. The problem is that there are many columns that this screen fills and I have no idea which one is being truncated. Is there an...
asked by 02.05.2017 / 23:13
2
answers

Condition in procedure

Good afternoon. I have a procedure, in it I have several filters. one of these filters is @ST_TIPO -When I get by BSP Parameter I want to filter only by PT.ST_TIPO = 'BSP' -When I get by Parameter ' DIS ' I want to filte...
asked by 02.06.2017 / 23:50