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
2answers
299 views

Migration to databases Domain Users do not have access

I migrated databases to new servers, however the applications that were previously used with the databases are failing to load. I have changed the connections and etc. The jobs also seem to be ...
4
votes
2answers
542 views

How do I turn off ALTER DATABASE script output in VS 2012?

I am using SQL Server 2005 in conjunction with Visual Studio 2012 and a SSDT database project. When I publish my VS project and generate the script to run against my database, VS includes the ...
1
vote
0answers
100 views

Is there a way to generate an execution plan for a stored procedure before executing it?

We have a very large (many millions of rows) table that contains some (few million) rows with invalid values in particular columns. A stored procedure exists to correct the invalid records but it ...
1
vote
1answer
152 views

How to achieve this sql server replication scenario?

I want to achieve below illustrated scenario via sql server replication. Client A and Client B are client databases containing same article Table A. This article needs to be published by Client A ...
1
vote
1answer
100 views

Migration of create statement from SQL Server to MySQL

I have a table that have the following table structure CREATE TABLE [dbo].[ASAT]( [ID] [bigint] IDENTITY(1,1) NOT NULL, [ASATID] AS ('ASAT'+right('00000000000000000000' ...
3
votes
3answers
387 views

Restore of logfiles in SQL Server [closed]

I'm trying to write a script which will read a folder containing a full backup and X number of log files. My script fails when it starts the loop to read the log files. The error is cannot convert ...
0
votes
0answers
334 views

How to improve the performance for SQL Server Count(distinct()) and Sum() functions? [closed]

The below one is my query. It's taking 12 seconds for the execution process. The count(distinct()) and SUM() functions are taking long time for execution. I tried it after create the non-cluster index ...
1
vote
2answers
3k views

How to attach an .mdf file that was not properly detached?

One of our clients had a SQL Server 2000 database, on a system which is no longer running. They have no idea what was in the database. They have given me the .mdf and .ldf files, and want us to ...
1
vote
0answers
167 views

Job accessing linked server yields error 7391 [closed]

I created a stored procedure which queries data from a linked server to insert into a local table. I tested this stored procedure by directly executing it; it works fine. I have to run this stored ...
3
votes
2answers
523 views

checksum(newid()) as primary key - what happens if a collision occurs?

Inspecting a rather critical database that is used by some software on my system, I found that one of the tables had a primary key on the column Id, where Id is calculated using checksum(newid()). ...
7
votes
2answers
191 views

Is there any way to prevent the memo structure from being pruned?

We know that the memo structure is pruned and some expensive alternative plans are discarded during optimization. I was wondering if there is any way to prevent this and let the optimizer just ...
1
vote
2answers
268 views

Update my local db based on scripts executed in my server database

I need to create an solution that update my local db version based on changes that was made on my server database. First, I need to check the differences that has exists between these databases and ...
1
vote
2answers
83 views

Tracking down program from Event Viewer

The event log has hundreds of login failed errors for SQL Server. How do you find out the application generating them? There are lots of potential candidates on the server and since it's logging in ...
1
vote
2answers
2k views

Restore database created in SQL Server 2008 R2 to SQL Server 2008 R2 SP2 [closed]

I have a .bak file created by some other user in (I think) SQL Server 2008 R2 (10.50) and I need to restore it in SQL Server R2 SP2 (10.52). I used a hex viewer to look into the .bak file and found ...
1
vote
1answer
587 views

PowerPivot doesn't install in SharePoint mode on an Active/Passive Cluster

We a provisioning a new SQL Failover Cluster. We have successfully configured the SQL instance, and have moved on to configuration of the PowerPivot for SharePoint instance. We run the configuration ...
5
votes
1answer
6k views

Start service error code 3417 with SQL Server 2012

I cannot start the SQL Server 2012 service. The event log says the service-specific error code is 3417. In the Event Viewer: The SQL Server (MSSQLSERVER) service terminated with the following ...
3
votes
1answer
48 views

SP with Encryption Read/Writes Stats

If a stored procedure in SQL Server 2005 is created with the syntax "WITH ENCRYPTION" ,are the reads and writes of the encrypted stored procedure recorded in the sys.dm_db_index_usage_stats? I am ...
0
votes
1answer
328 views

SQL Server TDE - add master key and certificate [closed]

I want to add multiple master database encryption keys and certificates. Can I do that?
4
votes
2answers
2k views

One filegroup, multiple datafiles, how to get list of tables in each file

In one of my production databases, I have a filegroup with 3 data files sitting on 3 different disks. There are over 50 tables on this filegroup. How do I identify the location of each of the 50 ...
3
votes
0answers
151 views

custom population of full text index

Is there any way to populate a full text search index without storing the backing information in the database? I don't mean using remote-blob-storage or FILESTREAM types. The backing information is a ...
3
votes
2answers
406 views

Server permissions of an activation stored procedure of a Server Broker queue

I have a stored procedure that queries the sys.dm_exec_requests view. In the stored procedure the view only returns one row, while the stored procedure needs to see all of them. The MSDN article on ...
-1
votes
1answer
445 views

Why does fn_my_permissions return empty rowset? [closed]

If I run this query: select * From fn_my_permissions(NULL, 'SERVER') This is what I'm getting: entity_name subentity_name permission_name ------------- --------------- ...
3
votes
2answers
812 views

Is this a good strategy for importing a large amount of data and decomposing as an ETL?

I have a set of five tables (a highly decomposed schema for an ETL if I understand the nomenclature) that I'm going to load via bulk import, then run some inserts from those five tables into a SLEW of ...
4
votes
1answer
206 views

Is it “legal” to CREATE and DROP #SomeTable more than once?

I've got my code sort of segregated as "coherent blocks" that I can insert into a longer "configuration script" over and over, and one of the patterns I'm using is this: CREATE TABLE #WidgetSetting ...
7
votes
3answers
1k views

Dropping Hypothetical Indexes

In the past I thought I'd deleted hypothetical indexes using either a DROP INDEX statement for clustered indexes and DROP STATISTICS statement for non-clustered indexes. I have a database that is ...
4
votes
1answer
4k views

Convert SQL Server 2012 SSIS package to 2008

I've created a few SSIS packages in SQL Server 2012 that I need to run on SQL Server 2008. I've been told that it is impossible in their current state. Is there a way to convert the 2012 packages to ...
1
vote
2answers
274 views

Replicating schema changes between production and development databases [duplicate]

Not too sure if this would be a good and proper way to go about things, so I apologize if I'm kind of far off. Currently running Microsoft SQL Server 2005, and in this we have a database for a ...
5
votes
6answers
1k views

Backup very large table

I have to update certain values of a large table (for the sake of a presumed example, it is called 'Resource' and it is over 5M rows) and thus I have to make a backup before performing the changes. We ...
2
votes
0answers
45 views

Backup very large table in SQL Server [duplicate]

everyone. I'm deeply sorry if this is an amateurish question, but I have to update certain values of a large table (for the sake of a presumed example, it is called 'Resource' and it is over 5M rows) ...
2
votes
0answers
725 views

Failover only working for Classic ASP, not ASP.net [closed]

Setup: All machines run Windows Server 2008 Enterprise SQL Server 2012 Standard (Primary) SQL Server 2012 Standard (Mirror) SQL Server 2012 Express (Witness) Root issue: Our ASP.NET application is ...
-1
votes
1answer
207 views

Query returns no data [closed]

I am running a query to show LastName and Hire_Date and my results display the columns but do not include any data. This is an assignment for an online class and I have been waiting for my instructor ...
1
vote
2answers
1k views

SQL Server Memory Clerk Description

Trying to understand different memory clerks reported by sys.dm_os_memory_clerk however, not able to find description of the each individual memory clerk either on web (google and binged) or in SQL ...
-2
votes
1answer
134 views

Use second hard disk for database if first one is full

I installed Standard Edition on a server with a 500 GB drive. Now the system is giving me error message of disk space is not available, so I added a new hard disk. How can I tell SQL Server to start ...
2
votes
1answer
64 views

Display query which SSMS executes from Interface/WYSIWYG edits

If I am to add a new column to a table in SQL Server Management Studio 2008 via the interface/WYSIWYG (as opposed to writing a SQL query) this will, behind the scenes, create a SQL query which it will ...
4
votes
2answers
438 views

Should I use a composite or single-column index?

I have the following columns in my database table (Medicines). ID bigint, MedicineName nvarchar(50), BrandName nvarchar(50), MedicineCode nvarchar(20), and price,quantity. I am making a stored ...
0
votes
1answer
915 views

VarChar to NVarChar causing truncate error

I am importing some data from a temporary table which has a column defined as VARCHAR(150). The destination tables column is defined as NVARCHAR(200). I'm using an INSERT INTO statement, but when I ...
2
votes
0answers
86 views

ODBC - how to set up ODBC driver for 2 languages (for different code page)

How to set up an ODBC driver to operate the Polish code page (1250) and Lithuania (1257) at the same time? Although the code page Lithuanian is wider than the Polish code page, the driver incorrectly ...
2
votes
1answer
60 views

Use users / logins from another database

Is it possible to use logins/users from one database(F) in another(S) one? I know I can copy it but, when I add user to (F) database I have to copy again them all (or add the same user to (S) ...
2
votes
1answer
2k views

Attaching a database in SSMS gives error

I am accessing SQL Server using SSMS, and a user with adequate permissions. When this user tries to attach a database by using SSMS (by right clicking on database node and then clicking on attach), ...
3
votes
2answers
242 views

Is there a standard way to use common data and procedures across multiple databases?

We have several independent databases that have data and code in common, not in the sense that it is accessed between the databases but in the sense that the data means the same thing in each ...
13
votes
4answers
10k views

Index Seek vs Index Scan

Looking at an execution plan of a slow running query and I noticed that some of the nodes are index seek and some of them are index scan. What is the difference between and index seek and an index ...
0
votes
3answers
2k views

SQL agent job step's connection managers

Is there any way with T-SQL to list the connection managers that are used in an SQL Agent Job step?
1
vote
2answers
5k views

Database running out of space

My database has 16MB of space left. I used to just truncate as I was taught but I found these links that advise against truncating: ...
1
vote
2answers
2k views

How do you create a composite foreign key when key being referenced is also a foreign key

If you have table a (column x) which is 1 to many with table b (columns x, y) which is 1 to many with table c (columns y, z), it's pretty straight forward to define the foreign keys. If for ...
6
votes
3answers
273 views

Should we periodically 'refresh' the mirrored copy of a SQL Server database?

When you have SQL Server mirroring set up, do you trust that your mirror database will stay the same as the primary, even after months and months of mirroring?  I know we all check the status, ...
1
vote
3answers
604 views

How to create new users for restored databases?

I am not too familiar with SQL Server and am facing the following problem: The server was freshly installed and the only existing login is sa. Then a couple of databases were restored from earlier ...
7
votes
0answers
51 views

Is Logical Fragmentation Meaningful in the age of huge SANs? [duplicate]

So, every time I read that a data file shrink will cause fragmentation or a developer rave on that the 95% frag he sees is the cause of all life's misery, I wonder what the problem really is. We no ...
4
votes
1answer
143 views

Clear schema from database without dropping it

I'm working on a school project where I have a SQL Server with a database for my team. I already imported a local database created with Entity Framework. Now the model has changed, table properties ...
0
votes
1answer
1k views

Database management tool for compact edition (.sdf) database

What is the best database management tool for remotely managing a compact edition (.sdf) database created in WebMatrix?
2
votes
2answers
1k views

Change drive letter (which contains system dbs)

Is it possible to safely change the drive letter for a volume which holds only system databases? What precautions should be taken and how should it be done? I know I can just go to computer ...