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
7 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 ...
-1
votes
0answers
21 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

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
36 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
29 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
33 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. Overal database performance is acceptable. However, there is a "known error" ...
0
votes
0answers
20 views

Restoring SQL 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 PRODUCTION BACKUP.... -- SET Staging to Single User Mode to be ...
5
votes
1answer
162 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 SQL2008R2 Ent to Standard edition. To kick off the above activity we were looking for available standard edition of SQL server. We found one , but got ...
1
vote
0answers
17 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
25 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
45 views

Corrupt SQL 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
37 views

MSSQL: Query for getting TOP X groups of records which have highest subsequent values

I'm querying each MSSQL 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 table ...
0
votes
0answers
13 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
44 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
1answer
28 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
64 views

SQL Script - SSMS Good, Job Bad

long time lurker and this is my first post. I have a SQL 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 will ...
0
votes
1answer
41 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
71 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
36 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
47 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
31 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
36 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
26 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
45 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
50 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 ...
1
vote
1answer
43 views

Why is my transaction file growing when db is in simple mode and there are no waiting transactions

I noticed that my database log file has reached 160GBs. My database is in simple recovery mode and I used the following query to see if there are any waiting transactions. SELECT ...
0
votes
1answer
40 views

Multi Tenant Identity

Is there any way to declare identity partitioned by tenant id? For example I want to have this structure: tenant_id | record_id (auto increment) --------------------- 1 | 1 1 | 2 ...
2
votes
1answer
43 views

Set based query to group data ordered data

I have a table of user action data and I would like to try and group it into 'sessions', so I could figure out how many times a user has logged on, how long they stay online, and how many actions they ...
0
votes
1answer
57 views

SQL Server table and view show different values

I have a view that selects data from a table that is showing different data. The table is dbo.user, the view is dbo.users (don't judge, I inherited this system). The view is simply select * from ...
0
votes
0answers
25 views

Optimal index wasn't being used until rebuilt

SELECT COUNT(T1.RECID) FROM LEDGERJOURNALTRANS T1 WHERE PARTITION=5637144576 AND DATAAREAID='abcd' AND JOURNALNUM='abcd-00018' This query gets run numerous times when users view a ...
2
votes
1answer
28 views

SQL Server Restore w/o “Closing Existing Connections”

By default in SSMS (2012/2014) when you choose to restore a database, the "close existing connections" option located in the is by default unchecked, is it possible to restore a database while ...
0
votes
1answer
22 views

Concatenate two functions in a result

I'm trying to add this as one of my columns: REPLACE(REPLACE(REPLACE(dbo.new_truck.new_Description| CHAR(13)| '<br>')| CHAR(10)| '<br>')| '"'| 'in')+'Location: ...
3
votes
1answer
69 views

How can I monitor my server’s status before changing the “Cost threshold for parallelism” settings

Our production server is running SQL Server 2008 SP3. I’ve read a post on “cost threshold for parallelism” - ...
0
votes
2answers
42 views

SQL storage sizing - How to get statistics of what data is being accessed

How can I monitor which data is being accessed and which frequency? I'm in need to migrate several (very) small SQL Server instances, each which several small databases. Current configuration is ...
0
votes
0answers
13 views

TDS version 5 - Characters format

Someone knows what characters format type supported in TDS 5? All I found is about TDS 7 and above.
0
votes
0answers
32 views

Indexing on cached data from related table using triggers — Is there a better way?

Edit: Schema details per request from Aaron Betrand -- I'll break the schema down to the relevant fields of the two tables. Orders (ID int IDENTITY, Status char(1)) Services(OrderID FOREIGN KEY ...
1
vote
2answers
20 views

Will adding features pick up previously installed service pack updates?

We have SQL Server 2008 R2 SP3 installed. Need to add a feature to the installation, Business Intelligence Development Studio. The question is do features installed after the application of a service ...
-1
votes
0answers
34 views

How can I catch in logs SQL server failover switched to other node

Hi I want to be notified if SQL Server makes a failover and switches active nodes either if someone switched it or there is a real problem. Our monitoring tool can read windows event logs but I don't ...
0
votes
0answers
45 views

Query Performance - Why is a query slower when there are two criteria on the same column?

I have these two queries against a view, where I've added WHERE clauses against a date column (Indexed, Unique, Non-Clustered, Ascending): SELECT ColA FROM MyView a WHERE a.[Date] >= ...
1
vote
1answer
67 views

Copying SQL Server database

I am working on a SQL Server on which I have three databases: User: This is the one where real data resides Test Development: This is used for testing and developement. From time to time I want ...
1
vote
2answers
54 views

Switch from full to simple recovery

This is a theoretical question to help my understanding. What is the process to switch from full to simple recovery model in sql server? Is the process as follows: Take a trans log backup before ...
-1
votes
1answer
39 views

Restoring a backup of a database from SQL Server 2014 into SQL Server 2012 [duplicate]

Is it possible to load a backup of SQL server 2014db into SQL server 2012? Trying to import/restore is throwing backward compatibility issues. Thanks
-5
votes
0answers
30 views

Error msg 2560 after execute DBCC [on hold]

After I reindex my DB using this statement: DBCC checkdb('ABC') DBCC checkdb('ABC',repair_build) This is the error: Msg 2560, Level 16, State 9 Parameter 2 is incorrect for this DBCC ...
4
votes
1answer
56 views

How to move a fairly large tsql table from one server to another server?

I have been working on thinking of ways to move a 40gb table from one SQL Server box to another SQL Server box. They are at separate companies without an intranet linkage and obviously without linked ...
2
votes
1answer
26 views

Grant Windows logins to read a secondary database of log shipping?

The following link, Creating Users on secondary server in log shipping, shows how to create a database login on the secondary server. How to grant Windows logins on the secondary server to access the ...
0
votes
1answer
18 views

SQL User Permissions for Continuous Integration via TeamCity

We are building a TeamCity project, which would be getting some scripts from the SVN location and deploy against the production database server. This scripts will be generated by our developers, which ...
0
votes
0answers
46 views

Rounding Casted Converting Error

The database I am working with has ntext datatypes which according to my understanding is evil. I used CAST to varchar to fix the issues in the below trimmed SQL Server query. Anyway, my question is ...
0
votes
1answer
23 views

Differential Backup since a date

Hi is it possible to do a differential backup in ssms 2014, so that it gets all changes since a specified date?
0
votes
5answers
46 views

Getting Data Back after Wrong Data Restore in SQL Server

I would like to inquire if there is an possible way to return lost data that stored in a Sql server Database after making a wrong database restore? I know it is extremely hard to get a positive ...
0
votes
0answers
35 views

Hyper-V Dynamic Memory and SQL Server

I will probably get voted down for this, but does anyone have a good place to start other than the Best Practices Documentation for using Dynamic memory with SQL server. We are experiencing issues ...
1
vote
0answers
21 views

Can we configure Certificate-based Authentication to connect(logon) sql client?

Can we configure Certificate-based Authentication to connect(logon) sql client? or any other method to connect sql client using mutual authentication(sql server and sql client)?