Most voted "sql-server" questions
SQL Server is a relational database management system from Microsoft. Use this tag for all SQL Server editions, including Compact, Express, Azure, Fasttrack and PDW.
Learn more…2,752 questions
Sort by count of
-
1
votes1
answer203
viewsHow to publish . mdf database in Azure SQL Dabases?
I have a solution with a project Asp.Net MVC 5 and I’m using Code First and Migrations to update the database .mdf automatically generated in the App_data folder. How do I put this .mdf in the Azure…
-
1
votes3
answers1619
viewsHow to return the last id inserted in the table?
I need to get the generated id, in the last and recent insertion done in a table in SQLSRV, Mssql, using PHP. I’m already connecting to the bank, using the sqlsrv driver. $sql = "INSERT INTO…
-
1
votes2
answers1731
viewsI can’t restore my backup
I backed it up once and it all worked out. Now more tables, views w wtc have been created and I need to update the database. As the bank is at a network address and for security, we have no way to…
-
1
votes3
answers36844
viewsreturn of decimal places in sqlserver queries
In the query below I would like to return only 3 houses after the comma for the columns: size in Mb, availablespaceinmb Already for column available, I would like to return without any decimal place…
sql-serverasked 10 years ago Jean Braz 187 -
1
votes2
answers268
viewsLarge images corrupted or truncated when pulling from SQL server with PHP
I am searching images from the SQL-server database through PHP and jQuery+AJAX. The image when it is small loads everything full, but when the image is a bit large from this error in Javascript:…
-
1
votes0
answers634
viewsPublishing Asp.net application on IIS 8
I am trying to publish my application on a Windows server 2012 with IIS 8. I have taken the step by step to go to "Site -> Add Website" and fill in the coordinates, paths and etc. I have deployed…
-
1
votes1
answer7134
viewsError: Multi-part identifier could not be associated
I’m trying to execute the following command: SELECT * FROM pendencia, cliente LEFT JOIN servico ON pendencia.id_pendencia = servico.id_pendencia LEFT JOIN cidade ON cliente.id_cidade =…
-
1
votes0
answers96
viewsError in Sqltask Run Output
I am developing a project where in one of my execute sql task has a query, select stuff((select ',' + campo from tabela FOR XML PATH(''))1,1,'') as resultado this query returns so | resultado |…
-
1
votes1
answer1524
viewsHow to install SQL Server together with the C# application created?
I have a C# project and I need that when I create your installer I also install SQL Server 2008 on the client’s machine. It would be possible to do this?
-
1
votes2
answers1063
viewsLeft John returning more records
I have a main table with about 5,000 records, and I need to search for information in another table with 7,000 records. But my query is returning +6,000: SELECT principal.id, info.nome,…
-
1
votes1
answer177
viewsDISTINCT WITH UNION AND COUNT
I’m performing a query in the database to return 6 results from a table Agenda which has several schedules available per day (ex: 08:10:00:000 | 08:30:00:000) and for periods (ex: T (representing…
-
1
votes1
answer1467
viewsApplication with Crystal Reports does not find database in client
I made a small application that uses Crystal Reports to generate reports. I did the . EXE of it with Instalshield LE, installed it on my PC and spun beauty. However, when installed on another…
-
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
answer283
viewsSELECT in an XML Field
I’m having trouble retrieving the value of an xml node from a field and need help... The structure of the table is: --Table Pessoa Id int Nome varchar(max) DtNascimento date Xml_Detalhes XML my xml…
-
1
votes1
answer223
viewsFailed Android Sqlserver connection
Error while trying to connect Android/Java with Sqlserver Follow the error: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error:…
-
1
votes2
answers908
viewsPass connection string to dataset via code
How to pass the string connecting to the dataset via code? because the application I am developing cannot contain the app.config.
-
1
votes0
answers48
viewsDoes the mirror break influence the server audit?
Does the mirror break influence the server audit? I ask this because, in the databases where I need to redo the mirroring for some reason, I also have to specify the audit again…
-
1
votes1
answer142
viewshelp with SQL Nvarchar
Hello, I had some problems with a code on SELECT... example: SELECT dados FROM banco WHERE CPF='$CPF' // com o código assim estava dando alguns erros pois o bd era em SQL e o Servidor windows. The…
-
1
votes2
answers691
viewsWhat is the best way to query SQL Server database using a list as input?
I have a question as to how best to address the following problem: I need to query records in an SQL Server table using a list of serial numbers. I know the IN command, but it does not meet, because…
-
1
votes2
answers851
viewsUnite results of various procedures in a single table
I have the following process where I pass the name of a column and it counts the records of that column. exec psGraficoestatistica 'Email' It returns a column with the name EMAIL and a single line…
sql-serverasked 9 years, 8 months ago Kaizonaro 671 -
1
votes1
answer1108
viewsbackup of the sql database structure
Good morning, I have several servers that I use in my development environment, but I would like to know if colleagues know any tool or procedure in the sql itself that I can only backup the Database…
sql-serverasked 9 years, 8 months ago Jean Braz 187 -
1
votes1
answer294
viewsInserting data into sql server table
I’m trying to insert data into a table: INSERT INTO [RDO].[dbo].[observacaoProtocolos] (id_protocolo, statusObs1, observacao1, statusObs2, observacao2, statusObs3, observacao3, statusObs4,…
sql-serverasked 9 years, 9 months ago GustavoSevero 2,567 -
1
votes1
answer52
viewsSQL base import to Azure
I have a database in SQL Server 2008 R2 with a size of 65GB, and I own it in . BAK as well. There is a possibility to import this database into my Azure account?
-
1
votes1
answer203
viewssp_executeSQL for each record of a table
I have the following problem: I need to analyze the differences between two databases, based on the existing tables and columns within these tables. My idea is to take the name of the columns inside…
-
1
votes1
answer437
viewsLogical deletion of SQL Server records
We have the culture of making only logical exclusions in the application, keeping 2 fields where 1 is the date of exclusion and another char that gets’S' or 'N'. When we perform searches for deleted…
-
1
votes1
answer314
viewsDLL Error Report Crystal Reports
I’m trying to generate a report on 'Crystal' in my company’s system programmed on VB6. However, the following error appears in the annex. I searched on this DLL, but the answers I got didn’t solve…
-
1
votes1
answer108
viewsSort result with 4 different columns
I have a table with 4 different columns, 2 of them indicating the beginning (date and time) and 2 other indicating end (also date and time). Is there a way to sort the result so that it prioritizes…
-
1
votes1
answer238
viewsRelationship Tables
I have a table Endereco which serves as much to Funcionario how much for Supplier: 1 Funcionario possui 1 Endereco 1 Fornecedor possui 1 Endereco How I create this relationship without having…
-
1
votes1
answer304
viewsTable for storing expenses and revenues. Cyclical information
I’m creating a C# system for storing individual expenses and revenues. I have doubts about the storage of this type of information, which has frequencies and repetitions. For example: I have a…
-
1
votes2
answers437
viewsSorting in recursive query
In another question I asked i had found a solution but ordering only works if the ID’s are growing: USE TESTE GO WITH Niveis AS ( -- Membro âncora SELECT Id, IdPai, convert(varchar(1000), Nome) as…
-
1
votes1
answer166
viewsDatabase replication in WPF + EF system
I have a sales system in WPF / EF that is in use in different cities, but the database is at headquarters. I am having problems when the city link is very slow, resulting consequently in the slow…
-
1
votes1
answer630
viewsInner Join, multiple Inserts with multiple conditions
Well, the thing is, I don’t understand where I should start, if I should select customers first, anyway, I’m sure I’ll use inner join or some joiner because it uses other help tables. I wanted help…
-
1
votes0
answers155
viewsRun an execution block (SQL Server) on Doctrine + ZF2
I need to run an SQL (SQL SERVER) execution block on a Repository in Doctrine. My environment is with ZF2 + Doctrine 2. I’ve read some things about ResultSetMappingin Doctrine, but I couldn’t. Code:…
-
1
votes1
answer307
viewsHow to fill a code column for reference with repeated values
I have a query where I have returned several data of each user. However, when performing a search, I have as return the repeated data. I know that this repetition of the data happens because I do…
-
1
votes1
answer376
viewsProcedure If exists update Else Insert in table with composite SQL Server key
Hello. I want to synchronize a table with Linked Server, but the problem is that the table has a composite primary key, and I don’t know how to check to find the record. Can someone please help me?!…
sql-serverasked 9 years, 6 months ago mmooser 117 -
1
votes0
answers26
viewsSplit accesses between the new site and the old one
I’m going to publish a new site and I wanted only a few hits to it so I can evaluate its operation and the other hits will be forwarded to the current site. Facebook does something similar when it…
-
1
votes1
answer1315
viewsHow to run a script before a view on sql server?
I created a view and it looks for information from an X table. Only this table X, must be created in a select, before executing the view, for the data to be updated. It has to create something in…
-
1
votes0
answers89
viewsThe Operation could not be performed because OLE DB Provider "MSDASQL" for Linked server "XYZ" was Unable to Begin a Distributed transaction
I’m trying to accomplish a update in a database on another server through a LINKED SERVER configured on my local server. Already tested and is working perfectly when using darlings in the SGBD. In…
-
1
votes1
answer271
viewsRemove fixed-sized part of an xml
People, I have this piece of an XML and I need to remove the value (357122.40) that is between the tags < vMerc>xxxxxx< /vMerc>. Only this value has no fixed size.…
-
1
votes2
answers599
viewsSQL to bd connection on the network
I developed a C# application that uses SQL Express that initially the bd and the application were installed on a single machine. The client now needs the comic to be available from another computer…
-
1
votes1
answer32
viewsUtlizar SMO in SSMS
It is possible to use SMO substitute for the SQLDMO within the SSMS (SQL Server 2008 R2 version)? Use functions such as listing instances within the network similar to ListAvailableSQlServers()…
sql-serverasked 9 years, 5 months ago Marcelo 11 -
1
votes1
answer598
viewsHow to select a String in column format? SQL SERVER
I have a field STATUS in a table with the following data: VENDA,COMPRA,DEV.VENDA I need to make a query in this field that the result is a column, where each row will be one of the strings between…
-
1
votes1
answer282
viewsGet query result by converting Date Time field to local Time zone
I have a table in the sql server database that has the following Datahora field where I have data included in this following format: DataHora 2015-04-20 17:43:04.000 this time is not in the format…
-
1
votes2
answers100
viewsDynamic TSQL for multiple returns
I need to make multiple inserts that will depend on an existing result in a table like this: --CRIA TABELA #CONTATO CREATE TABLE #CONTATO( NOME VARCHAR(100) NULL, TELEFONE VARCHAR(50) NULL );…
-
1
votes1
answer15538
viewsHow to run a trial in a select?
What I tried was the following, and my Procedure returns only a select: SELECT * FROM t_usuarios WHERE nome like '%jeniffer%' AND cd_usuario IN (exec usp_lista_emprestimo_em_atraso) ORDER BY nome…
-
1
votes1
answer541
viewsCustomizing Individual User Accounts
Well, I have an Asp.Net MVC web project that uses Individual User Accounts and I would like to use a specific table in my database and a different class to manage user login. How can I do this?…
asp.net-mvc sql-server entity-framework asp.net-identityasked 9 years, 4 months ago Jedaias Rodrigues 6,718 -
1
votes0
answers47
viewsHow to connect to a 64-bit centos 6-bit sql server base
I’ve done the following procedures: rpm -ivh http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm wget http://rpms.famillecollet.com/enterprise/remi.repo…
-
1
votes2
answers167
viewsCombobox come blank VB.NET with INNER JOIN
I’m having a little problem here and I haven’t found the solution yet, I’m loading data into a combobox using a DATASET from a INNER JOIN done in a database SQL SERVER. Until then it’s okay only…
-
1
votes2
answers2579
viewsGet last record of each id in sql query on condition
I’m having trouble getting the last record of each id in an SQL Server table. select c.Serial,v.Descricao,v.Placa,v.Cor,v.AnoFabricacao,v.Chassi c.DataHora,c.Endereco from [CheckPoint] c inner join…
-
1
votes0
answers114
viewsMysql access via MSSQL client
First of all I would like to inform you that my knowledge in SQL is of beginner... I have a proprietary MSSQL client application and would like to know if there is any way to get it to access the…