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
2152
votes
32 answers

How to check if a column exists in a SQL Server table

I need to add a specific column if it does not exist. I have something like the following, but it always returns false: IF EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'myTableName' AND…
Maciej
  • 21,919
  • 3
  • 20
  • 23
573
votes
12 answers

Auto increment primary key in SQL Server Management Studio 2012

How do I auto increment the primary key in a SQL Server database table? I've had a look through the forum but can't see how to do this. I've looked at the properties but can't see an option. I saw an answer where you go to the Identity specification…
Ledgemonkey
  • 7,223
  • 12
  • 36
  • 56
409
votes
17 answers

Enable remote connections for SQL Server Express 2012

I just installed SQL Server Express 2012 on my home server. I'm trying to connect to it from Visual Studio 2012 from my desktop PC, and repeatedly getting the well-known error: A network-related or instance-specific error occurred while…
Ryan Lundy
  • 204,559
  • 37
  • 180
  • 211
262
votes
13 answers

SQL Server Configuration Manager cannot be found

After installing SQL Server 2008, I cannot find the SQL Server Configuration Manager in Start / SQL Server 2008 / Configuration Tools menu. What should I do to install this tool?
240
votes
18 answers

Recover unsaved SQL query scripts

How to recover the unsaved scripts if the SSMS crashes / unsaved tab gets accidentally closed?
BumbleBee
  • 10,429
  • 20
  • 78
  • 123
224
votes
17 answers

Where is SQL Server Management Studio 2012?

I had SQL Server 2008 R2 and Visual Studio 2008 and 2010 on my laptop. I've installed SQL Server 2012 and have finally got SQL Server Data Tools to show up, so that I can create SSRS reports in Visual Studio 2010. Although I've installed Management…
Andy Brown
  • 5,309
  • 4
  • 34
  • 39
168
votes
21 answers

"No backupset selected to be restored" SQL Server 2012

I have a SQL Server 2012 database with filestream enabled. However, when I backup it and try to restore it on another SQL Server 2012 instance (on another machine), I simply get this message that: No backupset selected to be restored. Not even a…
Saeed Neamati
  • 35,341
  • 41
  • 136
  • 188
162
votes
15 answers

The server principal is not able to access the database under the current security context in SQL Server MS 2012

I am trying to access my hosting server’s database through SQL Server Management Studio, everything till login is fine but when I use the command use myDatabase it gives me this error: The server principal "****" is not able to access the database…
Maven
  • 14,587
  • 42
  • 113
  • 174
155
votes
21 answers

No process is on the other end of the pipe (SQL Server 2012)

I've got this error: A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.) (Microsoft SQL Server,…
Iter Ator
  • 8,226
  • 20
  • 73
  • 164
149
votes
6 answers

Identity increment is jumping in SQL Server database

In one of my tables Fee in column "ReceiptNo" in SQL Server 2012 database identity increment suddenly started jumping to 100s instead of 1 depending on the following two things. if it is 1205446 it is jumps to 1206306, if it is 1206321, it jumps to…
kashif
  • 3,713
  • 8
  • 32
  • 47
132
votes
6 answers

SQL Server Management Studio won't let me add an index to a table

When I right click on the indexes folder in the table the "New Index" menu item is grayed out. I don't understand why. I've deleted all data in the table just in case, and refreshed and restarted SSMS, but no luck. I'm using SQL Server 2012 Business…
130
votes
3 answers

SQL Server 2012 column identity increment jumping from 6 to 1000+ on 7th entry

I have a strange scenario in which the auto identity int column in my SQL Server 2012 database is not incrementing properly. Say I have a table which uses an int auto identity as a primary key it is sporadically skipping increments, for…
Andy Clark
  • 3,363
  • 7
  • 27
  • 42
121
votes
13 answers

Index was outside the bounds of the Array. (Microsoft.SqlServer.smo)

I am using SQL Server 2008 R2. It is working fine. But recently, I have changed my hosting server and I came to know that they have installed SQL Server 2012 on Server. Now, Issue is that after connecting with Server Database through SQL Server 2008…
Jeeten Parmar
  • 5,568
  • 15
  • 62
  • 111
121
votes
4 answers

The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions

The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions, unless TOP, OFFSET or FOR XML is also specified. I am getting the above said error while trying to execute the following…
Kamran Ahmed
  • 11,809
  • 23
  • 69
  • 101
119
votes
18 answers

Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 1, current count = 0

I have an Insert stored procedure which will feed data to Table1 and get the Column1 value from Table1 and call the second stored procedure which will feed the Table2. But when I call The second stored procedure as: Exec USPStoredProcName I get the…
Vignesh Kumar A
  • 27,863
  • 13
  • 63
  • 115
1
2 3
99 100