Questions tagged as 'sql-server'

1
answer

SQL SERVER connection string for classic asp

How do I create a connection string for classic ASP to connect to the Microsoft SQL Server database     
asked by 15.04.2014 / 20:17
1
answer

Query to join specific tables

I need to join 3 different tables. But the result I want is: When the reference exists it should join, when it does not exist it should show blank or NULL. My structure: Contact table +------+------------+ | ID | Nome | +------...
asked by 25.07.2016 / 20:12
2
answers

How to update the surname of a person starting with the initial 'Fabio%'?

It is possible to do this, I have a name of a person who is 'Fábio Mello' and I want to update the name that begins with 'Fábio%' to have the surname '% Borges' how do I make this query? update pessoa set nome = '%Borges' where nome = 'Fabio%'...
asked by 06.03.2016 / 19:15
3
answers

How to join 3 Select in one

I would like to know how I could make a SELECT where I can bring the same but result in a single SELECT . Select example I need to be unique: SELECT COUNT(*) AS QtdTarifados FROM tblLoteTESTE WHERE CodCampanha = 1...
asked by 12.07.2018 / 15:03
2
answers

Selection with various conditions of differences (SQLSERVER)

I wonder if there is any way to improve this selection: SELECT * FROM table WHERE id <> 15 AND id <> 17 AND id <> 23 ... id <> N I do not have a certain interval defined and the ids are selected by the checkbo...
asked by 09.10.2017 / 15:53
2
answers

Php connection to SQL Server

How can I connect to php with sqlserver (pdo)? It sounds simple, but I can not ... Already enabled the driver everything ok Attached is the name of the server, I'll run it on the site ...     
asked by 10.02.2017 / 00:08
3
answers

I have this cursor and the 'between' where it gives error. I would like to select the years from 2005 to 2008

DECLARE @Year int DECLARE db_cursor CURSOR FOR Select distinct Year(OrderDate) as Year From Sales.SalesOrderHeader Order by Year(OrderDate) OPEN db_cursor FETCH NEXT FROM db_cursor INTO @Year WHILE @@FETCH_STATUS = 0 BEGIN --INSERT INTO xxxx...
asked by 11.08.2017 / 18:47
2
answers

Error Backing Up Windows Forms Database

I have problems with this problem! My application is in Windows Forms. I need to back up the data through the application itself, but when I run to perform it it informs me of this error. https://i.stack.imgur.com/e5cq8.jpg "> Note: My backu...
asked by 21.06.2018 / 18:04
2
answers

Doubt integration test

I think it's a somewhat conceptual question on the subject, but come on: I have an example method that validates a user by checking whether it exists in the database, like this: public bool ValidaCampos(string Nome) { string str = "sele...
asked by 30.10.2018 / 20:02
2
answers

Division in sqlserver

I'm using SQL Server 2008, I'd like to split 50/100 for example and return me 0.05. But it returns me 0, it follows what I tried to do:     
asked by 29.10.2018 / 21:24