Questions tagged as 'sql-server'

1
answer

Make an IF to define WHERE

I need a help with a command in a SQL proc. I basically need something like this: ... ... WHERE IF ( @Id_ProductClass IS NULL ) WHERE CLIENTPROD.Id_ProductClass NOT IN (59, 150) ELSE WHERE CLIENTPROD.Id_ProductClass = @Id_Product...
asked by 20.02.2015 / 17:49
1
answer

EF context changed, but without updating database structure

I'm using the free hosting service in a free plan. Until then, everything worked fine. But after I've made some changes to my database, their database just does not work, it gets error:    The model backing the 'ContextEntities' context...
asked by 04.02.2015 / 01:39
1
answer

How to change the name of the target database when performing the restore? (Class Restore C # .NET)

I am backing up and restoring a SQL Server database using the C # .NET Backup and Restore classes, with Smo. The problem is that after performing the backup of the database with the name, for example "Test", I can not restore the database with a...
asked by 20.01.2015 / 12:45
1
answer

Update in multiple lines SQL server 2008 + PHP

How can I do multi-line updates with PHP on the sql server? I have a structure similar to this, but with many lines: ID nome vencimento 11 | Joao | 20/02/2014 12 | Arthur | 21/02/2014 13 | Ana | 22/02/2014 14 |...
asked by 21.08.2014 / 13:55
2
answers

Query about query performance with date range

Assuming that I have a database table with 10000 data and each record is registered with dates between 2013 and 2014. A query like this: SELECT CAMPO_DATA FROM TABELA WHERE CAMPO_DATA BETWEEN '2013-01-01' AND '2014-12-31' will be faster...
asked by 28.07.2014 / 23:00
1
answer

How to block editing of a record when it is being edited by another user C #

On a networked system (several using the same database), how do I know if a user is already editing the registry. For if in the case two computers edit the same record at the same time, a problem occurs because only the changes of the last user...
asked by 10.02.2015 / 23:07
1
answer

Error exporting SQL Server database to another server

I have a database on a SQL Server Web Edition (64-bit) (11.0.5556.0) server and need to export it to a server with SQL Server Express Edition with Advanced Services (64-bit) (10.50.4297.0). When exporting the data using the SQL Server Export...
asked by 13.02.2015 / 15:31
1
answer

How to select a port to connect to SQL Server Remote

I'm having the following problem, my SQL server is with port 1433 open and communicating properly, but my client has a firewall that blocks all the incoming and outgoing ports of the computers connected on the network. Here comes the problem, I...
asked by 30.05.2014 / 00:16
2
answers

Error trying to connect to the database

I'm studying about C # and Asp.net and "trying" to draft a registration, change, and deletion project, following some videos I found on the net. The problem is when I connect the database created previously the application does not find it and t...
asked by 05.05.2014 / 14:36
2
answers

Orphan records, checking in another table

I have a photo table: tbl_fotos int_ID (Pk, int) int_IDProduto (int) str_foto (varchar(40)) and a table for products tbl_produtos int_ID (PK, int) I want to know how many photos there are without products. (orphane...
asked by 15.07.2014 / 20:42