Questions tagged [sql-server-2012]

Use this tag for questions specific to the 2012 version of Microsoft's SQL Server.

SQL Server 2012 (codename Denali, version 11.00), released in March 2012, is the successor to SQL Server 2008 R2.

This tag covers questions specific to the 2012 version of the database engine. It is recommended that the tag is also used when tagging questions with this version specific tag.

Programmability topics may include but are not limited to

  • FileTable
  • Semantic search
  • Metadata discovery
  • Ad-hoc Query Pagination
  • Sequence objects
  • Throw statement
  • Conversion functions
    • PARSE
    • TRY_CONVERT
    • TRY_PARSE
  • Date and time functions
    • DATEFROMPARTS
    • DATETIME2FROMPARTS
    • DATETIMEFROMPARTS
    • DATETIMEOFFSETFROMPARTS
    • EOMONTH
    • SMALLDATETIMEFROMPARTS
    • TIMEFROMPARTS
  • Logical functions
    • CHOOSE
    • IIF
  • String functions
    • CONCAT
    • FORMAT
  • Analytic functions
    • CUME_DIST
    • LAST_VALUE
    • PERCENTILE_DISC
    • FIRST_VALUE
    • LEAD
    • PERCENT_RANK
    • LAG
    • PERCENTILE_CONT
17074 questions
46
votes
3 answers

You can only create a user with a password in a contained database

I am using a contained database, after creating the database I attempted to create a user but I got the error: You can only create a user with a password in a contained database My code is: sp_configure 'show advanced options',1 GO RECONFIGURE…
Faisal Ashfaq
  • 2,545
  • 4
  • 28
  • 41
46
votes
1 answer

How to export database with data in MSSQL?

How can I export my 2012 database with data to a .sql file so I can import it to a 2008 server? I've never been able to export the data only the structure.
Jamie
  • 3,031
  • 5
  • 36
  • 59
44
votes
3 answers

900 byte index size limit in character length

What is the total character limit for a 900 byte index limit that SQL Server 2012 has. I created a column that has varchar(2000), but I think that it exceeding the 900 byte that SQL Server limited? What would be a max varchar(?) to fit inside the…
iefpw
  • 6,816
  • 15
  • 55
  • 79
43
votes
2 answers

Unable to delete the database user as the user is already logged in currently. error 15434

I have created the user sagar in SQL Server 2012 database and mapped it to the XYZ database. After some time I deleted the XYZ database and now I don't need the existing user sagar also. But when I try to delete the user from SQL Srever Management…
Sagar Pudi
  • 4,634
  • 3
  • 32
  • 51
42
votes
3 answers

Maintenance Plan Execute option is greyed out

When I go to SQL Server Management Studio -> Management -> Maintenance Plans -> Right click on the maintenance plan that I want to execute but the option is greyed out. I have checked and SQL Server Integration Services is running. I can execute…
Oxon
  • 4,901
  • 8
  • 40
  • 54
42
votes
2 answers

Multiple Databases Vs Single Database with logically partitioned data

I am pondering over a database design issue. Any help would be highly appreciated. We are designing an application which has 20 tables (which may grow to about 30 maximum during new feature development) The technology stack MVC4,.NET 4.X, Entity…
Ahsan
  • 2,488
  • 2
  • 22
  • 44
42
votes
3 answers

Stored procedure EXEC vs sp_executesql difference?

I've written two stored procedure one with sp_executesql and other doesn't have sp_executesql both are executing properly same results, I didn't get what is the difference here between EXEC (@SQL) vs EXEC sp_executesql @SQL, N'@eStatus…
41
votes
6 answers

Calculation in Sql Server

I trying to perform following calculation Sample data: CREATE TABLE #Table1 ( rno int identity(1,1), ccp varchar(50), [col1] INT, [col2] INT, [col3] INT, col4 as [col2]/100.0 ); INSERT INTO #Table1 …
Pரதீப்
  • 91,748
  • 19
  • 131
  • 172
41
votes
2 answers

SQL Server 2012 Install or add Full-text search

I am working in SQL Server 2012, and would like to use the CONTAINS() function only it seems I need to have full-text search enabled for to be able to use it. How do I enable/install this feature to an existing SQL Server 2012 install? What I need…
Kobojunkie
  • 6,375
  • 31
  • 109
  • 164
41
votes
6 answers

Installing SQL Server 2012 - Error: Prior Visual Studio 2010 instances requiring update

I'm trying to install SQL Server 2012 Developer Edition and I can get to the point where it's doing the Installation Rule Checks but one of the rules keep failing: 'Prior Visual Studio 2010 instances requiring update' It basically indicates that I…
Brad Linard
  • 1,284
  • 1
  • 10
  • 6
39
votes
2 answers

what is logical reads in sql server? how to reduce no of logical?

After doing my research, on how to speed up queries executed in SQL server, the majority of resources suggesting to reduce logical reads, by using the proper where clause. What I am really interested in is to know about the work flow in SQL…
Nandha
  • 655
  • 1
  • 6
  • 14
39
votes
8 answers

How to get next value of SQL Server sequence in Entity Framework?

I want to make use SQL Server sequence objects in Entity Framework to show number sequence before save it into database. In current scenario I'm doing something related by increment by one in stored procedure (previous value stored in one table)…
ManirajSS
  • 2,295
  • 5
  • 26
  • 50
39
votes
3 answers

Would transaction work across multiple DB in the same SQL server? If so, is this a Distributed transaction?

Would transaction work across multiple DB in the same SQL server? If so, is this a Distributed transaction? or would basic BEGIN TRANSACTION work?
Henry
  • 32,689
  • 19
  • 120
  • 221
39
votes
1 answer

What is the meaning of the following SQL Server declaration: datetime2(7)?

Inside a SQL Server query, there is: datetime2(7). I know datetime2, but I don't understand (7). Can you explain the meaning of (7)?
user1485916
39
votes
3 answers

Why are CLR Types derived from generics not supported in SQL Server 2008 and later?

The following code implements an UDT which derives from a generic (SortedDictionary): [Serializable] [Microsoft.SqlServer.Server.SqlUserDefinedType(Format.UserDefined, MaxByteSize = 8000)] public class udtMassSpectra : SortedDictionary
jahu
  • 533
  • 4
  • 15