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
1answer
515 views

Checkdb giving error for master database

When i run dbcc checkdb on master database i get error like Msg 5030, Level 16, State 12, Line 1 The database could not be exclusively locked to perform the operation. Msg 7926, Level 16, State 1, ...
4
votes
1answer
206 views

Memory Utilization

I faced a strange memory issue. Buffer cache hit ratio was at 100%, Lazy writer/sec was at 0 Available Physical memory 112 GB Max memory set 112 GB out of which I could see 85 GB being used from ...
5
votes
3answers
395 views

How do I find all tables in a DB that have no explicit primary key?

A Google search spewed forth millions of hits on how to find tables without clustered indexed, the PK normally being the clustered index of a table. However, a table could easily have a natural key as ...
2
votes
1answer
2k views

Which user does Windows Authentication of a maintenance plan authenticate? before whom, why and for what?

I am having a maintenance plan configured with Windows Authentication being run by an SQL Server Agent job with owner sa Whom does Windows Authentication of a maintenance plan authenticate, ...
2
votes
1answer
370 views

SQL Server Linked Server error and Query Problem

I am having two servers running SQL2000 and SQL2005. There is a database A,B in SQL2000. Similarly i have the same in A,B in SQL2005. A,B are name of the database. I have a linked server pointing ...
2
votes
1answer
300 views

Should I run a delete first before I execute index rebuild to a large table about 15 Million records

I need help for a better approach on how to approach this. Currently we have a table that is huge about 15 million records. We plan to create an index on this table however due to large size, we ...
0
votes
0answers
1k views

SQL Server 2012 - The application has failed to start because its side-biy-side configuration is incorrect

When opening Sql Server Management Studio I'm getting the following error message: Then when I have a look at the Event Viewer the following message is displayed related to this: Activation ...
1
vote
2answers
611 views

How to give the least permissions for CRUD-managing and running SQLServerAgent jobs as well as Maintenance Plans?

Follow up to my question "What's the owner of SqlServerAgent job for?" Basically, I am trying to understand how to create a user-login with least privileges for CRUD-maintaining SQLServerAgent jobs ...
0
votes
0answers
484 views

Snapshot transaction throws random conflict. Should I choose something else? [closed]

I've got a problem with my transaction. Currently it runs in IsolationLevel.Snapshot. The action it does, can take some time depending on the amount of data, it has to import. What it does: Create ...
1
vote
2answers
872 views

What's the owner of SqlServerAgent job for?

What is the possible use of owner of an SQL Server Agent job, I wonder? Removed, and left it blank and the job still succeeds
2
votes
1answer
180 views

SQL Server 2005 and Standalone VB application

I'm new to this forum and just want to ask some questions/suggestions on how to manage my database.. I'm having an application with sql server 2005 database as a backend. I want make the ...
10
votes
3answers
613 views

Optimizing a CTE hierarchy

Update below I have a table of accounts with a typical acct/parent account architecture to represent a hierarchy of accounts (SQL Server 2012). I created a VIEW using a CTE to hash out the hierarchy, ...
1
vote
0answers
263 views

I can not seem to turn this while loop in a recursive cte

There is a very frustrating side after 2 days ... but hey, I submit myself and I ask: o (   I Can not Seem To turn this while loop in recursive CTE ... If someone could help me please. I would like ...
0
votes
0answers
553 views

SQL Server Agent - Will Job Run on Specific Future Date?

I have a number of SQL Server Agent jobs will different types of schedules (Daily, Weekly, Monthly). Each of these jobs will represent an event. For example there will be an FTP job that will ...
1
vote
0answers
46 views

Running SSIS on SQL Server without SSIS installed [duplicate]

This is a follow-up to this question: Running an SSIS package without the SSIS service installed I have build an SSIS package on my local machine but when deploying to a server, I get the following ...
2
votes
1answer
1k views

Script all tables in a database

In SQL Server 2008 - is there any script available which will list all tables (incl column names, data type, length) for the entire database - with one script.
9
votes
1answer
419 views

Poor query performance

We have a large (10,000+ lines) procedure that typically runs in 0.5-6.0 seconds depending on how much data it has to work with. Over the past month or so it has started taking 30+ seconds after we do ...
1
vote
1answer
6k views

Does “use AWE to allocate memory” do anything on a SQL Server 2008 R2 64bit Windows 2003 system?

After checking the box I noticed that queries that would timeout after 30 seconds would complete execution. The TechNet article says "AWE is not required and cannot be configured on 64-bit ...
2
votes
2answers
470 views

Find which permissions are being used for a given user on a object

Is there any way in which I can see what permissions are being used to determine a users access to a given object? I'm able to see which permissions have been granted to various roles and users within ...
0
votes
1answer
194 views

How to create a trigger that update the date and time field and modify of the row

I want to create trigger that will update the record. The situation is like: I have one column named CheckInDateTime and one more named Status. If the administrator is not able to update the Status ...
3
votes
3answers
349 views

Is it possible to setup failover clustering between a 32 bit instance and a 64 bit instance?

I am attempting to setup a couple of virtual machines in my lab for testing failover clustering on SQL Server 2008 and Windows Server 2008. One of the hosts I have is not capable of running a 64 bit ...
0
votes
0answers
285 views

Speed of one big insert vs multiple small inserts on SQL Server

I have a write-heavy application in which my initial testing has shown that one large insert into a table with four "large" columns is significantly faster than four inserts (in a single transaction) ...
1
vote
1answer
3k views

Any way to import-export-migrate-save-restore a maintenance plan without having SSIS installed (and running)? [duplicate]

I am having dozens of MSSQL Servers 2012 R2 on Windows Server 2008 R2 with similar setup, configuration (in virtual machines) in production. Neither has SSIS installed. I have to similarly maintain ...
0
votes
1answer
1k views

Linked Server Between SQL Server and iSeries is rounding decimals

We just set up a new SQL Server 2008 database, and I got the link set up between our server and an iSeries As400 server that we get some of our data from. The problem I'm having is that it is ...
3
votes
1answer
2k views

How Do I Troubleshoot Login Failed Errors In SQL Server?

What are some tips for troubleshooting SQL Server login errors? Questions like: How Do I see the full Error Message? My client just has a generic error message that says logon failed with no real ...
3
votes
2answers
121 views

How do I create a table with a column that uses a sequence?

I have the following CREATE TABLE [MyTable] ( [ID] [bigint] PRIMARY KEY NOT NULL, [Title] [nvarchar](64) NOT NULL ) CREATE SEQUENCE MyTableID START WITH 1 INCREMENT BY 1 NO CACHE ...
-2
votes
1answer
49 views

Getting user input [closed]

I try to get user input but I get an error and I'm not sure what to do,as I'm new into databases and according to w3schools this is the way to do it. vers = getRequestString("Give the version you ...
1
vote
1answer
356 views

Database failover/failback history

I am a SQL DBA newbie, and I am trying to get the failover/failback history for one of our mirrored servers. I am able to get the the failover history from event viewer but do not know how to the get ...
1
vote
0answers
157 views

Why use asymmetric keys in SQL Server?

I've been reading multiple resources on SQL Server Encryption, and everyone does it basically the same way, but no one explains why we use asymmetric keys in SQL Server. And by this I mean when we ...
0
votes
1answer
321 views

DbUp and script directory

I'm using DbUp, starting from the example I've created a C# program. The example suggest me to put all scripts under Scripts directory. Ok, this is done but, when script number will grow up that ...
2
votes
0answers
105 views

SQL Server is not started

I created the local service. My server name is like sqlitesync.com. In my database folder created the configuration (web.config) and WCF web service (AuroraSyncService.svc). When I test this service ...
3
votes
2answers
168 views

if database is not shrinked does it affect backup size?

Ok my question is simple. Lets say that when i click database and hover over shrink it says it can be reduced 1 GB space. Now when i do a backup of this database, does this space also getting added ...
-7
votes
1answer
128 views

What is the structure that SQL Server uses to build and maintain indexes called?

What is the structure that SQL Server uses to build and maintain indexes called?
1
vote
1answer
121 views

Extracting text from a column

I want to import data from Excel into an existing table in a SQL Server database. I have a column like Gender and the values are Male and Female in Excel. I want to insert only the first character ...
-3
votes
2answers
254 views

ROW_NUMBER() not working when adding DISTINCT [closed]

DEMO SELECT DISTINCT P_Master.P_Name,ROW_NUMBER() OVER (ORDER BY Visit_Date DESC,P_Master.P_Name ASC) AS RowNumber, (SELECT MAX(Visit_Date) FROM P_Visit v WHERE v.PID = p_Master.PID) as ...
0
votes
1answer
7k views

Cannot find either column “dbo” or the user-defined function or aggregate “dbo.fnDiscountPrice”, or the name is ambiguous

i have created fnDiscountPrice() that references the item id so that it will find the discount price for one item now I'm needing to find the total price of all the products with that ID. so i have a ...
4
votes
2answers
4k views

SQL join query to show rows with non-existent rows in one table

I am trying to get some reporting done for employee time records. We have two tables specifically for this question. Employees are listed in the Members table and each day they enter time entries of ...
1
vote
4answers
17k views

Backup and restore database - occured system error 5

In my work I made backup of database and I receive file .bak. Now I would like restore this database in my machine. But I get the following error: Cannot open backup device 'C:\Program ...
1
vote
1answer
3k views

Unexpected EOF during bulk insert

USE [campaigns] DECLARE @FILENAME varchar(400) = 'W:\PlayerListing\List.txt' ,@EMAIL_SOURCE varchar(50) = 'listing' ,@SQLCMD varchar(8000) PRINT (CAST(GETDATE() AS varchar(30)) + ' BULK ...
1
vote
0answers
54 views

'sa' Password Managment [closed]

I have been asked about my ideas regarding how often to change sa passwords and how best to manage this process. Users who are sa by right of user role are managed by the general password policy of ...
1
vote
0answers
222 views

SQL Error 3183 On SQL Server 2012

I have a backup of database version sql server 2008 R2 . while restoring it to SQL Server 2012 I am getting error msg 3183 RESTORE detected an error on page (6100:1886858449) in database ... . ...
2
votes
0answers
115 views

plan_generation_num keeps incrementing, why?

I have a query that is executed using sp_executesql code is as follows DECLARE @rsk NVARCHAR(1) = '1', @ppCityID NVARCHAR(3); SET @ppCityID = CAST(@cityID AS NVARCHAR(3)); exec sp_executesql ...
3
votes
1answer
1k views

Creating a read only replica of SQL Server database for reports

I've faced a problem when my .Net web application is running slow, even when I've optimized all queries. As it turned out another developer, who is making reports runs a bunch of non optimized queries ...
2
votes
3answers
14k views

Is there a way to generate table create script in TSQL?

Is there a way to generate a create script from an existing table purely in T-SQL (that is without using SMO, since T-SQL does not have access to SMO). Let's say a stored procedure that receives a ...
2
votes
1answer
65 views

Can SQL Server WebAdmin degrade the performance of my site?

Once upon a time a had to use the Parallels WebAdmin interface. After contacting the support team that hosts my website and informing them that I must use the Webadmin, they informed me that: MS ...
1
vote
1answer
13k views

How to extract the last inserted row in SQL Server?

When an insert statement is executed one or more rows is inserted into the table, is there any way to extract the last inserted row in SQL Server?
4
votes
3answers
713 views

Why is SQL Server 2012 Recommending This Index Be Created?

I have the following query: Select SubId, Max(ReadTimeLocal) From dbo.PanelWorkflow Where ProcessNumber IN ...
1
vote
0answers
21 views

Why is SQL Server Recommending I Create this Index? [duplicate]

I have the following query: Select SubId, Max(ReadTimeLocal) From dbo.PanelWorkflow Where ProcessNumber IN ...
1
vote
1answer
76 views

Mount mdf file to sql server desktop edition

I'm trying to attach a .mdf file to a SQL Server Desktop Edition. After reading this I connected to the database using the osql -E -S servername\instancename command. I tried to attach the ...
4
votes
1answer
4k views

Why aren't unsigned integer types available in the top database platforms?

Databases are usually very customizable with varying data types and custom lengths. It surprises me, as I try to look for the syntax to use unsigned int types that they are not available from neither ...