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 ...
-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 ...
-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 ...
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 /****** ...
-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 ...
-1
votes
1answer
20 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 ...
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 ...
-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 = ...
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 ...
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 ...
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. ...
-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] ...
-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
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 = ...
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 ...
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, ...
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 ...
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 ...
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® ...
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 =============================== ...
0
votes
0answers
10 views

Distributed Replay DCOM issue

I have 2 SQL Servers in a Domain. Windows Firewall is disabled on both servers and there is no hardware firewall. Both servers are in the same subnet. One server, called Controller is configured as a ...
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
48 views

sp_WhoIsActive is not displaying results

I'm trying to use the sp_WhoIsActive stored procedure that I've downloaded from here: http://sqlblog.com/files/folders/release/tags/who+is+active/default.aspx I'm running the procedure without ...
2
votes
1answer
37 views

Can't seem to understand why STUFF isn't working

I've got two tables that store questions and possible answers. The questions table can have multiple possible answers to it. I want to display the possible answers it can have per question.. For ...
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
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 ...
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 ...
1
vote
0answers
23 views

Best practices to segment people and attributes for advertising database

we have a database where we store people some attributes per person in the following tables: people (id, name, email, phone) people_attributes (id, person_id, attribute_name, attribute_value) ...
1
vote
1answer
28 views

How to define the logical name in a backup ? ( Sql Server 2008 )

I saw : This question but it didnt help me. In a simple way, Is there a way to do : Backup database SomeDatabase to disk ='c:\teste\SomeDatabase.bkp' configuring the Logical Name? Because we ...
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 ...
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 ...
0
votes
0answers
15 views

Composite primary key in Multi-tenant sql server database

I'm building a multi-tenant app (Single database, single schema) using Asp Web Api, Entity Framework and Sql Server/Azure database. This app will be used by 1000-5000 customers. All the table will ...
0
votes
0answers
46 views

Why are transactions long running?

My stored procedure has a transaction blog. I pick up a record from a database and process it in that transaction block. I noticed that my transaction log has grown in gigabytes. But my transaction ...
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
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
44 views

DB Permission: User can drop only their created db's?

I want to set permission against a user, which can create database and drop on their created databases neither any database. Any idea/suggestion ?
0
votes
2answers
77 views

How can I replace the following query with ISNULL function in SQL?

I have the following query. For performance optimization reasons I have been asked to replace the logic with ISNULL function in SQL. How can I achieve this? please advice. SELECT ...
0
votes
1answer
54 views

Enhanced ER Model Supertype / Subtype modeling issue with inheritance and recursion

Before posting, I have looked for a good solution on internet and I have coined this post for 3 days in row and trying to think through it prior this post. So if I have missed something or got it ...
0
votes
0answers
50 views

How can I replace the cursor in the below query?

I have this below query which calls a stored procedure that takes only 1 item's attributes at a time. But because of performance problems we are required to remove the cursor. How can I replace the ...
1
vote
1answer
32 views

In SQLCMD is there any way of shelling out to run arbitrary programs?

In the past I have dropped json into a table in a nvarchar(Max) column. This is structured data but it needed serving back to the client as json and came in from the client as json so it seemed a bit ...
0
votes
1answer
39 views

SQL Server 2008 R2 service packs

Are the SQL Server service packs 'cumulative' or 'incremental'? The scenario is that we have a couple of instances running on SQL Server 2008 R2 RTM and we have been asked to patch it up to SP3 ...
0
votes
1answer
29 views

SQL Server : how can I measure database performance increase after index maintenance?

We are using a SQL Server 2005 database. We currently have no maintenance on our databases indexes. Some of our indexes are showing over 85% fragmentation when looking at the table ...
-2
votes
2answers
46 views

Databases Fundamentals [on hold]

I have tried to learn about SQl Server databases but most tutorials are general or SQL-focused. I'd like to have a solid understanding of the fundamentals of databases so I can build successful web ...
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 ...