Most voted "sql-server-2008" questions
55 questions
Sort by count of
-
6
votes2
answers1179
viewsInsert image into SQL database SERVER2008 using image path
I’m starting in C# and I’m having difficulty inserting in a picturebox an image as in the image below: The screen above is a photo registration, and the search image button works, but I do not know…
-
6
votes1
answer2137
viewsHow to optimize this query query with other sub-consultations?
I have a query query that is taking too long to run (almost 2min) and need to optimize it: select Cidade.Id as CidadeId, Cidade.Nome as CidadeNome, Cargo.Descricao as CargoDescricao, '{0}' as Grupo,…
-
5
votes2
answers8672
viewsAsp.net Webforms. Timeout error exceeded in SQL Server. How to resolve?
In an application ASP.NET Webforms who uses the SQL Server 2008 I am creating a screen that has a search field that works with requests AJAX a method of a Web Service asmx. To avoid bulk requests I…
-
4
votes1
answer3184
viewsHow to know the permissions of a scroll in SQL Server
I am administering some Databases that were created before my arrival. In most of them was created a role called dp_role_analista, and some users are in this role. How do I know what permissions…
-
4
votes3
answers3464
viewsAverage between 3 direct dates in sqlserver bank?
What is the most efficient way to calculate the average of dates in the same column by the sqlserver database? I need to take the date of the last 3 sales of a customer, and return in days to know…
sql-server sql-server-2012 sql-server-2008 sql-server-2014 sql-server-2005asked 9 years, 4 months ago Laísa Ferreira Cardoso 116 -
4
votes1
answer1076
viewsField SUM of two MSSQL Sub-consultations
I need a field derived from two sub-consultations that gives the sum of values based on a field. Follow example: SQL: SELECT CodCliente ,DataVenda ,Vendedor ,Valor ,DataPagamento ,TotalCliente…
-
4
votes1
answer618
viewsSQL 2012 - replace (nolock) with(nolock)
I need help solving a mismatch problem. The company I work with is migrating from an SQL Server 2008 database to 2012, but we have identified some problems. The main one is the declaration of…
-
4
votes2
answers2348
viewsHow to make a user in SQL Server 2008 view only a VIEW?
I made a View to send to a customer, but I can’t pass the login and password to the general access. This way I created a user (cliente_view) and I would like this to view only the created View…
-
4
votes1
answer373
viewsHow to check if there is scheduling in a time range?
I need to create an agenda where I allocate a service provider to work for a client. For example: Prestadordeservicos João will provide services to the customer condominium valley of the sun on the…
-
4
votes2
answers2566
viewsLogin with Windows Authentication on IIS
I have a base Sqlserver 2008 where all users can connect to it via Windows domain, this works properly via SQL Management Studio. I am making a C# Application in MVC, and I wanted that when the user…
-
3
votes1
answer144
viewsDisplay subquery result and use it for calculation
I need to present a result of a subquery and use the same result to perform a calculation, is it possible to play it for a variable in MS SQL 2008 or something like that? example: SELECT @test =…
-
3
votes0
answers161
viewsSearch in sql server 2014 with php
I am using Sql Server Express, I have an instance installed individually on two virtual machines on the server, one of the instances installed is the Sql Server 2008, and the other is Sql Server…
-
3
votes1
answer809
viewsPHP Sqlserver Stored Procedure does not run correctly
Hello, I am developing an application using Laravel Framework Handler from my Backend and found the following error. My Sqlserver Express 2008 R2 database has a stored Procedure that performs a…
-
2
votes1
answer84
viewsHow to get the Foreign Keys creation script from the entire database? SQL Server 2008
I wonder if there is a command that returns the script of creating the Foreign Keys in SQL server, as well as the command sp_helptext returns the script of creating views and stored procedures for…
-
2
votes1
answer380
viewsHow to bring null query Sql server value
I have an sql query where brings the total of a value inserted in a date, but I want to demonstrate in the result the dates that generated zero, even not containing information in the database,…
-
2
votes2
answers531
viewsOrganize columns in rows for equal ID in SQL server
I have a single table with some key records(Foreign key) repeated at most 5 times according to entries, example: id_ok|fornecedor|valor_final|escolha|ativo|…
-
2
votes2
answers8408
viewsHow to concatenate the results of a RELATION into a SELECT?
Having the tables PRODUTO , CATEGORIA whereas a CATEGORY may have several PRODUCTS, would like a select list in a column nvarchar all the PRODUCT NAME of a CATEGORY. Something like: select concat(…
-
2
votes2
answers511
viewsProtect SQL Server Database
I have 2 SQL Server databases in my SQL Server Management Studio. I would like to put password in one of the two, making it impossible to access it, is possible?
-
2
votes1
answer902
viewsWindows user on IIS
I’m trying to log in to a base SQL Server 2008, with the windows user who is accessing my site published on IIS. I’ve already set up Web.Config for windows authentication, set up the application…
-
2
votes1
answer76
viewsExtract free text field dates
I am running a query in a view, but one of its fields is text, in this field the user can inform a date (xx/xx/xxxx) as well as any other information of type text. I wonder how I can return only the…
-
2
votes1
answer82
viewsMerge Names into a line
Good afternoon we use SQL SERVER 2008 as the official database server and we have the following query : SELECT P.NOME AS [PROFESSOR], STIPOCURSO.NOME AS [NÍVEL DE ENSINO], SPL.CODPERLET AS [ANO],…
sql sql-server query sql-server-2008 string-concatenationasked 6 years, 8 months ago Nathann L. J. Lima Alcantara 21 -
1
votes1
answer163
viewsHow to do this SELECT (SQL Server 2008)?
to be quite honest I don’t even know how to start my question. So I’ll first put the information I have. I have the following structure in my database. And I need to make a SELECT that returns to me…
-
1
votes1
answer281
viewsStarting SQL Server 2008 express R2
Guys, I have a problem: I formatted my computer and I can’t start SQL Server 2008 Express R2. When I click on the icon to initialize the following message appears: Microsoft SQL Server Management…
-
1
votes5
answers7513
viewsReduce Log File Size
I’m in a saga with my database, today I have an 11GB mdf file and a 77GB log. I have already searched in several forums, applied some reduction procedures via Management (Shrink) and via command…
-
1
votes1
answer334
viewsHow to merge 8 query returns into one?
I have 8 query’s all have 5 unusual columns and some distinct columns, Based on the common columns I can display a single result of the 8? Common fields: F.CHAPA AS CHAPA, F.NOME AS NOME, F.FILIAL…
-
1
votes1
answer462
viewsSQL SERVER 2008 R2 - TEMPDB ERROR
Good morning, by the way, does anyone know a solution to this mistake : Msg 8921, Level 16, State 1, Line 1 Check terminated. A failure was detected while collecting facts. Possibly tempdb out of…
-
1
votes1
answer55
viewsNumber conversion
How do I convert a number float to keep the characteristics of numbers for the end user read? I am putting together a report and I wish to deal with the figures. I have a field where the value is…
-
1
votes1
answer68
viewsIdentify source of database Locks
good morning! On my server, I own Sqlserver 2008R2 Express. I am having lock problems in the database, however, I am not able to identify which process or which application might be causing these…
-
1
votes1
answer1631
viewsError opening connection to SQL Server 2008 R2 database
I’m having a problem opening a connection to a local database in SQL Server 2008 R2. The opening method that is giving error is as follows: public static SqlConnection AbreConexao() { string path =…
-
1
votes2
answers99
viewsReturn values less than 10 from a column with Datediff
I need to return values less than 10 in a column with DATEDIFF and others between 10 and 20 of the same column. Someone can help me? SELECT CONVERT(VARCHAR(10), (MAX(REMESSA.DT_USO_FIM)),105) AS…
-
1
votes1
answer245
viewsjava error in connection with SQL Server
I’m trying to connect to a sql server database, but I’m not succeeding. Follows connection class and test method: public class ConexaoBanco { public static final String user = "sa"; public static…
-
0
votes1
answer526
viewsHow to set a default value created by the user in the creation of a table (SQL Server)?
I created a default value for my database: CREATE DEFAULT [dbo].[zero] as 0 But I cannot create a table using this default value created. How do I set this value when creating a table? For example:…
-
0
votes0
answers543
viewsQuery Active Directory data in Sql Server
I have services (WCF) that do searches in Active Directory to provide data to various applications that use Microsoft Membership Provider, and also need some of this information in some queries in a…
-
0
votes1
answer68
viewsIncrease sql performance
I have this function below that runs this SQL, but the running time of this SQL is too high would have some way to decrease the running time ? At the time of loading the page takes around 5 seconds…
-
0
votes2
answers45
viewsMultiplications contained in texts
How to make the multiplications contained in a field varchar? (to get the area in case) +------------------------------------------------------+ | DESCRIÇÃO |…
-
0
votes1
answer549
viewsQuery with date and time in sql server
I have a field in the "char" type bank, I am returning the dates this way: select CONVERT(VARCHAR(20),HORA_FECHAMENTO) as HORA_FECHAMENTO, CONVERT(VARCHAR(20), DATEADD(hour, +0, getdate()), 120) as…
-
0
votes0
answers106
viewsError copying database in SQL Server 2008
I am trying to make a copy of a database to the same server but am encountering error below: Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors…
sql-server-2008asked 7 years, 8 months ago Gleison França 560 -
0
votes0
answers321
viewsDivision of duplicates into a Subreport - MSSQL/Crystal Reports
I would like to generate a tax forecasting report for PIS and COFINS, which are calculated based on a CFOP code of banknotes issued in a given period, but I would like to separate this information…
-
0
votes1
answer255
viewsAccess Database on client machine from Web Application
Hello, good afternoon. I’m developing a system that has only one code for several databases. The system already implemented almost all, but when I started to test the connection on the client…
-
0
votes1
answer57
viewsFunction max E Cast Joins Sql Server 2008 R2
I need to convert an Nvarchar field to Float in a survey, and take the highest value. this function works SELECT MAX(valor) from [Enops].[dbo].[Tbl_Pulsomedia15_Vazao_Eta_B_Bentes] Where valor…
-
0
votes3
answers55
viewsDifficulty in formulating query
In a system there are plots registrations . The users can classificar as plots for familyDeParcela each of which user has its own familyDeParcela. As plots are common to all. I have 4 tables: User…
sql-server-2008asked 8 years, 9 months ago John Diego 1,067 -
0
votes1
answer7723
viewsRemove "." /" and "-" from varchar in select
I’m performing a query for a client where it requested that the CNPJ/CPF of companies/customers be displayed without the dots, bars and dashes. For example the CNPJ 08.595.551/0001-57 should be…
-
0
votes1
answer160
viewsVisual Basic 6.0
Hi, I’m new to that language. I am creating a student registration form with SQL server 2008 and connection .ADO. At the time of entering and saving the registration data the sign up button inserted…
-
0
votes1
answer265
viewsHow to disable Identity with Linked Server?
How to disable Identity in Linked Server to not generate increment? Server table must equal local base. SET IDENTITY_INSERT [ServidorLincado].[BD_TESTE].dbo.Produto ON --Desabilita o IDENTITY INSERT…
-
0
votes1
answer32
viewsSelect Same Field
Hello! I need to make an SQL that gives me the result and I wish in the same line. Today SQL is skipping a line. I need you to stay on the same line. select c.empresa, p.nome, (select…
-
0
votes0
answers25
viewsdatabase vendor code:521
I am unable to run these query in sql 2008 I took the test in 2014 and it worked Could someone help me? I’m too layman to bridge to find a solution. Follows the query: SELECT D1_COD, D1_FORNECE,…
-
0
votes1
answer161
viewsMSSQL query on Ubuntu 18.04 LTS has stopped working
I have a program that has been running on Ubuntu-server 17 for some time. This system performs queries on a database server with MSSQL 2008. I performed the installation of Ubuntu 18.04 LTS, and did…
-
0
votes1
answer111
viewsrelate two tables
I would like to know how to relate two tables in different databases so that every time the value in the bank table1.dbo.table id1 will be changed also in the bank.dbo.table id1, modifying according…
-
0
votes2
answers86
viewsSave photo to database and then display it
I have an application to register students where will be inserted the photo, I want to save it and then display it, but I have a save button where I want to save all the inserted information plus…
-
0
votes2
answers69
viewsDoubt with a query (SQL Server)
Good afternoon! I have a set of information in an SQL Server database (I’m still learning SQL Server), and need to filter the information that is returned to me. They are information of employees of…