Questions tagged as 'sql-server-2008'

1
answer

How to optimize this query query with other subqueries?

I have a query query that is taking too long to execute (almost 2min) and needs to be optimized: select Cidade.Id as CidadeId, Cidade.Nome as CidadeNome, Cargo.Descricao as CargoDescricao, '{0}' as Grupo, Count(*) as Qtd from Funcion...
asked by 10.09.2014 / 15:58
2
answers

Insert image into SQL SERVER2008 database using image path

I'm starting in C # and I'm having trouble inserting into a picturebox an image as in the image below: The above screen is a photo record, and the browse image button works, but I do not know how to capture the path of the image to writ...
asked by 13.12.2014 / 19:26
2
answers

Login with Windows Authentication in IIS

I have a SqlServer 2008 base where all users can connect to it via Windows domain, this works correctly via SQL Management Studio. I'm doing a C # Application in MVC, and wanted it when the user accessed the site, I could get that login and p...
asked by 03.05.2016 / 14:17
2
answers

Asp.net WebForms. Timeout error exceeded in SQL Server. How to solve?

In an ASP.NET WebForms application that uses SQL Server 2008 a search field that works with AJAX requests method asmx . To avoid mass requests I added a delay method in the keyup method of input $("#txtPes...
asked by 20.08.2014 / 22:19
2
answers

How to make a user in SQL Server 2008 only view a VIEW?

I made a View to send to a client, but I can not pass the general login and password for it. That way I created a user ( cliente_view ) and I would like it to only view the created View (sales_view_view). How to do this process...
asked by 26.06.2017 / 13:29
1
answer

Field SUM of two Subqueries in MSSQL

I'm needing a field derived from two subqueries that gives the sum of values based on a field. Here's an example: SQL: SELECT CodCliente ,DataVenda ,Vendedor ,Valor ,DataPagamento ,TotalCliente --> SOMA DE [Valor]...
asked by 09.02.2015 / 12:54
3
answers

Calculate the average between 3 dates directly in sqlserver database?

What is the most efficient way to calculate the average of dates in the same column by sqlserver bank? I need to get the date of the last 3 sales of a customer, and return in days to know if that customer buys, for example, every 30 days, 60 in...
asked by 13.08.2015 / 21:33
1
answer

How to know the permissions of a role in SQL Server

I'm doing the administration of some databases that were created before my arrival. In most of them a role called dp_role_analista was created, and some users are in that role. How do I know what permissions this role is granting to...
asked by 24.10.2014 / 17:05
1
answer

Display subquery result and use it for calculation

I need to display a result of a subquery and use the same result to perform a calculation, is it possible to play it to a variable in MS SQL 2008 or something along those lines? example: SELECT @test = (SELECT COUNT(*) FROM [tableTest] WHE...
asked by 05.01.2015 / 17:24
1
answer

SQL 2012 - replace (nolock) with with (nolock)

I need help solving an incompatibility problem. The company I'm working on is migrating from a SQL Server 2008 to 2012 Bank, but we've identified some issues. The main one is the declaration of (NOLOCK) without WITH in VIEWs, FU...
asked by 13.08.2015 / 14:18