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)

5
votes
1answer
44 views

Adding PRIMARY KEY and IDENTITY attributes to SQL Server 2008 tables

An application is using an SQL Server 2008 database that has ID columns, but these columns are not primary keys and have no IDENTITY attribute. What I need to do now is adding the PKs and IDENTITY ...
9
votes
3answers
292 views

Backup internals - What happens when a backup job is running - in terms of locking and performance overhead in SQL Server?

For MySQL I know the database is backed up table by table in SQL Statements, this results in locking and if you update columns while backing up you might end up in integrity problems. To my ...
1
vote
2answers
38 views

Looking for application which will provide to determine project database growth and cost per day or month

I am using SQL Server 2008 for product development Currently application is live with 20 users now if I want to check how my database is growing and how much it will grow in month or year projection ...
2
votes
1answer
16 views

Failure notification with multiple profiles

In my SQL Server Agent having several jobs which are running with different Proxies... and in Database mail having more than one profile [each profile having individual accounts]... now my question is ...
2
votes
0answers
26 views

OPENQUERY and server permissions

when I run my stored procedure it is a complete success, even if I run it through exec. Running these: sp_GetServerLogins GO exec ( 'sp_GetServerLogins ') GO I get this: Needless ...
2
votes
1answer
58 views

Improve performance on SQL Server Query

I'm trying to increase the performance of a query and I'm out of ideas: The query does this: gets a 'Process' with specific priorities on selection namely: Picks up a process that has been waiting ...
0
votes
1answer
28 views

Nullable Fields to Separate Table?

My website has a form page that has radio buttons yes|no corresponding to 7 questions. When the user selects yes, the user needs to specify a value (either a location, name, or medical condition, ...
0
votes
0answers
14 views

Passing DataTable using SqlBulkCopy

Should I convert the DataType of DataColumns in to pass DataTable using SqlBulkCopy? This are the fields in my sql server database
2
votes
2answers
75 views

SQL Server 2008 - combined index + other separate index on one column

Lately I've been refactoring the SQL Server indexes of the products that I have developed for my employer. One of these products is an online dashboard containing multiple user levels. Each user (on ...
1
vote
1answer
20 views

inserting the table colomn data in multiple tables colomn.(SQL SERVER) [closed]

I want to insert one table colomn data into multiple tables colomns using triggers. For Example: I have one table name 'T1' having multiple colomns like 'C1','C2','C3' and now I want to insert these ...
0
votes
0answers
70 views

Need your help in query tuning

I read ​one article which shows how to use different aggregations effectively. http://sqlblog.com/blogs/paul_white/archive/2011/12/04/is-distinct-aggregation-still-considered-harmful.aspx I am ...
1
vote
2answers
33 views

SQL Server : CRUD Editor that will track data changes [closed]

I'm looking for a tool that allows CRUD changes to SQL Server data. Our company currently utilizes a product from Pro Data called DBU (database utility) to make IBM DB2 / AS400 changes. This tool ...
6
votes
2answers
191 views

SQL Server Management studio slow connection or timeout when using Windows Authentication

I'm getting extremely long delays (10~30 seconds) in SQL Server Management Studio 2014 when attempting to connect to a SQL Server 2012 instance over TCP using Windows Authentication. This happens when ...
0
votes
0answers
43 views

Getting “invalid authorization specification” when creating linked server

I have two databases. Database A is on DBServer\Instance1 and Database B is on DBServer\Instance2. I need to create a view inside Database B that looks into a table in Database A. I was told I need to ...
6
votes
2answers
77 views

Why does a Columnstore index build often wait on SLEEP_TASK?

I'm building a Columnstore index right now. The output from sp_whoisactive: This is a dev machine. Nothing else is running. The server has 8GB of memory available to it. The CPU is nearly idle. The ...
0
votes
0answers
24 views

How to copy all database users from one database to another? - SQL Server 2008 R2

I am making a database from a backup file (I'll call this db 1) and I need to duplicate the users of one database (and this db 2) to the newly restored database. The first step I know must be done is ...
8
votes
0answers
87 views

SQL Server 2014 schema changes in 24/7 multi user environment

We have SQL Server 2014 Enterprise installed to run a database which should be available 24/7. Our database is huge enough (200gb +). Also we have a lot of services that hits our database every minute ...
1
vote
3answers
57 views

Can't connect to remote SQL server from some machines

Our web server uses SQL Server 2008 R2. I have one development machine that connects to it with the IP address through SSMS and when testing my aspx website. I have several other machines though that ...
-1
votes
0answers
31 views

Unexpected update/delete on OLTP database in SQL server 2005

We are facing one of the major issue where one of the table on a heavily used OLTP database seems to have updated the records which were not expected the way it works for past 3 years or were ...
0
votes
1answer
52 views

SQL Server : query code

I am trying to write a T-SQL query for SQL Server to pull some information from all the databases. I will then run this nightly and email the report to who it needs to go to. I have two separate ...
1
vote
0answers
26 views

Linked Server vs. Ad Hoc (OpenRowset / OpenDatasource) Distributed Queries

I have an application which needs to grab data from different clients' databases that reside at the client's location. So alongside their normal details such as company name, address etc, I also store ...
0
votes
1answer
30 views

Log debug messages in a SQL CLR C# Stored Procedure

I have developed a SQL CLR stored procedure in C#, for SQL Server 2012. I want to log messages to SQL Server registers. On a normal stored procedure I use xp_logevent What can I use to log a message ...
2
votes
1answer
23 views

Problems with sqlcmd -q and quotations marks

I have a SQL Server 2008 R2 Express edition. Because it is only an Express edition I don't have a SQL Server Agent for automation of tasks. So I tried to do something with command line program ...
0
votes
1answer
26 views

SQL Server Replication - FTP Snapshot: Policy requires SSL

SQL Server 2014 on both Publisher & Subscriber. Publisher & Subscriber are across the internet. Replication is Transactional Replication Error messages: The process could not connect to ...
0
votes
1answer
26 views

Sql Server thinks I have different Data Compression when swaping partitions

I am setting partition switching for my database. I created a script using SqlCmd variable so that the same script would make both my source and target tables for partition swapping. Here is an ...
1
vote
0answers
42 views

Preferred third party SQL Server backup tool? [closed]

Can anyone list their preferred third party SQL Server (with SQL Server 2012 support) tool? My organization is considering utilizing a third party tool to gain some speed and flexibility for our ...
2
votes
1answer
56 views

SQL Server 2008 R2 DB grows overnight and slow

I am running a SQL Server 2008 R2 SP2 DB. I have a DB that was running around 19 GB in size and three days ago grew to 34 for no good reason. We typically have about 100 MB growth in the DB every ...
1
vote
1answer
45 views

Combine multiple records into one, using name from only one record

I've got a query that returns a table of technicians and the number of work orders they've filled. The problem is that sometimes technicians get entered using their full name, and sometimes they get ...
1
vote
0answers
26 views

LinqToSql query is having intermittent problems

We have a simple, single table, LinqToSql query running against a SQL Server 2008 database. Every so often the query locks up and stops performing. Clearing the execution plans for the table is the ...
1
vote
1answer
36 views

Sql Server Database Books [closed]

I was wondering how I would go about learning the functionality of all the different store procs and functions that come out of the box with sql server. Would I be right in saying that a book on sql ...
4
votes
2answers
67 views

Rebinding a SQL Server user to its login after a restore with this user

After performing a restore of a SQL Server (v12.0.2000) database, I figured that a user needs to be remapped to its login (this issue seems to be known as orphan users). And one of the simplest way to ...
0
votes
1answer
23 views

Access 2010 ODBC Connection to SQL Server 2005

I'm trying to code an ODBC connection to SQL Server in Access 2010 and hoping someone can help me, as I've lost the plot. This is my code, it simply accesses one SQL Server database/table and insert ...
0
votes
0answers
25 views

Query Performance BIT column vs New Table

Would it be more efficient to flag 50 rows with BIT 1 / 0 in a table with 2000 rows OR create a new table to hold only 50 PK values from the previous table The query on this would just be a WHERE ...
2
votes
0answers
51 views

Why does SQL Server 2005 only use an IS lock in this scenario?

I am attempting to examine the locking behind different queries but with the same output to avoid deadlocking situations. I have the following code: SELECT MIN(ID), TextData FROM PKKEYTESTER ...
0
votes
1answer
26 views

DB_OWNER permissions for user [duplicate]

I would like to know if db_owner can change the recovery model of database. Using TSQL- alter database db set recovery simple
3
votes
2answers
41 views

Prevent logins loss when restoring a database

I'm backuping and restoring databases accross two sql server (v12.0.2000). But it looks like whenever I restore a .bak file, the login I created on the database that was backuped is no more existent ...
8
votes
3answers
183 views

Configure RAM for SQL Server and NUMA

Accidental DB admin here. Question: Would you still manually limit max RAM for SQL Server even though the sole purpose of that server is to serve SQL Server database engine only? I have Microsoft ...
1
vote
1answer
33 views

Efficient table structure for application logging

Am using SQL Server as my RDBMS and i want to maintain some transaction of an auto run tool which will log some info on a daily basis. I need some suggestions how an efficient structure to be. I mean ...
1
vote
1answer
25 views

Indexed view doesn't exist on the subscriber

I am configuring transactional replication in SQL Server. The subscription is configured as push from 2008R2 publisher (distributor is the same server) to 2012 subscriber. The object I want to ...
0
votes
1answer
43 views

SQLcmd error 'Failed to initialize sqlcmd library with error number -2147467259'

I'm trying to update some maintenance plans to make use of the Ola Hallengrens IndexOptimize, but also mail the result of the operation using sp_send_dbmail. Old T-SQL: declare @indexQuery ...
17
votes
2answers
152 views

Optimization issue with user defined function

I have a problem understanding why SQL server decides to call user defined function for every value in the table even though only one row should be fetched. The actual SQL is a lot more complex, but I ...
1
vote
0answers
31 views

Schedule data from instance to instance have I maxed out tableDiff

We have a process which uses tableDiff. From one SQL Server 2008 R2 instance to another identical instance. It has worked very well for a long time! I have a situation where one table now has ...
0
votes
0answers
29 views

Retrieving a record for the last date received and returning the value of another column in that row

I have the following query which is returning me total number of expected records : select a.New_FirstName + ' ' + a.New_LastName as 'Account Name', a.New_MPRNNumber,MAX(b.New_readdate) as 'Last SC ...
0
votes
1answer
29 views

SELECT w/ INNER JOIN Query on Optional Columns

I have five tables: File2, Branches_of_Study, Schools, Education_Establishments, and Certificates. File2 is the transaction table with all the other tables as reference tables. File2 is all about the ...
6
votes
1answer
63 views

SSDT Schema Compare fails when comparing my DB Project to my Azure Server

I have a SQL Database project that I have built our enterprise DB on. It has deployed several times on internal and AWS hosted SQL servers using SSDT's Schema Compare tool. The problem when I post ...
0
votes
1answer
13 views

Unable to delete a SQL Server 2012 publication

I've set up a transactional replication for two databases, let's call them A & B. Replication for the database A worked just fine and I was able to delete it afterwards without any issues. ...
1
vote
1answer
53 views

What connection string to use to connect to network server?

I have a database on my computer running on SQL Server Express 2014, and I'd like other computers connected to my network to be able to connect to it using a C# program I wrote. I've done the ...
7
votes
3answers
663 views

How to insert a large amount of records to the database in a short time?

I have to insert a bunch of records(500,000) to the database at once, using the fastest way. I've tried inserting 1,700 records at once but it took twenty minutes!! I am using SQL-SERVER, and C#. ...
2
votes
1answer
33 views

reading content of master database at a different server

I have a query for example select * from sys.databases select * from sys.configurations I believe this information is stored at master database. I would like to have a look at configuration ...
0
votes
3answers
54 views

Query for total downtime of site using datestamps and status columns

what want to find the total downtime for a site. I'm thinking I can subtract the 'down' DateStamp from the following 'up' DateStamp. then add the totals together for all downtime. I want to get a ...