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)

-1
votes
1answer
15 views

Previously running query taking very long execution time

I am having some cache tables which are populated hourly from main tables. After few days(a week) suddenly select statements on these cache tables start taking a long time. Can you please help me on ...
0
votes
1answer
27 views

Sql Agent Jobs executes too slow

I have posted a question like this before but is seems that I did not explain the whole story clear. So I made this one to explain it in details. Here's the stored procedure USE [xxxx] GO /****** ...
0
votes
1answer
23 views

How to convert timestamp / rowversion to a date and time in SQL Server?

How to convert timestamp / rowversion to a date and time in SQL Server? I have several tables where I would like to track the last update, with column names like ModifiedAt, UpdatedAt, UpdatedDate. ...
-4
votes
0answers
13 views

**Homework/Research** for future Database Administrator

Considering I am pretty new to software development/programming I decided to do a technical writing report researching what programming languages are best suited for students wanting to pursue a ...
0
votes
1answer
13 views

Backup to local and MIRROR TO Azure Files returns ERROR

I have an Azure VM with SQL Server 2014, with a local drive (X:) for storing backups. Using Ola Hallengren's scripts. I added an Azure Files share and tried to do a mirror backup, but I get the ...
-4
votes
0answers
16 views

Update using SQL Stored Procedure [on hold]

I am new to SQL, I have 3 tables and I want to perform following logic via a stored procedure. IF Table A.Item No = MasterTable. Iteam No Then, Add a Record in table Short Expiry where Unique ID = ...
-1
votes
0answers
18 views

How do I join these queries into one query?

I have these below queries. How do I join these 3 queries into a single query? 1st query: SELECT TOP(1) @tmpOnlineCat = ac.AlertCatID FROM alert.AlertCategory ac WHERE ac.FkAlertID = 2 AND ...
-5
votes
2answers
12 views

Not able to attach database backup file .bak into SQL Server 2008

I have a database backup file named iyym.bak. How can I attach the database to my SQL Server 2008? I tried inside SQL Server Management Studio the following: right click on data base folder in ...
2
votes
3answers
7k views

Linked Server to SQL Server 2000 server from SQL Server 2012

I have a new SQL Server 2012 instance, and am migrating a database from SQL Server 2000. Some of the stored procedures in the DB I am moving reference another database back on that 2000 server. What ...
18
votes
3answers
1k views

Which collation should I choose for a muiti-language website?

Does a collation have any influence over a query speed? Does the size of a table change depending of the collation? If I want to build a website that must support all possible languages (lets take ...
0
votes
1answer
36 views

Restoring SQL Server 2012 DB - OPEN SYMMETRIC KEY SKey DECRYPTION BY CERTIFICATE NAME Not working

Database Admins, can you please help me out and let me know why my script is not allowing me to DECRYPTBYKEY once I restore my DB from a PRODUCTION BACKUP.... -- SET Staging to Single User Mode to be ...
-1
votes
1answer
19 views

sending email using database mail

How do I use database mail in SQL Server? I have followed many articles on the forums but I failed with many errors. I read in one book that I must have SMTP server and Microsoft Exchange installed ...
2
votes
0answers
17 views

MS SQL Server IO read increase appear randomly

The number of read (IOPS) in my MS SQL Server database increased randomly even during the night (low activities) from 0.3 MB/SEC (normal) to 25-30 MB/SEC. After like 30 minutes, it's capped to 6 ...
3
votes
2answers
437 views

Security for Oracle linked server from SQL Server

I'm trying to make the linked server from SQL Server 2005 to Oracle more secure by not having user/pass on "Be made using this security context:" fields so only a specific user can access the data ...
1
vote
1answer
13 views

Migrating DB, SSIS packages, SSRS Reports from 2008 R2 to 2012

I have been given the task of planning our BI department's infrastructure upgrade from SQL 2008 R2 to SQL 2012. This process will include updating our data warehouse (database), reporting ...
0
votes
0answers
10 views

SQL Server service in change pending state after trying to cycle service [on hold]

Database on an instance was stuck in recovery pending. Put database in emergency mode and then someone set it to be ONLINE which locked up the instance. If you try to use SSMS and browse databases ...
0
votes
0answers
11 views

Proper Partition Alignment SQL Server [migrated]

I'm trying to follow the advice from this technet article about partition alignment. Our San is an EMC, the disks are in a 4 disk raid 10. This is a SQL Server with an I/O intensive application, ...
0
votes
0answers
29 views

SQL Server Integrated Security without a Domain

This question potentially sits somewhere between ServerFault and DBA Admins but I went here because my question is specific to SQL Server Integrated Security. We have been developing an SOA product ...
0
votes
0answers
33 views

how to revoke backup and restore permission from database owner

I have SQL server 2008R2. I grant every user who wants to work on the database the database owner privileges, but recently found out that there is a database backup spam on the server, so I thought ...
1
vote
2answers
291 views

Analysis Service Connection String

I use sql server 2012, and have multi cube. I can connect to my created cube from Excel (Data Tab\Connections) with windows authentication. How can set permission to SQL Server user on my cube. and ...
-1
votes
2answers
50 views

SQL server avoid procedures parameter sniffing

I'm getting slow performances from this procedure CREATE PROCEDURE MyProcedure01 @date datetime2(7) AS BEGIN SELECT [Limit1].[C2] AS [C1], [Limit1].[mc_object] AS [mc_object], [Limit1].[C1] ...
15
votes
7answers
36k views

How to efficiently check EXISTS on multiple columns?

This is an issue I come up against periodically and have not yet found a good solution for. Supposing the following table structure CREATE TABLE T ( A INT PRIMARY KEY, B CHAR(1000) NULL, C ...
2
votes
1answer
61 views

How is it possible that two deletes give a deadlock, if they do have different primary key data

I am getting a deadlock by the same delete stored procedures that is called by two different threads for deleting two concurrent records. The deadlock happened on the primary key index of the X ...
0
votes
1answer
60 views

Corrupt SQL Server 2008 database

I am running a donor program on a Windows Server 2008 box, running SQL Server 2008. The primary database file now fails when I run the integrity check on it and we are starting to see errors. I ...
-1
votes
0answers
19 views

complex SQL depending on each object insert time? [on hold]

Hi so here is the table: Select * from LogTable order by insert_time desc LogTable: |user_id|action|object_id|insert_time| |2 |start |123 |20.04.2015 | |2 |stop |123 ...
2
votes
1answer
86 views

Use transaction logs multiple times

Every night a full backup is made of all the user databases. Every 15 minutes, transaction logs are created. Today i succesfully restored a database with the use of transaction logs. I set the time ...
0
votes
2answers
68 views

When doing an update on a set of records, how do i get previous updates to show on current row to update in UDF [on hold]

SO i have a rowset of 10 UIDs. They are all dupes, lets say DUPEUID. I have a UDF that will take the UID, check it against the table to see if there is a dupe, and update the UID to DUPEUID01. The ...
0
votes
0answers
22 views

Query to List Backup Files on Azure Blob Storage

In SQL Server 2014, it is possible to restore a database from a backup stored on a URL: SQL Server Backup and Restore With Windows Azure Blob Storage RESTORE DATABASE [some_database] FROM URL = ...
1
vote
2answers
122 views

Interpretation of multiple join order

I have a problem using multiple joins in one SQL Statement. For example, I have 10 Tables which are tbl1, tbl2, tbl3,..,tbl10. I would like to select some columns from each table. If I use joins in ...
4
votes
1answer
99 views

Understanding below execution plan

I have two tables tb1 and tb2, tb1 doesn't have any indexes on it. I populated tb1 with 1000000 rows and tb2 has 500 rows in it and with a clustered index on ID column. To understand nested loop ...
0
votes
2answers
28 views

Whats SQL Server NVARCHAR(max) equivalent in MySQL?

Using SQL Server you just have to give the "MAX" parameter to the length of a text data type, but in MySQL there's no such a thing. According to Ispirer: "n" is the maximum number of characters, ...
1
vote
1answer
54 views

SQL Server Mirroring can't connect to mirror database

I am at my wits end with this. I am trying to set up mirroring between a development server and my local machine. The error that keeps coming up is: Msg 1418, Level 16, State 1, Line 1 The ...
2
votes
1answer
21 views

Advice on transaction log based reporting server

I am in need of advice on setting up a remote read-only MSSQL 2008 reporting server using transaction logs. From what I gather, true TLS setup requires both database servers to be aware of each other ...
3
votes
1answer
484 views

SQL Script to Drop old AD logins, Inactive SQL Logins and all related Users

Related Question: SQL Server script to delete accounts no longer in Active Directory Whilst the above question points out the rather handy sp_validatelogins procedure, i'd like to extend this ...
0
votes
0answers
24 views

Why is the transaction log file not truncated though its simple recovery model? [duplicate]

My database is simple recovery model and when I view the free space in log file it shows 99%. Why doesn't my log file truncate the committed data automatically to free space in ldf file? When I shrink ...
0
votes
2answers
35 views

Can I recover a damaged SQL Server 2005 database with the undamaged .mdb and .ldf files?

We have a client who has suffered a power spike and it would be helpful to somehow reconnect with their SQL data. Their original SQL Server was 2005, with SP unknown, but installed on D: and C: ...
1
vote
1answer
71 views

What is stored in a transaction log file?

What does the transaction log file store? Is it the blocks of transactions to be executed, is it the snapshot of records before beginning the execution of a transaction or is it just the statements ...
1
vote
1answer
155 views

Multiple IPs registered for listener when using AlwaysOn AGs w/ multi-subnet clustering

We are testing AlwaysOn Availability Groups on a WSFC multi-subnet cluster and using dynamic DNS registration. Our issue is that sometimes the IP for the Availability Group Listener (AGL) in the ...
3
votes
2answers
99 views

What perfmon counters should I use to get the fastest restore possible on an idle system?

I have a development VM running Windows 2012-R2 and Sql Server 2014. I have one disk from a SAN holding the OS and SQL. My backup file is stored locally on the disk. I want to restore database as ...
2
votes
1answer
95 views

SET CONTEXT_INFO for tracking specific SQL requests

I've got a problem where I'm seeing some very strange lock waits, with the process at the top of the lock wait tree in the 'sleeping' 'AWAITING COMMAND' state. I can see the machine name and ...
0
votes
1answer
351 views

mssql restore dabase is terminating abnormally

when i'm trying to restore databse.i'm getting this error in mssql : Msg 3287, Level 16, State 1, Line 16 The file ID 1 on device ...
0
votes
0answers
22 views

What is the best Technical Advice to setup Microsoft SQL Server in an Entry Level Server with 2 SATA Disks? [on hold]

SOS!!! What is the best Technical Advice to setup Microsoft SQL Server in an Entry Level HP ML310e G8 E3-1220V3 Server with 2x500GB SATA 7.2K Disks, 16GB RAM, Intel® Xeon® ...
6
votes
2answers
5k views

What are Measures and Dimensions in Cubes

I'm very new to Microsoft Sql Server Business Intelligence and Analysis Service(but I'm programming for years with SQL Server).Can any one describe Measures and Dimensions in Cubes in Simple words(If ...
1
vote
0answers
71 views

SQL Script - SSMS Good, Job Bad

long time lurker and this is my first post. I have a SQL Server 2005 pro box running a handful of databases. I also have a few scripts I run once a week through SSMS to update data, so I thought I ...
0
votes
1answer
48 views

SQL Server: query for getting TOP X groups of records which have highest subsequent values

I'm querying each SQL Server DB CPU usage (based on query from here -- Get CPU utilization by database (Query 29) (CPU Usage by Database)) every 60 seconds and storing this information in dedicated ...
5
votes
1answer
175 views

How can we determine the SQL server version and edition from the available set up, before actually installing it?

We are going through the downgrade activity from SQL Server 2008 R2 Enterprise to Standard edition. To kick off the above activity we were looking for available standard edition of SQL server. We ...
2
votes
0answers
37 views

SQL Server 2005 Datawarehouse DB - Integrity failure caused by NonClustered indexes

Last year I've been working with a data warehouse database (SQL Server 2005) loaded on a daily basis during the nights. Overall database performance is acceptable. However, there is a "known error" ...
0
votes
1answer
39 views

Limit the number of votes

I have a table of content. Users can vote on a content row. They can vote up to three times. I'm looking for the most efficient way to make sure they don't go over three votes. I can think of two ...
0
votes
0answers
10 views

How to Extract suffix from the table column names [on hold]

I have 2 tables , 1 contains answers and columns are A1, A2, A3 so 3 in A3 means this is answer to the question 3. tblAnswers Personid A1 A2 A3 =============================== ...
2
votes
1answer
1k views

Connection to local SQL Server 2012 can be established from SSMS 2008 but not from SSMS 2012

I have two local SQL Server instances running on my local machine. The first is SQL Server 2008 R2 Enterprise Edition (named MSSQLSERVER) and the 2nd is SQL Server 2012 Business Intelligence Edition. ...