Questions tagged as 'sql-server'

4
answers

Is it possible to place an "IF" condition on the means to the inner joins and other conditions of a where in SQL Server?

I have a procedure that takes a parameter that can be 0, 1 or 2. When it is 1 or 0, it needs to consider the line where it has "and bol_portfolio = @eh_port", but when it is 2, it can not enter it condition, just bypassing this code. It is possi...
asked by 01.06.2016 / 18:50
2
answers

Group by two fields ordered by a third party

I have the following data: |--------------------------------------------------------| |USER | ID | DEVICEID | DATE | |--------------------------------------------------------| |7 | 14450 | aa6603ceef3b397c | 2...
asked by 03.08.2016 / 15:34
1
answer

how to add a value per parameter to a select statement in sql within a simple table-valued function?

This is my code and wanted to add a value to a select statement that is passed as parameter for a simple table-valued function. Here is my code: CREATE FUNCTION NMELHORESFORNECEDORES(@N INT ) RETURNS TABLE AS RETURN SELECT TOP @N/*da erro ne...
asked by 28.04.2016 / 18:13
1
answer

Fill textview android studio / sql server [closed]

Good malt, I'm not able to populate a textview using a sql server database. Can someone help me? Here's what I have in onCreate: connectionClass = new MainActivity(); text = (TextView) findViewById(R.id.textView4); Connection con = connection...
asked by 20.09.2016 / 22:38
1
answer

Problem saving information from DropDownList to the database

I'm having trouble saving information in the dropdown by btn-save I have a form of registration of real estate being that the information inserted in the dropdown occurs only when I save in another page (that would be) I can not save in the data...
asked by 28.09.2016 / 03:41
5
answers

Reduce log file size

I'm in a saga with my database, today I have an 11GB mdf file and a 77GB log. I already researched several forums, I applied some reduction procedures via Management (shrink) and via command like SHRINKFILE, the database is already as simple. bu...
asked by 17.02.2016 / 13:06
2
answers

Subquery in Lambda

I would like to do a subquery, today in SQL: SELECT intid as IDCliente, (SELECT TOP (1) int_EP FROM tbl_estagioprocesso WHERE...
asked by 17.02.2016 / 14:42
2
answers

Sql server - default

Good evening, I created a table to test the sql server default: I made a select to see if the default values of the default were entered but you can see in the image that this did not happen. When does it enter these default values? I foun...
asked by 15.03.2016 / 06:23
1
answer

Question with formatted time return asp.net mvc

In the application I have a query that compares the current time of the server with a pre-set timetable recorded in a table: select CAST(HORA_FECHAMENTO AS datetime) as HORA_FECHAMENTO, CAST(CONVERT(VARCHAR(11),GETDATE(),8) as datetime) as...
asked by 11.01.2016 / 04:54
1
answer

SQL server 2012, ex correction

checkiftheexerciseanswerbelowiscorrect:Listthenamesofcustomers(Cli_Nome)whoholdBONUSNOTNULLandthattheypurchasedproductswithacode(%w/w)greaterthan5andlessthan10.selectc.cli_nomefromclientec,pedidop,itemi,produtoprwherec.cli_codigo=p.cli_codigoan...
asked by 12.11.2015 / 20:44