Questions tagged as 'sql-server'

1
answer

How to search with a text variable containing apostrophes?

Problem When searching for texts containing apostrophes, no results are found. Execution DECLARE @cidade NVARCHAR(50) SELECT @cidade = cidade FROM tabela_A WHERE id = xv SELECT campo FROM tabela_B WHERE cidade = @cidade The abo...
asked by 21.10.2016 / 22:04
1
answer

ASP NET MVC 5 Dapper with SQL Server?

I'm creating an application with ASP.NET MVC5 , DAPPER , C# E SQL SERVER . The problem is that in the data listing, you are bringing the empty fields, except the ID field, which comes to zero (0). If anyone kno...
asked by 06.11.2016 / 18:50
1
answer

What is the difference between freetexttable and containtable

I am putting together a query that will need to get the term typed in a search and query for similarity in the content. A "rank" that is generated using these commands is being used. The two commands seemed to me very similar, I could not mak...
asked by 10.11.2016 / 17:24
1
answer

How to use CASE WHEN in an IN statement?

In a query I am collecting data on representatives, customers and vendors. Some representatives have salespeople, who in turn have customers. These cases are exceptional because the clients are linked directly to their representatives....
asked by 08.09.2016 / 14:47
1
answer

How to delimit a string field for use in the IN clause

In tabela_A I have a cod_canal field where it is a INT , in tabela_B I have a canais field of type string and it separates the codes by , . Example: 1,3,6,9,12 . On a first try, I just thought abo...
asked by 25.08.2016 / 16:08
1
answer

Make select with dynamic column

I have a query with N relationships, in one of those related tables I need to select a specific column that follows the mes_valor pattern, where mes is an abbreviation for one of the twelve possible jan_valor , fev_...
asked by 10.08.2016 / 22:11
1
answer

Hashbytes with different values when doing select and save with update

SELECT HASHBYTES('MD5','123') This select above returns me the following result: 0x202CB962AC59075B964B07152D234B70 But when I do an update to the table using the same hashbytes UPDATE USUARIOSLOGADOS SET TOKENSESSAO = HASHBYTES('...
asked by 17.08.2016 / 22:38
2
answers

How to do for loop in SQL SERVER?

BEGIN <<LOOP_EXTERNO>> FOR V_EXTERNO IN 1..20 LOOP DBMS_OUTPUT.PUT_LINE('Contador externo: ' || V_EXTERNO); <<LOOP_INTERNO>> FOR V_INTERNO IN 1..5 LOOP DBMS_OUTPUT.PUT_LINE('Contador interno: ' || V_INTERNO);...
asked by 26.10.2016 / 15:00
1
answer

BKP SqlServer is not executed when executed by a trigger (trigger)

I have a procedure that runs a bkp from my database. If I run it through SqlServer the bkp is performed normally But when I call a trigger, another procedure or application bkp is not performed, the folder is created on the server, but the bkp f...
asked by 15.07.2016 / 00:08
1
answer

Update table with data from another table by decreasing character

Hello, I have the BDMCOM1 bank that has a Product Balance table and a Quantity column with values like this: 1,000. However I have another bank BDMCOM1_V3_ALEA that also has the Product Balance table and Quantity column, but with values in this...
asked by 11.07.2016 / 16:08