Questions tagged [sql-server]
Microsoft SQL Server is a relational database management system (RDBMS). Use this tag for all SQL Server editions including Compact, Express, Azure, Fast-track, APS (formerly PDW) and Azure SQL DW. Do not use this tag for other types of DBMS (MySQL, PostgreSQL, Oracle etc.). Do not use this tag for issues on software and mobile development, unless it is directly related to the database.
I have a friends table as below
| Name | Friend |
| A | B |
| B | C |
| D | B |
| D | C |
| A | E |
| E | Z |
We have a table with Full Text Search index enabled. And Change tracking is set to 'Automatic'
The problem we have is that we generate content for this table faster than indexing is happening for ...
Hi i want to backup one database of my database server using a bat and a sql file.
REM Run TSQL Script to backup databases
sqlcmd -S HEIST-BERG-SL\SQLEXPRESS -E -Q "C:\SALTO\Automatic Backups\scripts\...
How we can show category and sub category in one column in sql. Both columns are present in same table.
category sub category Values
Bird parrot 5
i have these data in an MSSQL 2012r2 table:
id data1 amount
10 abc 95.00
10 NULL 312.00
20 def 16.00
30 gqi 32.00
Expected query result:
id data1 ...
I am using Sql server 2017 and I want to use full-text-search on my own file type. I created several files with my own extension. Then I created the appropriate tables and threw these files into it. I ...
I'm just creating a store procedure to simply concat several records into one string in Microsoft SQL Server.
here the sample table look's like:
I am trying to create a pivot table. The source one is following:
| UserId | LastName | FirstName | Param1 | Param2 | Date |
I am using Visual Studio 2008 for a legacy project.
The project is not getting connected to the instance of a database on my local PC.
I'm trying to build a winform with a Delete button and DataGridView. What I want is to click a row in DatagridView and then click Delete button. The selected row will be removed from DataGridView and ...
Say I have the following tables:
CREATE TABLE [Weeks]
[Id] INT NOT NULL IDENTITY,
CONSTRAINT [PK_Weeks] PRIMARY KEY ([Id])
CREATE TABLE [Days]
[Id] INT NOT NULL IDENTITY,
If running speed of a day is > 0, its status is true.
In case of no data for a particular day, infer last status code (another
column in table) value recorded and if the value is zero then mark run ...
Since a DB migration, I have many intermittent exception from SQL timeout. All what I now after my 2 months of investigation:
All my .NET C# apps using RF 6 are impacted
Whatever time in ...
I need calculate power usage, and it is calculated as the average power per hour multiplied by the number of hours worked per day. Can i multiply value on hours datediff between two datetime, start ...
I have a table with a unique index on Contracts of Customers that live in Houses. I want to know the days per house how long it takes when someone moves out (Contract end date) and a new contracts ...
Following are my data
Room 1 ...
I'm currently building a System using Java lang. Unfortunately, (new at java) i got stuck on inserting the value of jComboBox on the database which has an integer data type.
Have tried using this ...
I have a piece of code that inserts a data sample ([id + datetime2] +...) in sqlAzure database.
Later for each call I do a select to know if the primaryKey is already in DB [id + datetime2] so I ...
I am working in building a query that is going to split a string into words and check each word if it exists in the DB, if it exists I need to update the counter of the word and if it doesn't I need ...
I'm trying to use SqlBulkCopy to insert a number of rows into a table where the Id column is set with a sequence. The sequence and table look something like:
CREATE SEQUENCE [dbo].[MyTableId]
I have a log table where data is stored. There are three different statuses (Start, Success, Failed).
The data comes from an ETL process. When an SSIS package starts running it logs a start. When the ...
I have already created job and i need to execute job in about 15 time within 10 times nearly. created job spend 4 min finish that steps. how to do this?
I need to select rows with EventTypeID = 19 which does not have related EventtypeID = 21 LoggedOn exactly 4 minutes earlier for the same EmployeeID. Here's the query bellow and some raw output:
The cross-Location Look up database cannot be opened.
The error message is
[Microsoft][ODBC SQL Server Driver] [DBMSLPCN]SSL Security error
I use EF6 model-first approach to design MS SQL database by using "Generate database from model..." in Visual Studio.
This generates a sql-file with all drop and create statements.
At some productive ...
[Last_Check_In_Time] [datetimeoffset](7) NULL,
[Last_MSG_Sent_Time] [datetimeoffset](7) NULL,
[Last_MSG_Received_Time] [datetimeoffset](7) NULL,
I have to two tables employee and department.
Id, Name, JoiningDate, SpecialRegistrationDone, DepartmentId
There is a special department with DepartmentId ...
I want the title for the SQL query.How Can I generate it? In the following code ContractID is int, Contract Number is nvarchar and ClientContractNumber is nvarchar.
I have tried the following Code
I need to create a report of all our items with a URL link to the webpage that is generated for each item. The website uses the .ToUrlString extension (http://www.extensionmethod.net/1935/csharp/...
I need to import some datafrom a Excel worksheet but the OleDbConnection is using the 32bit version, so it cant find the provider. I already imported using the 64bit wizzard and everything is working ...
I am trying to retrieve the most sold items from a date picker "from-to" format. I have this SqlCommand I am trying to run but its not working.
SqlCommand cmd = new SqlCommand("SELECT TOP 3 Sold ...
I'm trying to set up a connection to SSMS from SSIS project I'm working on with SQL Server Authentication.
I set up a cube_user login and gave it permission to my database transactions
Here is how I ...
I want to store the content inside the <p> tag into database. Is it possible?
<button type="submit" class="btn btn-success" id="btnCheckin" onclick="getLocation()"&...
I want to import json file to sql server 2017 but some field is Thai language can't show Thai language How to do...
DECLARE @farmer VARCHAR(MAX)
SELECT @farmer = BulkColumn FROM OPENROWSET(BULK'G:\...
I am getting this weird exception in WCF Service Exception thrown: 'System.Runtime.Serialization.SerializationException' in System.Runtime.Serialization.dll
Here is the given schema of the DB:
As DR and good practice, we [Backup] everything
We backup our SQL logins, jobs, linked server, system settings into a separate database so that we can restore it in DR scenario
The job was exported ...
I recently took over as an application administrator for an in-house developed app, an app which came with no documentation and no support.
I found out my predecessor gave the exact same initial ...
I have configured CMS configured that list all my servers. I want to be able to run a script at the server to look at temp tables that exist on all the databases hosted on a server. I want to drop all ...
New to Entity Framework but I'm trying to bring my employer into the 20th century. Here is the problem. We have a third party product that we use for the majority of our organization's activities. ...
I was handed a table where the Date column was loaded as nvarchar(50).
I more or less figured out converting it into datetime.
select convert(datetime, Date_Time_In, 101)
I have a column called price. I have two rows in that column. How do is subtract row2-row1
Table = table1
It has columns name, price
Price column has values as
I need to get the Name field's value from all of the Output\OutputFields\OutputField in the SPEC column.
create table T
ID uniqueidentifier default newid(),
insert into T (...
I have one table myTable with columns name, Id and code.
Sample data in myTable is as below.
| name | Id | code |
| XYZ | A12 | F1 |
I'm using Microsoft Dynamics CRM 2016 On Premise, I'm trying to get some specific meta data, basically get through SQL Server the field physical, field display name and the field value from a given ...
There is a game server with a SQL database. There are many tables with entities (resources, builds, unist, ets). Each has its own ID in the table. The task was to develop an API in the form of a ...
How do I find out what databases are listed under an instance that I'm not connected to?
(this is homework...sort of)
I found out how to locate other instances through Admin Tools, then Services. ...
I seen some answers that seemed close to my solution but they used code and I'd prefer to do this in SQL if I can. I know roughly what's needed but I have never seen anyone do this before in SQL. I'm ...
I'm following this tutorial. I created GetWebService stored procedure from tutorial, and example from there works fine
DECLARE @response NVARCHAR(MAX)
EXECUTE dbo.GetWebService 'http://headers....
I am having a difficult time trying to connect to a SQL Server DB on Linux, using pyodbc. I have a ODCINI file entry created. I started with this:
conn = pyodbc.connect('DSN=DSN;...
I figured out how to make a request to SQL server and post as JSON on the server side. I'm wondering how I can pull that data into the react side.
let pullTable = require('./actions/...