Microsoft's SQL Server is a relational database management system (RDBMS) that runs as a server providing multi-user access to a number of databases. It originated from the Sybase SQL Server codebase, which is why both products use the extension of SQL called Transact-SQL (T-SQL).

learn more… | top users | synonyms (2)

0
votes
1answer
15 views

Where does the logins users are stored in the SQL server “in which data base “ [duplicate]

Where does the logins users are stored in the SQL server “in which data base “ In some softwares that requires the admin to create users/password for his users such as ArcGIS server the logins ...
-3
votes
0answers
20 views

I want to create a trigger from parameter of procedure

CREATE PROC procCreateTrgSelectTBL (@tableName VARCHAR(50)) AS BEGIN DECLARE @sql NVARCHAR(MAX), @statement NVARCHAR(MAX) SET @statement = ' CREATE ...
0
votes
0answers
15 views

SQL Login import [on hold]

I am attempting to create a SQL login for a connection to my database. Background: I took a database from server 2005 and upgraded it on SQL Server 2008 and then moved it to 2014. Its original ...
2
votes
1answer
28 views

Does Resource Governor help protect page life expectancy?

I have several large tables that I need to copy into partitioned copies on a transactional database. I am worried about the hit that this will cause to performance of my production applications. In ...
2
votes
0answers
27 views

Understanding `dbcc showcontig` Record Size

I am comparing two tables. They are: CREATE TABLE Table1( Column1 [bigint] NOT NULL, Column2 [VARBINARY](max) NULL, Column3 [int] NULL, Column4 [DATETIME] NULL, Column5 [INT] ...
3
votes
1answer
21 views

Finding when a currently running Extended Events session started?

For old-school traces, I can look in sys.traces or the SQL Server log to find when a trace was started. Is there something similar for Extended Events? I came across this blog entry about using a DDL ...
2
votes
1answer
28 views

SQL Server 2012 - Disable Job On Linked Server

I have a job on server B, which is linked to server A. Is it possible to disable a job that exists on server B in the context of server A? I have tried the following command from server A and receive ...
2
votes
2answers
189 views

Why does PK constraint require a separate index when I already have a suitable unique clustered index?

This is part of table definition from here: CREATE TABLE [dbo].[JobItems] ( [ItemId] UNIQUEIDENTIFIER NOT NULL, -- lots of other columns CONSTRAINT [PrimaryKey_GUID_HERE] PRIMARY KEY ...
2
votes
5answers
20 views

How to find SQL Server database is in use or not?

What query do I need to write to know if the database is in use or not? I tried following query SELECT name FROM sys.databases WHERE state != 0; but it is not working. I want to ...
1
vote
0answers
79 views

How to install Sql Server 2000 on Windows 10(x64)? [on hold]

After upgrading Win8.1 to Win10, Sql Server 2000 does not work. I tried to re-install Win10, and installed Sql Server 2000, but the installation stopped at installing MDAC, it could not continue. Did ...
0
votes
0answers
40 views

The target principal name is incorrect. Cannot generate SSPI context - SQL Server 2012 error

I don't understand why this error is popped up suddenly. It was working till yesterday. It is a stand alone env. Problem is when me or any user wants to connect from their machine locally it is ...
0
votes
1answer
26 views

How can I call a remote User Defined Function?

I have SQL server which contains a link to another server(For e.g: test) I have a function in linked server(name:getvalue(@parameter)).so this function output i want to retrieve in SQL server 2012.I ...
3
votes
1answer
54 views

Compound Primary Key - Index both fields?

I have a many-to-many join table between users and roles. CREATE TABLE AppUserRole ( UserId INT NOT NULL, RoleId INT NOT NULL, CONSTRAINT PK_AppUserRole PRIMARY KEY (UserId, RoleId), ...
0
votes
0answers
35 views

3 failed SQL Server Updates (KB3045313,KB3045305) plus SQL Server 2008 Service Pack 3

I'm trying to upgrade to Windows X and I believe that 2 failed SQL Server 2008 patches are preventing this from happening. I see this in Windows Update along with this failed History: ...which ...
0
votes
2answers
50 views

Dynamic Filters in SQL server [on hold]

I have problems with my dinamic filter in 'sql server'. My problem is that the filters aren't working. When I try to execute the store procedure I just get all the data without filtering. I'm new ...
6
votes
0answers
53 views

SQL Server Services empty in SQL Server configuration

As I upgraded from Windows 8.1 to Windows 10, I noticed that the SQL Server Services in SQL Server Configuration Manager is empty. SQL Server still works perfectly well at the moment. SQL Server 2014 ...
2
votes
1answer
46 views

Using Join to get data from multiple tables in SQL Server [on hold]

A(a_id, a1, a2) B(b_id, b1, b2) C(c-id, a_id, b_id) Now, I want to fetch all the data of table A, and from table B, I only need a record of b1. How can I use join query in SQL Server to fetch the ...
1
vote
1answer
19 views

Access to Server and Real Data for Performance Tuning [on hold]

I'm newbie in performance tuning (PT) in SQL server and I have read some documents about how to do it. It is based on theory from the articles or books. The next step to is to learn about it by ...
1
vote
0answers
53 views

Should the PK on an identity column be non-clustered? [on hold]

For a table with PK on an identity column, it will be clustered by default. Could it better be non-clustered? The reason is other indexes will be created for queries. A query which uses a ...
2
votes
1answer
45 views

Stats Maintenance after Restoring to Newer SQL Server

What's the ideal (or necessary) sequence of call when restoring a SQL Server 2012 backup onto a SQL Server 2014 instance and updating the compatibility level? -- Update Statistics for all tables EXEC ...
5
votes
1answer
73 views

Why is DistinctSort followed by TopNSort in my query plan?

I have the following definition: CREATE TABLE [dbo].[JobItems] ( [ItemId] UNIQUEIDENTIFIER NOT NULL, [ItemState] INT NOT NULL, [ItemCreationTime] DATETIME ...
1
vote
1answer
12 views

Replication with fail over cluster in SQL Server 2014

Presently I am Using Replication Feature in SQL Server 2012 .I want to migrate to SQL server 2014 .I want to use fail over cluster feature .Does it effect the replication feature which we are using ...
0
votes
2answers
57 views

Select statements during long update

I've a table MESSAGES id (long) | attach_data (image) | ins_date | flag this table contains all messages of my application. During night, my job cleans old attach_data with query update messages ...
-2
votes
1answer
31 views

Performance Testing for Database [on hold]

Is it possible to make a automatical performance testing in SQL server in the production phase? When data in the database increase you need to gain feedback in proactive approach. I would like it do ...
0
votes
0answers
20 views

Why does my SQL Server HAG fail from PRIMARY to RESOLVING and back again?

I recently noticed our SQL Server High Availability Groups failed from the PRIMARY to the RESOLVING state, and then from RESOLVING to the PRIMARY state, without failing to the SECONDARY state. Does ...
2
votes
1answer
92 views

Database Backup - In Process - Power Outage

I am using SQL Server 2008 R2. What happens if a database backup (Full/Differential/Transaction Log) is in process and there is a sudden power outage or the system crashes? Does that corrupt the ...
0
votes
0answers
22 views

Query Designer - Cannot connect to Server

I am following a tutorial to be able to use SQL Server Data Tools (SSDT) for reporting. However, I am having issues connecting to a particular database when I try to add a new DataSet and try to ...
-1
votes
0answers
10 views

Error encountered during replication [on hold]

During replication i deleted the physical files of database which was in recovery state now it is in recoverypending state so how i can delete it
2
votes
1answer
49 views

Migrate existing SQL Server database file to smaller files

I have a database that is about 1TB in size. It's currently on a 2TB hard drive and I would like to replace it with a few 512GB SSD. I need to split the existing database file (.mdf) into multiple ...
3
votes
2answers
61 views

Use a view to join tables or a stored procedure for a better execution plan?

First let me state I am a C# developer, not a SQL Server DBA, so please excuse my ignorance on SQL Server database query execution plans. What I want to know is for a stored procedure which the ...
1
vote
3answers
28 views

Selecting the average of the top percent of duration, grouped by minute

I am attempting to find the average of (the top 5% of duration/ per minute). I wrote this query: select AVG(Q.duration) Avg5Perc, Q.time FROM ( select top 5 PERCENT duration, time from ...
0
votes
0answers
21 views

There is no option of audit in security for SQL Server 2014 .How to enable audit option for same?

Please see the below image there is no option about audit in database
1
vote
0answers
22 views

SQL Server Performance in VMWare when creating different drives from a single Datastore [on hold]

On VMWare if you are going to create a new SQL Server instance with 4 processors / 32GB ram as an example GuestOS and I have access to storage that is just one a big giant 800GB "Datastore" (made up ...
2
votes
0answers
23 views

SSIS Update (Replace) record instead of append based on Primary Key

I created an SSIS Pacakge that imports a monthly extract claims file. I have a simple Data Flow task, flat file to OLEDB Destination with a Derived column component in between used to generate a ...
1
vote
0answers
17 views

SSIS Error - Login Failed for user 'sa' [on hold]

I am running an SSIS package. However, I get the below error... The ExistsOnSQLServer method has encountered OLE DB error code 0x80040E4D (Login failed for user 'sa'.). The SQL statement issued ...
0
votes
0answers
37 views

Stored Procedure to create 1 row in parent table and multiple rows in child table [on hold]

I'm trying to create a stored procedure that creates a parent record and then multiple child records. I've kept the columns basic for this. Table 1 has columns: tbl1.EmployeeID tbl1.contractID ...
4
votes
1answer
83 views

When to use sort_in_tempdb when rebuilding indexes?

We are debating whether to use the SORT_IN_TEMPDB option for our DW tables. My understanding is that there are more writes when using this option, although they are more sequential. We have a SAN ...
-1
votes
1answer
30 views

Using datediff() in SQL Server 2008 to get the difference [on hold]

I'm having some trouble in updating my table. I would like to update the records that is passed in the current date. I am trying to update the records of the reservations(check-out) that is finished. ...
0
votes
0answers
23 views

Creating a trigger to update field in 1 table based on values in another table using data in multiple rows

I'm new at SQL and need to create 2 triggers between 2 tables. Table 1 has the following columns: tbl1.ContractID char(6) tbl1.ContractFulfilled char(1) Table 2 has the following columns: ...
3
votes
0answers
35 views

SQL Server replication - error when creating a subscription - The article '(null)' does not exist

When trying to add a subscription to an existing publication use [Product] exec sp_addsubscription @publication = N'Product', @subscriber = N'REPLON1', @destination_db = ...
1
vote
2answers
53 views

Create rows when selected rows exist

I haven't spent much time with SQL Server, and I can't seem to figure something out. I have 3 tables; user, usergroup, group. usergroup is a table that contains both a group id and a user id, where ...
0
votes
1answer
25 views

SQL server data copy bug? [on hold]

I have one query who shows some data, and those data I'm manually copying to Table1. The query shows the numeric type and it is in this form Query +---------------+ | status ...
0
votes
1answer
31 views

Synchronise Oracle Tables to SQL Server

Our ERP is using an Oracle database while our BI system is based on SQL Server. We need to get the changed data in Oracle and copy it in our staging area. At the moment we get the changed rows by ...
0
votes
1answer
23 views

sql server replication - how to find and drop subscriptions?

I had 2 subscriptions to a publication, but they were from the same subscriber server and writing to the same subscriber database, just one was bad and one was running fine. I could not find a ...
0
votes
1answer
31 views

How can I inform myself that an automatic SQL Server process has worked?

I have a Windows batch file which extracts some data from a remote system and then imports it into an instance of MS SQL Server 2014. The batch file runs SQLCMD and uses SQL files to bulk insert from ...
2
votes
3answers
62 views

Show all stored procedure definitions (content) for editing

Apologies if this has been asked before, the suggested 'related' questions weren't relevant and my own search turned up very little. I need to list the definitions (code) of all my stored procedures, ...
-4
votes
2answers
28 views

Uses of Database Mail [closed]

What can I use Database Mail for in SQL Server 2012? I have configured Database Mail but would also like to know where I can use it.
1
vote
1answer
20 views

Does our application work with sql-server AlwaysOn?

This is the question a client of ours is asking. For now I have given a generic response that we will support this however they should provide us with a test environment. Our application is using ...
2
votes
0answers
34 views

Moving from MS Access to SQL Server 2012, need help with column history

I'm moving an access database from all the data being in MS Access to MS Access being just a frontend, but I'm having trouble figuring out how to do a sort of column history. I have a ...
1
vote
1answer
22 views

When does SSIS SQL Server Configuration write to the configuration table?

I am using SQL Server configuration in an SSIS pacakge. Other than when you create/edit the SQL Server configuration entry in the SSIS Package Configurations, are there other times that SSIS writes to ...