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
9 views

SQL Server benchmark reference

I need to understand the "basic performances" of a specific SQL Server. I've a new work with a new customer, and one of their main problem is that the db is a lot slower than one would expect -they ...
0
votes
0answers
17 views

SSMS/SQL Server returning incorrect view definition

I have encountered this problem a few times. When I try to script view as -> CREATE/ALTER to new query editor window, the script returned is incorrect. The example script exerpt: FROM dbo.Table1 ...
0
votes
0answers
9 views

Why does an SSIS package fail when executed from the IS Catalog?

When executed via the SQL Server Agent under the same user context, is there any reason a package would successfully run when using the file system (i.e. DTExec.exe), but fail to execute when launched ...
0
votes
0answers
10 views

How do I determine if membership in a DB fixed role is by direct user memership or through membership in a custom DB role?

I'm cataloging memberships of DB users in the various fixed DB roles so that I can create custom roles by business function and grant permissions through these custom roles only. When using SSMS to ...
1
vote
1answer
34 views

Rebuild vs Reorganize [duplicate]

I currently have a maintenance plan that is reorganizing indexes everyday and I would like to know if you reorganize an index everyday would you ever need to rebuild the index? If so, why?
0
votes
1answer
34 views

I cannot restore a SQL Server database in a new location

Made backup of the database on server c, SQL Server 2012, moved on to the local computer with SQL Server 2012, restore database does not work. When checking the validity of the file on the server ...
0
votes
2answers
84 views

SQL Query - Possibly the most poorly written query in the history of mankind

Having a major headache trying to tune this query and looking for help, a programmer who had no idea what they were doing messed with this query and it is currently being used in production and it ...
0
votes
1answer
38 views

Creating a constraint

I created a report that records entries from a table which has 4 columns 1 Shipper ID 2 SHipper Reference 3 loading 4 Completion My primary keys are columns 1 and 2 there are no foriegn keys, ...
2
votes
0answers
29 views

Multi-Instance Windows Failover Cluster - Min / Max Memory Allocation Dilemma

We run numerous 2 node SQL Server 2008 R2 Failover Clusters in Windows Server 2008 R2 on a VMWare eSXi virtual platform. Each cluster hosts 3-4 SQL instances with varying degrees of memory ...
1
vote
2answers
80 views

How to re-declare T-SQL variables if it already exist?

Background: I'm building a SQL command to be executed on the server which involves a lot of accessing store procedure and declaring variables which are used as input to other stored procedures. This ...
1
vote
0answers
17 views

SQL Server to XML files alternatives

I am currently looking for an alternative to writing a large, complex XML file based on a known specification. Currently the file is written in t-sql as a stored procedure. The output is in a results ...
1
vote
2answers
42 views

upgrade of 24/7 OLTP

Our primary db is a 24/7 OLTP db on SQL2008 R2 on an Active / Passive Windows cluster. It is a VLDB and uses almost all SQL functionality (including Service Broker and Mirroring), acts a Publisher and ...
1
vote
1answer
40 views

Execution Plan : Table Insert Cost 90% vs Clustured Index Insert Cost 86% [duplicate]

Situation : We have table It has millions of records. Table has 1 Clustured Index and 1 Non Clustured Index. It was found that Clustured Index is not used by any of SQL Query. But Insert Execution ...
0
votes
0answers
16 views

SQL All registers Group by Month [on hold]

I Want to get this result in my SQL. | Driver | Month | Type | +-------------+------------+---------+ | 1 | 01 | Y | | 2 | 01 | N | | ...
0
votes
0answers
14 views

Why do the databases go into the “recovery pending” state when the share permissions are changed from “everyone”?

Yesterday we had a power failure and after the power was back our financial databases on the SQL did fall into "Recovery Pending" state. After struggling a while I've remembered that a few days ago we ...
0
votes
0answers
19 views

Procedure or function 'sp_InsertImages' expects parameter '@Img_path', which was not supplied [migrated]

i have passed img_path in my code nd procedure but it show me error please anyone help me. my procedure is : create proc sp_InsertImages ( @Img_path nvarchar(max), @product_id numeric(18,0), ...
-1
votes
2answers
31 views

How to run multiple select statements in Data flow task in SSIS [on hold]

I am migrating data from one database to another database using SSIS package and i need to write multiple select statements for same table depending on conditions as mentioned below. Actual Queries i ...
0
votes
0answers
11 views

SSRS Report queries begin running slowly, have to stop and start report server to restore performance

We have had a production issue crop up twice now where reports begin running slowly seemingly at random. When this happens we can see from running SQL Profiler that the report queries are taking an ...
1
vote
0answers
27 views

Rolling back a SQL Server 2008R2 Database stored in SQL Server Express [on hold]

We had an accident where a bunch of data was deleted from one of our products. The product removed a bunch of lines from various tables about 12 hours ago. There is no good backup and I try to ...
0
votes
0answers
19 views

The Local Security Authority cannot be contacted

I am not very expert with SQL Server but I have to use to for one of my application development. Issue is that when I open the PC in morning to start my work, my application couldn’t make connection ...
0
votes
0answers
40 views

SQL Server Timesheet Query Performance

I am working on a webapp for timesheet administration. I write a query to group all the time entry of an employee by week. And I also have to use paging. The query is already slow with something like ...
2
votes
1answer
33 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
13 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
25 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
21 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
32 views

Increment the value of an entire column [on hold]

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
13 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
23 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
24 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
41 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
28 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
14 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
21 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
42 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
27 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, ...
3
votes
3answers
83 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
26 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 ...
2
votes
1answer
41 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
65 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
34 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 ...
5
votes
2answers
132 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
31 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
39 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
98 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
36 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
55 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
21 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 ...