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
0answers
4 views

Log shipping and new NDF file

I have a log shipped database, and I want to create a new NDF file in another disk for moving historic tables to that NDF file. My goal is to free some space in the MDF file because the disk that the ...
0
votes
0answers
7 views

SQLSTATE:HY000, SQLCODE: -385

I am getting the following error when I try to deploy my tabular model to a local instance localhost\tabular The model processes on my local PC with no errors but when I try to deploy it fails with ...
0
votes
0answers
15 views

Fill Factor - Displaying Old values

I updated my fill factor value from 0 to 75 and I rebuild all the indexes on the database When I ran select * from sys.indexes some indexes are 0 and some are 75 The Indexes that are 0 (I am not ...
0
votes
0answers
19 views

TDE state is changed after DB deployment

I have database projects in Visual Studio 2013 from which I deploying databases to SQL Server. Also I am using Transparent Data Encryption for these databases and it is in state 3 which means TDE is ...
-5
votes
1answer
28 views

Increment the value of an entire column

I have a table and one of the columns, is of the data type int. I want to increase every tuple's value of that specific column by 100. I have not found a proper answer for this yet. Anybody?
0
votes
0answers
7 views

SSRS Consuming a Single Core

I have production SQL Server machine with 10 separate instances on it: The last instance that was added included an install of SSRS. Since that time I've seen high CPU usage on a random single core ...
0
votes
0answers
17 views

View Job Properties Fails for Job Owner

Domain user MyDomain\UserA has a login with a server role of public and is a user of the msdb database with membership in the SQLAgentUserRole. The user owns a job, Daily Job. When logged in as the ...
0
votes
1answer
23 views

What's the difference between xp_fixeddrives and this query [duplicate]

when i run xp_fixeddrives command to the drive that contains my tempdb, I obtain 10mb of free space, but the following query return other thing (45000 mb free). other query : USE tempdb; GO SELECT ...
2
votes
1answer
32 views

In SQL Server would misc pages be pushed out when an object grows within a mixed extent?

In SQL Server 2008-2012, objects (including tables) are first put in a mixed extent. An extent can accommodate up to 8 pages and accommodates more than one type of page (meaning: pages from more than ...
1
vote
1answer
18 views

Wrong data type while using linked tables in MS Access

I have a SQL server database which needs to be linked to MS Access forms. I have a table with one column as both Identity and is a also a primary key and is big int But after linking the table , if ...
0
votes
0answers
12 views

SQL Server - How to set multiple variables from excel spreadsheet?

I have a spreadsheet of 4 columns as shown. What I want to achieve is this: update apodetail set status = 'O', cur_amount = 'VAR1', rev_price = 'VAR1' where order_id = 'VAR2' AND line_no = 'VAR3' ...
-2
votes
0answers
18 views

sp send dbmail mail queued but not sent sent_status failed [on hold]

I'm trying to send mail by creating my own account using system defined stored procedures. My account has been created. I've made profile account, used sysmail_add_principalprofile_sp to assign role, ...
2
votes
1answer
35 views

Help understanding discrepency between sys.dm_exec_cached_plans and dm_os_memory_clerks

We've got a strange discrepancy on one of our SQL Server 2014 instances between the amount of memory being used for cached plans as per sys.dm_exec_cached_plans and the amount of memory used as per ...
0
votes
1answer
21 views

how can I see the arguments passed to a stored proc on Azure?

The query that I'm using: SELECT deqs.execution_count, deqs.last_execution_time, dest.objectid, SUBSTRING(dest.[text], (deqs.statement_start_offset/2)+1, ...
2
votes
2answers
66 views

How to interpret correlated subqueries?

EDIT: Both answers are great but I think I must clarify my question. NOTE: I must indicate that in the following, by executed, I mean logically. I understand that the actual execution made by the ...
0
votes
1answer
25 views

XACT_ABORT ON not working as expected on SQL Server 2012?

It looks like XACT_ABORT ON is not working as expected. Here are a table and a procedure that inserts into it: CREATE TABLE rain ( rain_time DATETIME , location VARCHAR(100) ); GO ...
0
votes
1answer
11 views

SQL Server Full txt Search - Thesaurus Entries

I'm thinking of adding a full text search to our product (currently using SQL 2005 Enterprise), so just doing some preliminary research. I read that you can add thesaurus entries, so "Internet ...
1
vote
1answer
39 views

Can't connect to new instance of SQL Server

I was trying to upgrade to SQL Server 2014 from SQL Server 2012, but I kept getting a failure on one of the pre-installation checks saying that I needed to have SP1 or later installed for SQL Server ...
1
vote
0answers
59 views

How is the B-Tree created for a composite PK?

This is a theoretical question in regards to how SQL Server stores the data for a table that has a clustered index over two columns (both columns form a PK). Consider a table with columns PersonID, ...
0
votes
0answers
33 views

Kerberos and Linked Server

I have been reading through past posts but I am still getting issues with 2 SQL servers connecting using a linked server when querying from a 3rd SQL server. I constantly get the error "Login failed ...
4
votes
2answers
126 views

Hindrance in TSQL SVF Call

I have a simply Products data table with 100k records (just generates some random data): set nocount on create table dbo.temp_Products ( [ProductID] int, [Type] tinyint, [Price] float, ...
0
votes
0answers
30 views

lock request time out period exceeded. When revoking db_owner access

I am trying to revoke db_owner access of an user and I am getting this below error! I have no active transactions User (whom I want to revoke access) is not connected to any db DataBase owner is ...
1
vote
1answer
44 views

Why do maintenance plans exist as a feature? [on hold]

Do maintenance plans provide any functionality beyond their component parts? It would seem that the only value added is the convenience of grouping subplans into logical bundles, and the simplified ...
0
votes
0answers
27 views

use outer apply to find for each row have a record based on first result from detail table

i have a two table there's PROBLEM for problem (as master) with group of problem and PROBLEM_LOG (as detail) PROBLEM PROBLEM_ID PROBLEM PGROUP 1 Line Down ...
4
votes
1answer
87 views

SQL “Standard” guide?

I am currently learning TSQL and am learning that were possible, I should use "standard" SQL dialect. Where can I find out which commands are "standard" and which are TSQL?
0
votes
0answers
35 views

How can I get a list all Databases in a Database Instance

I am getting an error with SQL Copy Database Wizard. It is finding a database that was dropped over a year ago and fails because it cannot be found. I cannot find any reference to the database and ...
0
votes
2answers
32 views

Executing stored procedures asynchronously using tasks in SSIS

I have a stored procedure which is calling 20-30 stored procedures. I need these stored procedures to run asynchronously. From what I have read, it seems like executing those stored procedures using ...
1
vote
1answer
38 views

Can you optimize a view with many UNION ALLs to external databases?

Given these views in a Sql Server 2012 database: create view vManyUnions as select 1 as p, a from vSubQuery_1 union all select 2 as p, a from vSubQuery_2 union all select 3 as p, ...
0
votes
1answer
20 views

log file very large how to apply changes then truncate sql server 2008 r2

As a developer from time to time I will need to restore a local copy of our live database for testing purposes. I 'm running into disk space issues because the logs are bloody 15gb. I was told the ...
2
votes
3answers
76 views

Any way to track who has been executing what queries? who has been on my lawn?

I have a database in which most of tables are readable for users in one particular security group. I know most of the users are from my team, but lately I found that it's been used by more and more ...
0
votes
1answer
22 views

Group table records by Item than Year

I have a SQL table that is layed out as follows: {Itemcode} {FiscalYear} {FiscalMonth} {StartingQty} {PeriodChangeQty} Ball 2013 01 15000 -7500 Ball 2013 02 0 1000 Ball ...
0
votes
2answers
40 views

Sql Server Fill Factor - Restart sql server services

I changed the Fill Factor option from 1 to 75. When I run a query that displays the fill Factor I am seeing 75 But I read online that I have to stop and start the sql Server services inorder for ...
0
votes
2answers
16 views

Microsoft Access Security

So I get how to connect Access to SQL Server, and I understand that the tables have to be linked, but my problem is security. If I link the tables from SQL Server into Access, then anyone who comes ...
2
votes
1answer
29 views

SQL AlwaysOn Availability 2 synchronous nodes on either side of an asynchronous link

Say we have two datacentres, DC-A and DC-B. Say in each DC, there are two SQL servers. DC-A has SQL-A1 and SQL-A2 and DC-B has SQL-B1 and SQL-B2. Is it possible to have SQL with an AlwaysOn ...
2
votes
2answers
78 views

Moving DB Log destination?

I currently have SQL DB and Log files going to the same drive. I would like to move the Log files to their own drive. Is there an easy way to achieve this and will it require downtime/reboot of the ...
0
votes
1answer
40 views

Treat database field as a flat file source

We have a partner sending us csv data to a web service of ours that gets sent to a messaging system that is SQL Server based. I am writing data to disk and then importing to another database by using ...
0
votes
1answer
39 views

Viewing execution plans for queries with parameters

I have a sample query generated by an application (Microsoft Dynamics AX 2012 in this case) which is ineffective performance-wise (cross joins, order by etc.) I would like to display its execution ...
-1
votes
1answer
24 views

Retrieve user Permissions on a database [on hold]

Please could you provide me query that shows user(John Felix) permissions on a server\database.
2
votes
2answers
38 views

Benefits of table partitioning on same disk

Maybe is stupid question, but I must ask to be clear with that. I know that table partitioning is powerful mechanism of speeding data search when partitions is placed on different disks. What I need ...
0
votes
0answers
18 views

SQL Server to Oracle migration

Converted model resulted into incomplete script generation as all stored procedures, triggers and views were missing, only table structures were generated and i did not get any error messages for it. ...
1
vote
1answer
58 views

Backup Specific days monthly SQL Server

How to backup only specific days each month on SQL Server (I use both SQL Server 2005 and 2008) using a maintenance plan or Agent job. I mean by that to backup my databases from 28th of each month to ...
0
votes
0answers
16 views

Using previous (.mdf) datatabase with VS 2012

I have a previously created web site with aspx pages, a database and login page that was originally created in Microsoft VS Developer 2010 Express. The database has several hundred records and is ...
2
votes
1answer
37 views

Trace Flag 4199

Microsoft's KB article about Trace Flag 4199 is a bit confusing: ...any hotfix that could potentially affect the execution plan of a query must be controlled by a trace flag. Except for fixes ...
0
votes
1answer
18 views

Change Data Capture in a services environment

Change Data Capture looks to be exactly what I need... Except. All of my database actions come from users that system accounts. We have WCF service that is called by an application. The WCF Service ...
1
vote
0answers
23 views

Include LOCK_ESCALATION in CREATE Script in SQL Server 2012

Consider following T-SQL script: USE [DB1]; GO CREATE TABLE [T1] ( [C1] INT NOT NULL, [C2] TEXT NOT NULL ); GO ALTER TABLE [T1] SET (LOCK_ESCALATION = AUTO); GO When I explicitly set ...
2
votes
0answers
37 views

Case Statements, subqueries, and datediff

First time posting on this website so please let me know if you require any other information. This first section of code worked perfectly and resulted in correct information. [Field 1] = (CASE ...
1
vote
2answers
32 views

Applying Quotes Across Multiple Lines

In SQL Server Management Studio you can use the shortcut CTRL + K > C or CTRL + K > U to comment/uncomment lines in bulk. Is there a similar keyboard function that applies single quotes across ...
0
votes
1answer
46 views

Excel Data Connection to SQL Server using Windows Auth from untrusted machine

We have an Excel spreadsheet that uses a Data Connection to a SQL Server database. The database server is joined to our domain, and Windows Authentication is enabled. Here is a sample of the ...
3
votes
0answers
46 views

Is it possible to get seek based parallel plan for distinct/group by?

An example from this question shows that SQL Server will choose a full index scan to solve a query like this: select distinct [typeName] from [types] Where [typeName] has a non-clustered, ...
1
vote
2answers
20 views

How can I map a login to a database using T-SQL (not SSMS)

I'm writing a program that requires me to assign all permissions and everything in code. I have gotten stuck in this part: I just want to do the equivalent of clicking the little box under "Map" ...