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)

0
votes
1answer
26 views

Manage multiple short-term tables with same schema or use single table for short-term data?

My team has proposed to store session state data for each open client session in a table in the database. The application server creates a new table for each client session as the user logs in via ...
0
votes
2answers
17 views

Multiple databases or one large database?

My company has a framework where different areas of a region are created as separated databases - we call them datamarts. All of the databases are exactly the same and in some regions we have 20 -30 ...
0
votes
1answer
20 views

How to write a query which recursively returns all foreign key references to a column?

I need to obtain a list of foreign keys which refer to a given column, as well as all foreign keys which refer to those keys, and so on. Order does not matter. I have SELECT s.name, t.name, ...
0
votes
1answer
7 views

Sql Server Change Data - Insufficient Arguments [on hold]

I am trying to get Sql Server Change Data configured and am running into problems trying to query the tables. My setup: create table Person ( Id uniqueidentifier PRIMARY KEY DEFAULT ...
0
votes
1answer
23 views

How to get best mark for each Student

I can't find a solution although it should be easy one. I have some students and all I need is to get the highest mark of each one in Math. TableName: Students. Columns: Name Mark John 90 John 84 ...
0
votes
1answer
18 views

Return List of Database Users and Server Logins

How can I return a complete listing of all server logins and all database users across my enterprise? Need to include the remote server name, database name, AD account and SQL users.
0
votes
0answers
17 views

Does my MSDN License allow me to use SQL Server Dev on a dev machine? [on hold]

Complete new guy question. Can I install SQL Server Dev version on a machine I use for development? The Dev Machine is a virtual box that I am building and testing an intranet site for my office. I ...
0
votes
0answers
13 views

Are there limits to SSRS 2014 RDL files going over to SSRS 2008 (or 2012)?

Is there any incompatibility with reports developed in SQL Server SSRS 2014, and then exported to .RDL files that will be imported into SQL Server 2008?
0
votes
0answers
7 views

new subscriber on existing publication Error number: 20598)

i have Publisher server with one transactional replication on it, one publication with two articles( Microsoft Navision tables), there are 4 servers connected like subscribers and the replication is ...
1
vote
0answers
29 views

Had to force loop join and don't understand why

Hello SQL Server Experts. I have a table (table_A) with about 2 million rows and a table_B with about 10 million rows. SELECT b.title FROM table_A A JOIN table_B B ON A.id = B.A_id WHERE ...
0
votes
0answers
14 views

Unable to start SQL Safe service :Error 1053: Could Not Start or Stop the Service in a Timely Fashion [on hold]

We are facing quite a tedious issue for past couple of months and we are out of ideas now: We are using IDERA SQL safe to backup the databases for our many server: IDERA was installed earlier by the ...
0
votes
0answers
13 views

Best practices for selecting partition boundary ranges to maintain empty partitions at both end?

I have partitioned the table based on a date datatype partitioning column. The data for the column starts at "2014-01-01" and ends at "2015-01-01". I know that, the partitions should have empty ...
0
votes
0answers
6 views

Report Server Subscription Configuration ISSUE

I Have Created A Subscription in our Development Server With below Steps. 1)Opened Report Configuration Manager and Configure Email Settings. 2) Opened Report Manager and configured a Report Data ...
0
votes
1answer
28 views

Facing SQL Error 3403

Recently I was working in SQL Server and I faced an error called SQL Error 3403 which was stating: "Error 3403, Severity 22 During recovery initialization, page %ld was encountered. This page ...
3
votes
1answer
164 views

Execution Plans Differ for the Same SQL Statement

As a background to this question the details can be found at this link. In a nutshell: I have 2 SQL statements that are almost identical except for the RIGHT table. The LEFT JOIN is the same and the ...
0
votes
0answers
15 views

Can user defined roles cause problems with colliding permissions?

I recently ran into a problem with an application crashing accessing a SQL Server 2008 database. An "APPCRASH" was recorded in the Event Viewer, but I have little else to go on. The tables are owned ...
0
votes
1answer
34 views

Find out beforehand how many records a query has

I develop reports in ExtJS resulting of queries in SQL Server 2012. I use Ext.Grid with paging, therefore I can use offset to limit the amount of records a query will return. But for this ExtJS ...
0
votes
0answers
16 views

How to determine is a value exists in a column within a partition

I have a set of data where I need to look at partitioned data and determine if a value exists within that partition. Example data: AccountNumber Code Status Credited ...
0
votes
2answers
40 views

Quickly clone a database in SQL Server Management Studio

For testing purposes, I often have to clone databases (onto the same server). Currently I do this by creating a backup and restoring it as a new database. I would love to have such a functionality ...
0
votes
1answer
16 views

Can't cast a SPROC parameter?

I have several sprocs that take a date/time input, one of which takes a date only in the form of an nvarchar because it utilizes dynamic SQL. When I try to cast the variable going into the sproc I'm ...
0
votes
0answers
29 views

Issues with Optimizing TSQL Script

I have a temp table that has a SecurityCode column. This SecurityCode column gets updated based off value from a CrossReference table. The value selected from the CrossReference table depends on how ...
0
votes
1answer
65 views

Need to query records based on Date only (Sample Query given)

sSQL = " SELECT ordID, ordName, ordDate, ordShipping, ordStateTax, ordHandling, ordTotal, ordDiscount, ordPrivateStatus FROM orders WHERE (ordStatus = 7) " I want to display orders that ...
0
votes
1answer
27 views

Counting SQL Server Transactions

Is there a method to count total transactions by type (read/write) by day/hour/peak? ...
0
votes
1answer
34 views

SQL weight multiplication

Hi all i have two columns in a table : +--------------------+----------------+ | Units/Pk | PackWeight/Vol | +--------------------+----------------+ | 1.0000000000000000 | 150g | ...
0
votes
0answers
16 views

Convert Teradata Database to SQL Server 2012 [on hold]

I am just wondering if anyone has any experience, knowledge, or recommendations on migrating a Teradata database to SQL Server 2012. I have never worked with Teradata before so I am unfamiliar with ...
1
vote
1answer
33 views

Non-sequential Primary Key performance in PostgreSQL 9.3

Due to requirement to support distributed environment, each of my clients has been assigned unique node id, it appends the node id with running number as primary key and stores at local database. E.g. ...
2
votes
0answers
29 views

When does SQL Server acquire locks?

The list of isolation levels in SQL Server found here states that write locks acquired within a transaction are retained until the end of the transaction. However it doesn't mention anything about ...
1
vote
1answer
33 views

Cannot install SQL Server 2012

I'm trying to install SQL Server 2012 on Windows Server 2012 Standard and got this message: SQL Server Setup has encountered the following error: The resource ...
0
votes
1answer
17 views

Add linked server from SQL-Server to MySQL: “Data source name not found” (Error:7303)

I'm trying to link my SQL-Server 2005 on Windows Server 2008 R2 with MySQL 5.5.40 on a different computer. I have followed this guide: ...
0
votes
2answers
51 views

SQL Multiple JOINS Interpretation order [on hold]

I have a big problem of using multiple joins in one SQL Statement. For example i have 10 Tables which they are tbl1,tbl2, tbl3,..,tbl10. I would like to select some columns from each table from tbl1 ...
0
votes
1answer
20 views

How to Audit 2 or more SQL Logins (server principals) using SQL Server Audit

I need to audit the few SQL Server Logins, I have used filters while creating Server Audit by using CREATE SERVER AUDIT [audit123] TO FILE ( FILEPATH = N'D:\' ,MAXSIZE = 2048 MB ...
0
votes
0answers
27 views

Can I optimize a left join for a single match?

Consider a join A LEFT JOIN B ON A.id = B.a_id: B.a_id is nullable -- most but not all B records point to an A record. A can, at most, only have one matching B record (business logic). Not all A ...
1
vote
1answer
30 views

Should I used varchar(max) or varchar(4000) SPARSE?

I have a "comment"-type column that is rarely used -- around 6% non-null in a population of 3 million records. The average length (when used) is 6 characters, and the max so far is around 3KB. A ...
1
vote
0answers
18 views

How to query against legacy data that needs to be cleaned up?

I have an existing SQL Server DB with 3 tables (note: this is a made up example, but modelled after a real problem). Artists : contains music artists MusicRecords : contains information on music ...
0
votes
1answer
23 views

Copy of a database with an existing database with schema and data in sql server

I have two databases one is having master kind of tables and other will have transaction data. I should create a new database with a structure of an existing database to my clients. Here is the ...
6
votes
2answers
339 views

What effect will reducing the size of a varchar column have on the database file?

We have a number of tables in our database that have VARCHAR(MAX) columns where a VARCHAR(500) (or something much smaller than max) will suffice. Naturally I want to clean these up, and get the sizes ...
1
vote
1answer
28 views

Trigger AFTER INSERT on tables with different columns

I'm writing a trigger that works after an insert. This is what I have: create trigger trgInsereQuestao on tblquestaoOpcao after insert as begin set nocount on; insert into ...
0
votes
0answers
19 views

Fencing a failed application node to isolate it from SQL Server

I have a multi-node server application that is backed by SQL Server 2012, often in a clustered or AlwaysOn AG/FCI HA configuration. My application monitors the health of the application nodes (not the ...
1
vote
3answers
30 views

Unable to find how a table is being populated

Using SSMS2014 w/ SQL Server 2008 R2. I have a table that I am trying to find out how and from where data inside it is coming from. (I didn't create the table and am unable to contact the person who ...
0
votes
0answers
23 views

How to sync two tables which are on different databases and servers using SSIS?

I am relatively new to SQL Server's tools. I am on the following situation: On several stored procedures on a database D1 on server S1, I need to use data that is stored on a database D2 on server ...
1
vote
1answer
33 views

How to get paged resultset from a table?

I am trying to get paged resultset from a table (Notes). So, I am passing the last offset id (@LastOffset) value along with the page size (@Count). My approach to achieving this is: Sort the table ...
0
votes
1answer
33 views

How to verify if a SQL Account is still used?

We have a SQL Server Login on a SQL Server 2008, and no one seems to know if the account is actually being used or not. It is assumed it is being used, as it is configured in a Linked_Server ...
0
votes
1answer
16 views

SQL Server Service's Log On As account

I just inherited a set of new servers and whoever set them up left the "Log On As" account as the default "NT Service\MSSQLSERVER". I'd like to change that over to an Active Directory service name. I ...
0
votes
0answers
30 views

Can I create a constraint to a subset of data? [duplicate]

Here's a simplified view of my database |---------------| |-----------| | ORGANIZATION | | CONTACT | |---------------| |-----------| | OrgId | | ContactId | | OrgName ...
0
votes
0answers
32 views

Rowversion column in every table - Bad practice?

I'm currently providing my application with concurrency checks. For that, I'm using Entity Framework combined with SQL Server's RowVersion / Timestamp column. Now I've thought about adding a ...
0
votes
0answers
28 views

SQL Server 2012: query to see queries that are consuming more resources [duplicate]

I'm trying to find/build a query to show me those queries that are consuming more resources in SQL Server so that I can optimize them or at least have a statistical idea of what is really happening. ...
1
vote
1answer
49 views

What is the query that updates the Column in a table

I have a column in a table that I don't know who is updating it . The table name is dbo.Events and the column name is [Status] and this column values are 1 or 2 . I am trying to find the query that ...
0
votes
0answers
29 views

Application is hanging when database upgraded from SQL Server 2000 to SQL Server 2008 R2

Presently we are working with SQL Server 2000, the database is perfectly working with our software for retail sales counter application developed with VB 6.0. But after upgraded to SQL Server 2008 R2, ...
0
votes
0answers
15 views

Sql Server 2014 AppRole not able to create temptable in tempdb

we have created Application Roles in sql server 2014 and grant the "Execute" permission on the tables and stored procedures. when i execute sp_setAppRole and then the stroredprocedure. the simple ...
0
votes
1answer
22 views

Optimizing a DMV query

I have found a query that is a major performance issue in my environment. I looked at the actual execution plan for this query and found out the main problem is the remote scan (98%). Its remote ...