Database Administrators Stack Exchange Newsletter

Top new questions this week:

Is it possible for SQL statements to execute concurrently within a single session in SQL Server?

I have written a stored procedure which makes use of a temporary table. I know that in SQL Server, temporary tables are session-scoped. However, I have not been able to find definitive information on ...

sql-server sql-server-2012  
asked by Trevor Giddings 16 votes
answered by David Browne - Microsoft 18 votes

If a VARCHAR(MAX) column is included in an index, is the entire value always stored in the index page(s)?

I'm asking this out of curiosity, being inspired by this question. We know that VARCHAR(MAX) values longer than 8000 bytes are not stored in rows, but in separate LOB pages. Subsequently retrieving a ...

sql-server varchar  
asked by mustaccio 12 votes
answered by Joe Obbish 15 votes

Converted a Scalar function to a TVF function for parallel execution-Still running in Serial mode

One of my query in was running in serial execution mode after a release and i noticed that two new functions were used in a view which is referenced in the LINQ to SQL Query generated from the ...

sql-server query-performance performance-tuning parallelism scalar-function  
asked by user9516827 10 votes
answered by Martin Smith 5 votes

Why doesn't SQL Optimizer use my constraint?

I want to create a table with a NOT NULL bool column. I use TINYINT with CHECK constraint BETWEEN 0 and 1. The constraint is new and thus trusted Now I would expect that SQL optimizer now knows that ...

t-sql sql-server-2016  
asked by Zikato 7 votes
answered by Martin Smith 11 votes

Is there such thing as an Availability Group failover trigger?

Is there such thing as a trigger for Availability Group failovers? I want a certain action to happen when an AG fails over. Specifically, I want to turn on a database setting (turning on RCSI). I ...

asked by Michael J Swart 6 votes
answered by Allan Hirt 6 votes

On SQL Server, is it possible to restrict certain users from using certain functions, operators or statements?

we support a large number of developers and analysts who either do not know much or don't care at all about query performance. We have every day hundreds of poorly conceived queries (also due to ...

sql-server query-performance execution-plan  
asked by R. Ferraz 6 votes
answered by James Jenkins 5 votes

Why am I getting the error "non-boolean type specified in a context where a condition is expected" for this request?

I am getting this error : "Error 102 : non-boolean type specified in a context where a condition is expected" for this request : DECLARE @num_dossiers TABLE (num_dossier INT,indice NVARCHAR(3)) ...

sql-server sql-server-2008  
asked by mounaim 6 votes

Greatest hits from previous weeks:

How to join a table with a table valued function?

I have a user defined function: create function ut_FooFunc(@fooID bigint, @anotherParam tinyint) returns @tbl Table (Field1 int, Field2 varchar(100)) as begin -- blah blah end Now I want to join ...

sql-server sql-server-2012 join syntax functions  
asked by Shaul Behr 47 votes

Connect to SQL Server with Windows Authentication in a different domain

I am trying to connect to a remote SQL Server on a VPN in a different domain. When I enter the Server name on the SQL Server and choose Additional Connection Parameters to add some extra stuff needed ...

sql-server authentication logins  
asked by fxuser 66 votes
answered by Aaron Bertrand 63 votes

Connect to sql plus from command line using connection string

Let's say I have a Oracle database. I have a username = x, password = y, database = z. Also I know the port = a, SID = b, Hostname = c. So how do I need to connect correctly? I used many options ...

oracle sqlplus string  
asked by Edvinas 33 votes
answered by Hanspeter Oberlin 63 votes

Remote MySQL connection fails (10060) - "Can't connect to MySQL server on"

I have developed an application in VB6, and am using an online MySQL database server for storing my application's data. The first time I try to connect to my database server is successful, but after ...

mysql connectivity  
asked by Ashok Gujjar 7 votes

What is the difference between Primary key and Super key in DBMS

I am new to DBMSs and I am still learning the theory. I am getting really confused with this key business and after googling I have narrowed it down to just 2 keys I don't get (primary and super ...

primary-key unique-key candidate-key  
asked by MikeHil 19 votes
answered by Pieter Geerkens 23 votes

What's the easiest way to create a temp table in SQL Server that can hold the result of a stored procedure?

Many times I need to write something like the following when dealing with SQL Server. create table #table_name ( column1 int, column2 varchar(200) ... ) insert into #table_name execute ...

sql-server t-sql stored-procedures  
asked by Ogrish Man 49 votes
answered by Martin Smith 35 votes

ODBC Data Source SQL Server Connection - Login Failed For User

I have moved my database from an SQL 2005 to a server with SQL 2008. I am now trying to create an ODBC Data Source. I am using "With SQL Server authentication using a login ID and password ...

sql-server-2008 sql-server-2005 odbc logins  
asked by jpsnow72 13 votes
answered by jpsnow72 14 votes

Can you answer these questions?

How to represent the relationship between artists and albums in an entity-relationship diagram

I'm learning and practicing with the E-R model trying to design a music industry database. With this section of the diagram I have a doubt: I suppose an album can be had by an artist and a band, ...

database-design erd  
asked by dlag 1 vote
answered by Michael Kutz 0 votes

Powershell Invoke-Sqlcmd Replacing £ with?

When I create a SQL Script that inserts the value '£' or '€' into a table the value on the table is a question mark (?) Though, when I insert '$' it inserts a dollar sign. Anyone know what is going ...

sql-server powershell  
asked by Dennis Finke 1 vote
answered by Dennis Finke 0 votes

Deadlock on two update statements on the same page

I'm receiving multiple deadlocks in one SQL Server. The deadlocks occur when the same query with different parameter values is being issued on the same database: Example: Query 1: UPDATE Tabel1 ...

sql-server update deadlock  
asked by nahgeb 1 vote
You're receiving this message because you subscribed to the Database Administrators newsletter.
Unsubscribe from this newsletter       Edit email settings       Leave feedback       Privacy
Stack Overflow

Stack Overflow, 110 William Street, 28th floor, New York, NY 10038