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
3k views

pivot a table with cell name as column name

I have a table structure is : year | code | name| value | wef | 2014 | a001 | abe | 2000 | 2014-04-01 | 2014 | a001 | def | 3000 | 2014-05-01 | 2014 | a002 | abe | 2000 | 2014-06-01 | ...
-1
votes
1answer
163 views

Backup and Restore Database Method

I have a production database. I am using FULL recovery model. I am taking regular FULL backup every week. I am planning to take LOG backup every day. Now, if my database crashes or failed to load due ...
3
votes
3answers
9k views

A transport-level error has occurred when sending the request to the server

In our Vb.net application(userd within a local network connection inside a office), which is used from long time now some of the users get the errors only sometimes a day A transport-level error ...
3
votes
1answer
3k views

SQL Server PerfMon: Compilations/sec > Batch Requests/sec

I've been looking at various PerfMon metrics on one of our client's SQL Server instances trying to get a good gauge of where our database (or server) could use improvements. One measure that has me ...
0
votes
1answer
59 views

SQL Server Alerts on VMs

Newbie here.. Hello Searching online and I could not find any articles/blogs that pointed, related or had any opinions regarding SQL Server and SQL Server Alerts installed/running on virtual ...
2
votes
2answers
195 views

Backup and Restore of Development

I am wondering if anyone can provide information on taking a differential backup and then restoring that differential backup to another SQL Server database? I have a production environment that is ...
1
vote
0answers
17 views

How to enable Parallel Data WareHouse? [duplicate]

How do I enable Parallel Data Warehouse on my Microsoft SQL Server. I am trying to run this SQL statement below and received this error. ERROR: Msg 11305, Level 15, State 10, Line 2 The Parallel ...
4
votes
3answers
2k views

Looping through values stripping 1 character at a time

I want to loop through values and strip 1 character at a time from the values and display the result. So if I have a table with values: ID ___ 34679 13390 89906 I want the result to look like this ...
0
votes
2answers
755 views

Mirroring between two Ms-sql servers for Migrating server from one Datacenter to other Datacenter

I have a query about microsoft sql server. I'm looking for migrating ms sql server from one vendor to another vendor(Datacenter). I'm looking to have a mirror configuration between servers since my ...
1
vote
1answer
88 views

Is there a common approach to encrypting data at the database level?

Is there a common approach to encrypting data at the database level? The application I am working on will be storing sensitive data that only users of the system themselves will be able to view.
1
vote
1answer
297 views

Retrieve next queue item

I have a simple table in SQL Server 2012 which implements a processing queue. As data has been inserted the query to retrieve the next item has gone from <100ms to a constant 5-6secs. I would be ...
1
vote
2answers
570 views

Restoring database from a server that uses data compression

In our environment our production server is using MS SQL Server 2008 Enterprise Edition. We have a development and test server that runs MS SQL Server Standard Edition and the table structure between ...
-1
votes
1answer
166 views

Stack overflow when parsing a lengthy query

I have a lengthy T-SQL Script. When SQL Server attempts to parse the script, it raises this error: Msg 565, Level 18, State 1, Line 106620 A stack overflow occurred in the server while compiling the ...
7
votes
3answers
603 views

Restricting users to COPY ONLY backups

I am looking to deploy log shipping in my production environment. This will mean I will have to manage backup chains which could be disrupted by people taking backups to refresh development ...
1
vote
4answers
105 views

Profling for Index Maintenance

I am wanting to perform some index maintenance, in particular we have a poor performing query against a particular table. Is it a sensible strategy to profile on RPC:Completed, SP:StmtCompleted and ...
5
votes
1answer
237 views

SQL logs showing login that I can't find

Within my SQL server logs, I am showing a successful login to a database from an account (SERVER\loginname) that I cannot find in either Security > Logins OR Database > Security > Users. This ...
1
vote
1answer
66 views

SQL server replication - Does not ask for the snapshot folder

SQL SERVER 2008 When I created a publisher for the first time, it asked for the snapshot folder path. I deleted that replication and tried to recreate the publisher. This time it doesn't even ask for ...
1
vote
0answers
53 views

Index Maintenance

I have a query thats performing badly and has a RID lookup. There are already quite a few indexes on the table and in the query stats I can see they are used although some less than others and all ...
7
votes
2answers
276 views

Using wildcards in a like statement on an unindexed VARCHAR(MAX) column with more than 1 million records

In order to troubleshoot a problem, I have a one-time question as to whether a specific varchar(max) field contains non-printing ASCII characters (other than white-space). The following is my ...
1
vote
0answers
32 views

Any instance where DMV can cause blocking? [duplicate]

So we had some slow performance with timeouts this morning. When looking for the cause, our blocking query (uses DMVs) showed up as the blocking query. I think this was just a fluke but the job we ...
0
votes
1answer
41 views

Looking for good, but quick references for underlying OS concepts related to SQLOS (Memory Access, Scheduling, etc…)? [closed]

Looking for good, but quick references for underlying OS concepts related to SQLOS (Memory Access, Scheduling, etc...)? I am researching SQLOS and how threads and scheduling are handled, but I would ...
4
votes
1answer
3k views

AlwaysOn Availability Group Automatic Failover does not work

Playing with AG setup I have the WSFC up and configured with two nodes in one availability group called DevClusterOnline. Both nodes (DEV-AWEB5 primary, DEV-AWEB6 secondary) are running Windows Server ...
5
votes
2answers
144 views

Is it somehow possible to predict / foresee when SQL Server will trigger auto-growth?

I found numerous questions / answers about SQL-Server auto-growth - almost all indicating that one should try to avoid auto-growth if possible. However auto-growth is available with MS SQL Server and ...
3
votes
2answers
242 views

How can I eliminate this costly index seek operation from my query?

I have two tables in Sql Server 2008 that look something like this: Transaction_Details: Dataset, Department, Charge_ID, Transaction_Type, dos_month, post_month, amount ...
2
votes
1answer
241 views

Security Question

Hello guys I have a question I have a group in that group a user shouldn't have syadmin permissions but he must be on that group. He has his login map by the group and his windows login on sql ...
0
votes
1answer
166 views

SQL Server monthly Backup

I'm quite new to SQL Server and some employee asked me if is possible to make monthly database backups. We do daily full backups to NAS server via Cobian and we use SQL Server Management Studio to ...
6
votes
2answers
341 views

How to “hack-drop” a database snapshot after SQL Server upgrade has botched it

I'm dealing with an issue where database snapshots cannot be dropped after SQL Server has been upgraded to 2014. The snapshots are defunct but cannot be dropped. Now although the Connect item has a ...
1
vote
2answers
253 views

Is outputting to both a result set and a temporary table possible?

I have a stored procedure that I need to both output the result set to the user and use a piece of information in the result set to possibly output other result sets. Here is a basic schema of what I ...
1
vote
2answers
426 views

How can I change the data source of a linked report?

I'm in a situation where multiple "customers" will be running the same report, but against a different database (with the exact same structure). What I've done so far is created a generic "Deploy" ...
3
votes
0answers
3k views

SQL Server Projects in Visual Studio 2013 [closed]

I am looking for information regarding Visual Studio 2013 and working with SQL Server projects. We are currently working on a project where we are using a database that already exists and is used by ...
0
votes
1answer
6k views

Sql Server Backup Job failed

I have a sql agent job setup for taking full backup every night. Last night the job failed with the following error message. Sql Server Error Log Message BackupIoRequest::ReportIoError: write ...
1
vote
1answer
219 views

SQL Server agent job scripts

Being a newbie to database migration, can I script all the database jobs one by one and run them against a new server to create these jobs? If not, why do we use these SQL job scripts? Thanks in ...
5
votes
2answers
186 views

'+' operator with one operand!

How does '+' operator behave in following statement? select + 'taco'; --Result is 'taco' Is it doing string concatenation with first string blank ('' + 'taco'), or does it mean something else?
2
votes
1answer
1k views

Difference between worker threads and sessions in SQL Server

I'm looking at Azure Premium/P3 database offering under "Overview of the Performance Model" on http://msdn.microsoft.com/en-US/library/azure/dn741336.aspx What's the difference between worker threads ...
2
votes
2answers
544 views

How to improve row estimate of 1 row in join for newly inserted data

A custom statistic exists for the CacheId column of a table. After an overnight statistics update: Statistics for INDEX 'ST_TableName_CacheId'. ...
0
votes
1answer
7k views

Declaring a scalar variable that its a table valued parameter?

I get error 137 that I must declare a scalar variable (@facilities), although I'm declaring it in the Create stored procedure as a readonly variable, so I wasn't sure what I'm missing here. any advice ...
3
votes
1answer
382 views

Why can't I script out CLR assemblies with SMO in Powershell?

I am creating a Powershell script to read all objects in a source database, script them and then re-create them in an empty destination DB (may be across different SQL Server versions). For the most ...
5
votes
1answer
220 views

How to disable or delete an index

I created a non-clustered index on a live server (SQL Server 2008 R2) and it turned out not to give the performance benefits that I was hoping for. So I want to delete the index again. Unfortunately ...
3
votes
2answers
229 views

How to terminate BCP output with specific string AND newline?

I'm trying to terminate each row in BCP output with a specific string along with newline. Neither of these work: -r"terminator_string\n"'; -r"terminator_string"+\n'; Any suggestions? For an idea ...
3
votes
1answer
233 views

List of Expired Merge Subscribers

I have a setup of merge replication. Sometimes, subscribers will not be able to sync within the retention period set in the publication. How can I get a list of expired subscribers to a merge ...
4
votes
2answers
162 views

SQL Server SSL connection

Is it possible if I wanted to set up SQL Server 2008 R2 instance so that it only accepts SSL Connection? I am getting different answers and based on my testing, it will accept non-SSL connection even ...
0
votes
1answer
65 views

Which one is correct and optimized in sql?

Imagine that I have three entities (EntityA, EntityB, EntityC) that can have some images. So there are two ways: Make an image table for each entity. It means that EntityA has a image table named ...
1
vote
0answers
576 views

Best practice - SQL Schema to store Timerecords for a Time and Attendance module

I'm starting a time and attendance module in C# and SQL. There will be many time rules depending on every shift. For example: Shift 7:00 - 14:00 for Administratives: 15 min grace time, but if ...
1
vote
0answers
471 views

AlwaysOn Availability Group: Users on Secondary Server

We have an AlwaysOn Availability Group setup (DB1+DB2) and also a web server (Web1) outside of the domain that we need to connect to the AG using Windows Authentication. The following Windows ...
0
votes
2answers
342 views

Need help phrasing regular expression to find particular T-SQL pattern

I know this is a Database Forum, but since the text I am trying to find is SQL-specific, I am hoping that somebody can point me in the right direction. I need to search code to find places where the ...
3
votes
1answer
89 views

Table A triggers an insert onto Table B, Table B triggers an insert onto Table A, what happens?

Assume I have two tables, table A and table B. Table A has an insert trigger that inserts a record into Table B. Table B has an insert trigger that inserts a record into Table A. What would happen in ...
0
votes
1answer
3k views

How to set variables to multiple values (that are integers)?

I have 5 facilities in my division, but the code below in a stored procedure only pulls documents when the "facilityID = 4" unless if I change it manually to represent other ID numbers. So I need the ...
8
votes
2answers
2k views

Are cross-database queries expensive in SQL Server?

Are cross-database queries expensive in SQL Server? All of the databases are in the same instance.
1
vote
2answers
364 views

Generic script for stored procedure rollback

We're trying to switch to feature-driven development in my organization. We're planning on using a new branch on our source control for each feature and merge when development is complete. I think it ...
1
vote
1answer
334 views

Min no. of replicas to set up SQL Server Always ON over a Failover Cluster on a Windows Cluster

AO: Always ON FCI: Failover Cluster Instance WSFC: Windows Server Failover Cluster I'm scratching the surface of AO. I currently have one SQL 2012 FCI on a WSFC. Which means one Active node at a ...