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)

2
votes
0answers
217 views

end user complaining poor performance of a query or application in SQL server [closed]

Any suggestions on what set of questions I should be asking an end user or an application user to drill down to the real issue of his complaining about slow responses to his queries? For example: ...
3
votes
2answers
217 views

SQL Server Transaction Log Initial Data Load

What is the standard process when initially populating a database with 5GB+ to avoid a large transaction log? From my understanding the log file would jump to a large size after the initial load and ...
6
votes
1answer
324 views

De-Cluster SQL Server 2012

Is there any way to 'de-cluster' an instance of SQL Server 2012 that was installed using the 'New SQL Server Cluster Installation' option? We are having issues with the failover portion of clustering ...
2
votes
2answers
377 views

Other then restarting SQL Server, is there any way to force the SQLCLR AppDomain to be reset?

I want to force the AppDomain being used by SQLCLR to be reset. How can I do that besides restarting the SQL Server instance?
5
votes
1answer
309 views

SQL Server index / performance help needed (index scan and a sort taking 40 minutes)

I finally have the logic figured out for a query, now I need to speed it up... dramatically, if possible (it runs for 40 minutes +/-). It's on two tables, one with just a couple hundred rows ...
2
votes
1answer
227 views

SQL Server 2008 log shipping via JungleDisk

Has anyone used Jungle Disk as a common location for SQL Server 2008 log shipping? We use it for backup already and I think it can be used for taking log backup to our off-site location. It seems ...
3
votes
1answer
376 views

Connecting to an SQL server instance without using square brackets to avoid backslash

In our company we have an old piece of software which was written by our previous I.T manager but was never finished. The program connects to SQL server but we want it to point to a newer SQL server ...
3
votes
1answer
116 views

What mechanisms do you use to notify third parties of future schema changes?

How do you notify third parties of future SQL Server schema changes other than through external documentation? I've started implementing a deprecation warning extended property on objects that will ...
2
votes
1answer
537 views

Rules in SQL Server 2005

The syntax for rules in SQL Server 2005 is given: CREATE RULE [ schema_name . ] rule_name AS condition_expression Whenever using rule, for example: CREATE RULE list_rule AS @list IN ('1389', ...
3
votes
1answer
340 views

How can I change the target server type for a trace template?

I've got a .tdf SQL Server Profiler trace template someone wants me to run but the template is targeting SS 2008 R2. While my SSMS is 2008 R2 the server I need to trace is SS 2005. When attempting to ...
2
votes
1answer
199 views

Incremental Database/Data Change Restore

I have vendor production backup that needs to be restored onsite daily. The most frustrating part is that their installation is on SQL 2008 but the DB mode is SQL 2000. sigh!!! The database in our ...
1
vote
2answers
292 views

Is Log Shipping or Mirroring a better solution for Disaster Recovery?

I am planning an index rebuild, however my logs are prone to huge overblown sizes. In fact I was leaning towards doing an intelligent re-indexing, but since the fragmentation levels are greater than ...
4
votes
2answers
1k views

Why should a CTE start with a semi-colon?

I was just looking at a post on SO (http://stackoverflow.com/questions/12183062/how-to-ensure-contiguity-of-a-tally-table) where Aaron Bertrand proposes using a CTE instead of a numbers table, which ...
2
votes
3answers
175 views

What SSMS and/or Visual Studio tools sync SQL Server environments?

I need to sync table structures, stored procedures, triggers, data, etc. between environments. There are dev, QA, and production environments. I am in a Microsoft-centric environment. What tools ...
2
votes
1answer
1k views

PAD_INDEX and FILLFACTOR on clustered Identity index

I am trying to work out what setting for PAD_INDEX I should use for a clustered index on a IDENTITY column, the table is rarely going to be updated after first insert so I am looking for the setting ...
4
votes
2answers
428 views

Many to Many Relationship Question

I have a database, with one main table: Project, and about 10 other tables (Entity1, Entity2, etc.) Each of the different entities can belong to one or many projects. I know I can have tables like ...
2
votes
1answer
212 views

Sql Server And Very Hot CPU % of Total Wait Time

I have recently started monitoring a production database with transactional replication. The CPU % of Total Wait time = %93.00. This is horrible. I confirmed all 8 processors are being utilized. This ...
1
vote
3answers
5k views

“lock request time out period exceeded” Error When Trying to See DB Hierarchies

I'm having problems with a database. I can run basic queries, albeit much slower than normal. When I attempt to view the hierarchy trees for tables, views, or procedures in SSMS Object Explorer, I ...
2
votes
1answer
675 views

Can't Restore DB Because of Active Connections

I have a DB I would like to restore. There are other active connections on the DB. I tried using sp_who2 to find those connections and manually kill them. Unfortunately, this did not solve the ...
2
votes
2answers
263 views

Cross Apply without a function

I would like to run a query very similar to this on one of my production databases: -- Setup the table (Already there in my real scenario) create table dbo.MyTable(MyValue int, MyGroup varchar(5)) ...
7
votes
2answers
6k views

Sql Server - Best Practices for Growing Database Files

I have been monitoring file growth via the data collector in sql server 2008 r2 for two weeks. The database is growing consistently at around 35(MB)/Day. The DB has not yet hit the initial size of 2 ...
3
votes
1answer
894 views

How do you connect to SQL Server 2008 Express when SA is disabled?

I'm trying to create a database in SQL Server 2008 Express (as installed by Visual Studio) but I don't seem to have any permissions to do so. There must be a way to do this, or there would be no point ...
1
vote
1answer
180 views

Querying multiple tables

I am working on a query from our ticketing system, and I am having problems figuring out the best way to join these tables together. I have the following tables/fields: SR_service: stores ticket ...
7
votes
1answer
156 views

Is it possible to limit the maximum disk usage for a user

Is it possible to set a limit on the amount of physical disk space a user (or group of users) can use within a single database? For example is there some method of associating a schema with a ...
0
votes
2answers
170 views

SQL Server database encoding

My database in SQL Server 2008 went into suspect mode, and I fixed it by changing to emergency mode then I used this query DBCC CHECKDB (Test, REPAIR_ALLOW_DATA_LOSS); And now my data letters in my ...
4
votes
2answers
482 views

Are there any way to stop typing 'go' in sqlcmd?

If I remember correctly, last time Microsoft Sqlcmd require each command to end with ';' and hit Enter key to execute the command. However, currently, we need to type the GO each time to execute the ...
1
vote
2answers
570 views

SQL Partioning on date, how does it work for future records?

I am setting up a new system and I would like to partition the data for speed. Basically what I would like to do is have one database with all the latest information (e.g. last 3 months). then have ...
0
votes
3answers
114 views

How to convert query results into groups of common results

I have a query that returns results like this: MyValue MyGroup _______________|_______________ 56 | I _______________|_______________ 12 | I ...
0
votes
2answers
375 views

Convert datetime to europe default without time

I have a datetime field that I need to convert into the format DDMONYY (27Aug12). I am currently using convert(nvarchar(30),DateToConvert,13), but that also spits out the time. How can I easily ...
4
votes
1answer
2k views

T-SQL: Convert XML to string without self-closing tags

We have a weirdo system we're integrating with which consumes XML, but it does not understand self-closing tags, so <BOOKING> <BOOKINGID>56812</BOOKINGID> <PERSONCODE /> ...
5
votes
2answers
421 views

Performance tuning for gap analysis of table

I have a table which stores the sequence (counter) of data received from devices out in the field. At any rate, these sequences need to be in order within a configurable time span, but can come into ...
0
votes
2answers
863 views

Secure way to connect: Windows Authentication or SQL Server Authentication and why?

Which is the best way to create a connection string for SQL Server? Should I be using a trusted connection string (windows authentication) or an untrusted connection string (sql server ...
7
votes
2answers
209 views

High rise in SQL Server CPU after adding a DB

I have just added a "new" DB to my Server (2005), I have restored from a dead SQL2000 server to my active one (2005), and changed the compatibility to 90 (SQL Server 2005). My average CPU was on 48% ...
3
votes
2answers
4k views

Why database diagrams are not working when domain account is attached to database owner?

I was trying to use Database diagrams is SQL Server and got following error: Database diagram support objects cannot be installed because this database does not have a valid owner. To continue, first ...
2
votes
1answer
216 views

Schema for 1 <-> 0..1(+), many related but only one primary

Using tools available in SQL Server 2008 and Entity Framework, what is a solid way to represent a one-to-many relationship, where there is an underlying unique relation that I need to enforce? My ...
1
vote
1answer
246 views

SQL Server 2008 R2 - Weekly / Monthly Statistics

I'm new working with SQL Server 2008 R2 Express, and I´d like to gather some statistics every week / month for users who are connecting to this server. For instance, how many times they were ...
4
votes
1answer
176 views

SQL Server Mirroring kicks in before cluster has time to fail over

I have two clusters each with two nodes configured in active/passive; the two clusters take part in a high-availability mirroring session using a separate server as the witness. When a node fails in ...
2
votes
1answer
168 views

SSMS Object Explorer Details causes deadlock while job is running

I have a problem with one of my SQL Server jobs. I've found that while the job is running, SQL Server Management Studio locks up. It always locks up while I'm looking at tables and sprocs within the ...
2
votes
1answer
1k views

SQL Server trigger (update or insert with inner join problem)

ALTER TRIGGER [dbo].[killertrigg] ON [dbo].[tbl_pvporderview] AFTER UPDATE AS IF (UPDATE([Kill])) BEGIN SET NOCOUNT ON; INSERT killer(serial,[Kill]) SELECT i.serial,i.[Kill] FROM ...
-2
votes
4answers
2k views

How can place SQL Server online on the internet?

I need some help i am working on a project and need to deploy my application which currently has a database running on SQL Server 2008 and my software is developed in VB.Net, The client needs to ...
2
votes
2answers
211 views

How can I test sql scripts intended to run with sqlcmd -v in Sql Server Management Studio

From msdn I learn, that the Variable Precedence of :Setvar X Y is higher, than that of sqlcmd -v X=Y. I want to write a script, that uses the variables supplied to sqlcmd with the -v option, but ...
1
vote
1answer
398 views

Can the default minimum date range for 'datetime' be changed in SQL Server 2008 R2?

The minimum date range is set to somewhere in the 1750's. I need to store dates prior to 1750. One solution that came to mind is to store the dates in a particular format in a 'varchar' field, and ...
5
votes
3answers
2k views

Is there a way to test whether DELETE will fail due to constraints?

I'd like to be able to predict whether a DELETE will run into a constraint violation, without actually performing the delete. What are my options for doing this? Is there a simple way to do a "dry ...
1
vote
1answer
392 views

SQL Server Query: Inefficient where clause

I have the following SQL query: select * from NETWORK n inner join vwNETWORK_KEYMSTN km on n.Network_ID = km.Network_ID inner join vwAPPROVAL_LATEST a on n.Network_ID = a.Network_ID inner join ...
1
vote
1answer
109 views

When creating asymetric key from assembly does assembly need to stay on the file system

I am deploying a SQL Server CLR project to my database and am usure of something. To give the function in the project external access I am creating an asymetric key from the projects assembly, ...
4
votes
1answer
665 views

What is a “Reporting Task for Subplan” task in SSIS, and how can I create one?

I'm trying to script a daily full backup to a job using an SSIS package. I've inherited several databases from a previous DBA, and I'm trying to emulate the ones he made in order to be consistent. ...
2
votes
2answers
205 views

Removing physical fragmentation

If I have inherited db that has grown to 400GB 1 MB chunk at at time. Is an offline defrag the only way to remove all the physical fragmentation. Another issue I have is that the data and log files ...
1
vote
2answers
314 views

Does an analysis/optimization tool like SqlYog exist for SQL Server 2005 (and later)?

I'm curious about effective space allocation of my tables, so: does something like SqlYog exist for SQL Server 2005 (and later)? Of course I know SSMS, but I was looking for something more precise ...
1
vote
0answers
443 views

SELECT value from database over ODBC wont reach the software [closed]

SQL Server 2008 R2 latest updates. SQL server ODBC driver version 6.01.7601.17514 PS!!! native drivers are incompatible with the software so i cannot use them. I cannot edit or change the server ...
4
votes
2answers
314 views

Escaping T-SQL Keywords

$sql = "SELECT Kill FROM tbl_pvporderview"; Problem is that I end up with: Incorrect syntax near the keyword 'Kill'. Because kill is a T-SQL command... any way to bypass it? I can't change the ...