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

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 ...
0
votes
0answers
26 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 ...
-1
votes
1answer
15 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
33 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
18 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 ...
0
votes
2answers
48 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
20 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
34 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
26 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
75 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
38 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
38 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
23 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
28 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
50 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
15 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
36 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
16 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
21 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
33 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
31 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
0answers
27 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
44 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" ...
1
vote
1answer
26 views

Restore Database SET SINGLE_USER

I am in the process of writing a restore database script. I want to be able to connect as sa and run the restore script. When I run SET SINGLE_USER does this mean that my login is the only user ...
1
vote
3answers
39 views

Script to drop all databases except one not working

I'm trying to drop all databases but one on my test server. For this, I'm using the below script but it gives error: EXEC sp_MSforeachdb ' USE [?] IF (DB_ID(''?'') > 4 AND DB_NAME()!=''ABC'') ...
1
vote
1answer
34 views

CXPACKET SUSPENDED and NULL wait type

I was was running the query in this article: http://sqlity.net/en/708/why-cxpacket-waits-are-not-your-performance-problem/ To see what my threads were waiting on in regards to a suspended query with ...
0
votes
0answers
14 views

Timeout occurred while waiting for latch: class 'ACCESS_METHODS_HOBT_COUNT'

We have a big reporting database on production server, and we have several SSIS jobs running against it. Yesterday almost all this-database-related SSIS jobs stuck and running forever. Also the ...
2
votes
0answers
41 views

How to resolve RESOURCE_SEMAPHORE and RESOURCE_SEMAPHORE_QUERY_COMPILE wait types

We are trying to figure out root cause of slow running sql server queries hitting/fetching data from one of the database , size 300 GB, hosted on server with below configuration: Windows server ...
2
votes
2answers
106 views

How to handle too many inserts?

I have a database that is accessed from remote locations in the world with very long delays and poor transfer speeds. I currently transfer the data using a transaction since either all or no data ...
0
votes
1answer
31 views

How can I decide Rebuilding Index with DETAILED or SAMPLED on SQL Server

I want to rebuild my indexes and statistics on DB. How can I select this option on production maintenance. SQL Server Version : Microsoft SQL Server 2012 - 11.0.2100.60 (X64) (Build 7601: Service ...
0
votes
2answers
43 views

How do you repair a 'Suspect' database?

My database has gone offline, it is highlighted as 'Suspect'. Foolishly, I haven't got a recent back up. Is there a way of quickly restoring the database? I'm using MS SQL-Server (2008).
1
vote
2answers
24 views

SQLOS Resource Monitor and QueryMemoryResourceNotification Win API

Here's some info about SQLOS and the Resource Monitor I found from Jonathan Kehayias: As a general rule, SQL Server will use as much memory as you can give it, and it will not release the memory ...
-3
votes
0answers
16 views

Upgrade from SQL Server database server To SQL Server Report Server [on hold]

I'm quite new in SSRS and I have a SQL Server database, until now every report was created at C# code level, with RDLC files implicit in the program. But now I want to move the reports to a report ...
3
votes
2answers
227 views

RAID10 vs. RAID5 for data files

We are trying to evaluate the potential performance improvements that could be gained by switching an existing applications .mdf files to a RAID10 LUN vs. the existing RAID5 LUN they are living on ...
1
vote
2answers
42 views

How can I get SQL Server restore start and end time information?

SQL Server error log reports only the end of the restore (ah doc restore) How can I get the start time? Is it stored somewhere?
0
votes
2answers
63 views

Is there a faster way of moving rows of data between SQL Server databases than using CTE's?

I use the following query on SQL Server 2012 Express to move data that is older than 4 days old out of one [primary] database and into another [secondary database] for archiving purposes. The only ...
0
votes
1answer
28 views

Prevent record from being inserted in the table in After Trigger

I have a scenario where I have to insert a record in TableA only if the RecordId exists in TableB. I have written an Instead of Trigger on TableA for Insert, in which I am checking if the RecordId ...
0
votes
0answers
28 views

How many cores does my SQL Server need? [on hold]

I have a SQL Server 2008r2 ("SQL1") running very well on a virtual machine with 8 cores. I have a license for 8 cores, that I could use for any version of SQL Server. Now, I want to setup a new server ...
-2
votes
0answers
11 views

What are Client Access Profiles and what are they used for?

Can someone please explain to me what Client Access Profiles are, and what they are used for? I have not able to find 1 single thing about them online in the past week.
0
votes
0answers
16 views

Replicated databases across locations; delay in application

I have a replicated instance of database on different locations different SANs which is utilized for running a vendor supported application. However, I notice that there is a significant delay between ...
-3
votes
0answers
24 views

Monyog for SQL Sever [on hold]

I'm looking for a SQL Server Log Parser/Analyzer like Monyog for Mysql where I can load a log file and the parser can show me how often a query was executed (this is done by replacing literals so ...
2
votes
1answer
24 views

Implications of setting READ_Write

I am looking to update several users on READ_ONLY databases. As the databases are used 24/7 globally, and maintenance windows have just past, I would like to do this during a low-activity moment (to ...
0
votes
0answers
9 views

Azure Security for SQL Server Data

We are considering moving some of our database services to Azure but due to the kind of agreements we have with our customers having strict control over who can access the data is required. Based ...
0
votes
1answer
38 views

Search for first and lastname without order

maybe there is a simple answer to my problem: I have a mssql table ('Person') with a field for first and one for last name. I am coding a Program, where the User should be able to search for persons. ...
2
votes
0answers
79 views

Interpreting sys.dm_os_sys_memory

I try to figure out a way(using only TSQL) to determine if and how much the PAGEFILE (I will capitalize this term if I refer to the windows page file from now on) is used (like pagefileusage% ...
0
votes
1answer
58 views

Recommended number of index for a table

I've a table with many columns (~70) which contains computer's configuration. It contains approximately 50 000 rows. This table is very requested and all these column too. I use to run the following ...
0
votes
0answers
22 views

Grant permissions on stored procedure

I created a user in SQL Server 2012 database and revoked all permissions given by the public role. Then i granted exec permission on a stored procedure. The user can execute the procedure but cannot ...