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
-
0
votes1
answer78
viewsSave fk right after pk is generated with Entity
I have a system and this system has some tables that are associative. As soon as I write the main table in the comic book, I need to make sure that that new generated PK is recorded in three other…
-
0
votes1
answer318
viewsSQL history query
I am in need of a help with SQL. I need to do a query that returns a history of the current date up to 7 days behind. Could someone please help me?
-
0
votes1
answer838
viewsHow to list sql server databases in a combobox
How to list SQL Server databases in a C application combobox#
-
0
votes1
answer404
viewsWorking with Entity Framework, Multithreading and SQL Server in C#
I’m using the Entity Framework and Multithreading on a project C# and I am going through problems of connection with the SQL Server. Well, I wanted to improve the speed of some data searches for a…
-
0
votes1
answer254
viewssum values and boxes after the comma
Good morning guys, I’m having a little problem here and I’d like a little help from you, I have a select here that brings the workload of one student per subject, for each student it repeats the 2x…
-
0
votes1
answer933
viewsInserting datetime into SQLSRV using PHP
I am working with PHP and SQLSRV. I need to enter a date in a field of the type Datetime and I can not at all. At least not in the ways I have found in Internet searches. The last one I tried was…
-
0
votes2
answers993
viewsPHP how to pick up image, in hexa format straight from MSSQL?
I’m making a system with PHP and I have already managed to place an image or word file, directly, inside the MSSQL, SQLSRV, without having to put them in a folder, but I can’t find them and display…
-
0
votes2
answers2459
viewsReportview without a dataset
I am finishing my TCC and I have a question regarding the Reports with the ReportView from Visual Studio 2013. I will explain basically how my application works. The connection to the database is…
-
0
votes1
answer187
viewsFOR in php and sqlsrv
I have to do a FOR in PHP, using SQLSRV. I’m using the penultimate version of PHP and not the last, because I can’t update PHP.
-
0
votes1
answer315
viewsHow to calculate database usage in Microsoft Azure?
I’m developing a platform where it has two parts, one administrative and the other open to the public. The administrative part will insert users and some other things. Already the user will access…
-
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
votes1
answer561
viewsError in SQL Server and JSP connection
I am trying to connect to SQL Server using JSP. However the connection is not performed. Connection Class: package DAO; import java.sql.*; public class Conexao { public static Connection conectar()…
-
0
votes0
answers181
viewsDoubt about use of virtual directory in IIS and filetable
I need to store files in one FileTable. As I do not know the local path where the files that are in FileTable stay, I peed the network path of the directory of FileTable, and thus access the…
-
0
votes0
answers55
viewsData update on sqlsrv
Since yesterday I have been having a very strange problem at the time and update data in my BD. I always managed to update data, but I haven’t been able to with this command:…
-
0
votes1
answer1278
viewsHow to put an SQL command in a variable
I have a following SQL command and I need to put it inside a variable in SQL. The code is this. WITH DB_CPU_Stats AS (SELECT SUM(total_worker_time) AS [CPU_Time_Ms] FROM sys.dm_exec_query_stats…
-
0
votes1
answer1666
viewsI cannot create table in SQL SERVER
I have an instance of SQL SERVER installed locally where I am administrator, I can create Databases but I can’t create tables. Here is a photo of the error that SQL displays. More Some Details:…
-
0
votes2
answers2142
viewsBring certain field, by MAX(ID)
How do I bring in any field, by the largest table ID. I did a MAX(Campo1), Campo2 and had to make a grouping by Campo2 and the result he brought me several Campo2 and not only one, which has the…
sql-serverasked 9 years, 8 months ago pnet 14,727 -
0
votes1
answer418
viewsHow to get bank reports through web application?
Where I work there are some procedures in the database (SQL Server 2008) that take hours to run and return large amounts of information that are always copied to a spreadsheet and sent to the end…
-
0
votes1
answer171
viewsError converting Bigint to integer using lambda
In the database the guy is BigInt and in C# I’m trying to convert to int and he can convert, but when it comes to instruction lambda, makes a mistake. long codpro =…
-
0
votes1
answer3084
viewsError trying to insert SQL SERVER
I created a table in the BD with the following code CREATE TABLE documentosDefesa ( id_documentos_defesa int NOT NULL, id_reclamatoria int NOT NULL, funcao nvarchar(50) NULL ); And now when I try to…
sql-serverasked 9 years, 8 months ago GustavoSevero 2,567 -
0
votes1
answer7900
viewsQuery using between with sql server 2005
I’m making a query using the operator Between to select a date range, in the SQL Server 2005 database. Below are the table data Servico: linha1: 2015-02-04 14:51:01.577 linha2: 2015-02-04…
-
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
answer2862
viewsHow do you check if a view exists before you have it created?
Take as an example the following view: CREATE VIEW vw_types AS SELECT codigo AS code, nome AS description, abreviacao AS abbreviation, statusRegistro AS status FROM tipos How can I have it created…
-
0
votes1
answer1761
viewsError: There are no Primary or candidate Keys in the referenced table
I am trying to create a new table in an existing DB, however, appears the following message: There are no Primary or candidate Keys in the referenced table 'parceria_conta_corrente_ao' that match…
-
0
votes0
answers135
viewsCakephp SQL SERVER
I’m in big trouble here. I have a cakephp application hosted on the Windows server. The following problem is happening: The save method of NO model is working. In debug I search for validation error…
-
0
votes2
answers2226
viewsWhat better way to insert an array into the database
I would like to know how to best insert an array into a database table. I could use a foreach but I would like something performative because I will work with large number of data. foreach (var item…
-
0
votes3
answers1148
viewsTake a variable value from Sql Server
I have this Sql block: SET NOCOUNT ON; Declare @QueryString as NVarchar(4000), @Datazero as varchar(20), @Datamn as varchar(20), @CdUsuario as integer, @SitProcesso as int ,@DsUsuarioRede…
-
0
votes2
answers1574
viewsHow to get date and time in different columns through a select Sql server?
I have a problem need to filter a query under the following conditions : I have the Data field and I have the time field both in varchar , when I try to make the query like this: ex: select Serial,…
-
0
votes2
answers7710
viewsUnable to locate Data Provider . Requested Net Framework. Sql Server + Entity
I’m having trouble connecting with my local bank. This is my View, where I try to connect the bank using Razor: @{ ViewBag.Title = "Index"; Layout = "~/Views/Shared/_LayoutOuvinte.cshtml"; var db =…
-
0
votes1
answer2617
viewsHow to use the current date in a trial?
Good night, you guys. I need some help. For you to understand, I am trying to execute a system process that asks me some variables that I can pass them in a fixed way, but one is date. in case the…
-
0
votes0
answers73
viewsReturn columns according to sql server criteria?
How could I return the column names of a table according to search criteria? I want to return the columns that are with option’S', all fields is a char of 1 that takes "s" or "n" select b.livros,…
-
0
votes1
answer271
viewsQuery sorting - sql server
I need to sort my query so that the column "Centername" is in accordance with the logic applied in the column "All levels" someone could help me please? WITH CentroNiveis AS ( SELECT cen.Id,…
-
0
votes1
answer773
viewsShow only positive delay days in SQL query?
I am making a query where I intend to calculate the amount of days of delay in a salary, I would like to show only if there are days of delay, at the moment I am showing days remaining for the…
-
0
votes1
answer297
viewsHow to convert Datetime type to nvarchar?
I have a table with a column like nvarchar, and I pass the following parameter to the stored Procedure: cmd.Parameters.Add("@PointDate", SqlDbType.NVarChar).Value = DateTime.Now; as predicted, I’m…
-
0
votes1
answer5001
viewsRemote procedure call failed. [0x800706be]
After installing SQL Server 2008 R2, access SQL Server Management Studio but server name does not appear and SQL Server Configuration Manager services are not active.…
-
0
votes1
answer77
viewsDoubt about 'NUMA' (non Uniform memory access) in Microsoft SQL Server
Someone can help me understand in English the concept of 'NUMA' and its characteristics? I have found sites in English etc, but I still do not understand!
-
0
votes1
answer269
viewsOptimize printing of great SQL-Server results through ASP
Today I have a classic ASP page with an unconventional chain-select (read "armengado") that returns a select populated with some data from an sql-server database (2005). I select the building and…
-
0
votes2
answers343
viewsHow is crud to update the records in SQL Server by Visual Studio C#?
I am using this code, it does not error but does not update the data public static int attLoja(LojaVirtual loja) { int resposta = 0; using (OdbcConnection conexao = ConexaoPadrao.CreateConnection())…
c# sql-server visual-studio sql-update crudasked 9 years, 5 months ago Nataniel Soares Rodrigues 155 -
0
votes3
answers61
viewsBD Results Count for pagination
I’m having a problem, I want to know how much data there is in the database, but with this code is returning -1 I have already used this code for other jobs (only with mysql), in this case it is…
-
0
votes1
answer102
viewsProblems with passing values Asp.net C#
I’m having a problem when I’m going to assign the return of query for a variable of the type object she passes as null. I have other identical methods, and they work well, just the one that’s not…
-
0
votes1
answer1561
viewsSelect except values (SQL / Oracle)
I need to improve this select that already exists here to perform a query where the ICCID initiated by 8995 are not returned, but I do not have much knowledge of database. How can I change this…
-
0
votes1
answer171
viewsWhat’s the best way to do these triggers?
I wonder if there is a better way to write these Rigger. thank you --gatilho para gravar os dados do usuário CREATE TRIGGER TGR_TB_USUARIO_INSERT ON TB_USUARIO FOR INSERT AS BEGIN DECLARE @IDUSUARIO…
-
0
votes2
answers400
viewsCreation of Trigger Sql Server
I’m creating a Rigger to create a copy of the changed data in the table. But it presents an error. USE [BANCO1] GO /****** Object: Trigger [dbo].[BANCO1] Script Date: 08/07/2015 14:13:34 ******/ SET…
-
0
votes2
answers384
viewsHow to mount a select that brings information of which column is PK, which is not, and which is FK
I need a TSQL bring me some table information data as which column is IS_NULLABLE, COLUMN_NAME, and so on, but I came across a problem, I can’t bring a column in a CASE WHEN which says that such…
-
0
votes1
answer3098
viewsHow to check the constraints in the bank
Hello, how do I check if my constraints are linked in the entire database? I need a query for Oracle and SQL Server.
-
0
votes1
answer126
viewsBackup SQL SERVER database
I have a database stored on the client’s server. I only have access to the Connection string of this database, so I can manage it, as I can back up the bd on Server for My Local Machine, for…
-
0
votes1
answer76
viewsJourney Boundary - SQL Server 2008
Good afternoon, would like to make an SQL to control the limit of the last beat of the point of the employees with the first of the other day, filtering the amount of times the calculation gave less…
sql-serverasked 9 years, 4 months ago Rafael 85 -
0
votes1
answer653
viewsadd a foreing key to an existing table
I have to create a column in an existing table and at the same time create a foreing key with another table using this column that was created, and this foreing key by default has to be null. The…
-
0
votes1
answer133
viewsReplace problem on sqlserver
I have a field in the page that receives only number, but when I compare in the function this value of the page with what is in the bank, does not return to search. I’m trying to use the Replace to…
sql-serverasked 9 years, 2 months ago krispim 453 -
0
votes0
answers607
viewsSql Server 2008 - Error: Undefined object reference for an object instance?
I was using sql server 2005, after doing the update, all databases does not allow the display of tables in Design mode, and does not let create new tables. I tried to make the creation of a table in…