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
20
votes
4 answers

Is there any way to do HTML decode in SQL Server?

I have the following records in one of my table CD&M Communications auburndale oil & propane inc C F La Fountaine #7561 Laramie County Fire District # 2 AmeriGas Propane LP #2250 Is there a way to remove the…
VPP
  • 731
  • 1
  • 9
  • 34
20
votes
1 answer

Create Table Throws a TextImage Error On Creation

I have a table which has one field that uses a filestream. When I attempt to insert the table I get this error Cannot use TEXTIMAGE_ON when a table has no text, ntext, image, varchar(max), nvarchar(max), non-FILESTREAM columns. Why? SQL USE…
Álvaro García
  • 18,114
  • 30
  • 102
  • 193
20
votes
3 answers

SQL Server xp_delete_file parameters

Who can explain list of xp_Delete_file parameters in sql server. I don't find msdn document for this stored procedure. I got script of xp_Delete_file from maintenance plan but didn't understand first parameter.
mehdi lotfi
  • 11,194
  • 18
  • 82
  • 128
20
votes
4 answers

How to view data in table variables during debugging session in MS SQL Management Studio 2012?

I would like to debug a complex T-SQL script using SSMS 2012. I can run the script in debug mode and place breakpoints, as well as step through my script, but I can't see the values stored in my table variables. In the Locals window I see all these…
Alexander Galkin
  • 12,086
  • 12
  • 63
  • 115
20
votes
7 answers

Permissions error when attaching a database: "Cannot access the specified path"

I am running SQL Server 2012 Enterprise Edition. I have downloaded the AdventureWorks 2012 OLTP data files (both .mdf and .ldf). I saved them to the AW folder that I created in My Documents where I unzipped the file. I go to SQL Server Management…
user2151027
  • 203
  • 1
  • 3
  • 5
19
votes
3 answers

SQL Server's ISNUMERIC function

I need to checking a column where numeric or not in SQL Server 2012. This my case code. CASE WHEN ISNUMERIC(CUST_TELE) = 1 THEN CUST_TELE ELSE NULL END AS CUSTOMER_CONTACT_NO But when the '78603D99' value is reached, it returns 1…
weeraa
  • 1,123
  • 8
  • 23
  • 40
19
votes
1 answer

Default row order in SELECT query - SQL Server 2008 vs SQL 2012

Our team recently upgraded our databases from SQL Server 2008 to SQL Server 2012. One breaking change we noticed was in the default order of rows returned by the SELECT statement, i.e. when an explicit ORDER BY clause is not specified. As per MSDN,…
Channs
  • 2,091
  • 1
  • 15
  • 20
19
votes
3 answers

Refresh Application Automatically When Data changed in SQL Server

I use SQL Server and I have 3 Application servers. When a table in my database have changed I need to those application servers refresh there local cached data. I use a trigger to known change and send a message via Service broker queue. Then I…
mehdi lotfi
  • 11,194
  • 18
  • 82
  • 128
19
votes
1 answer

SQL Server Query: Using JOIN to include NULL values

I need help with the following SQL Server query where the columns a.TAProfileID and c.CountryCode have "NULL" values in the database. I want my JOIN statements to return "NULL" values where they exist. SELECT a.ReservationStayID AS 'Reservation…
user3115933
  • 4,303
  • 15
  • 54
  • 94
19
votes
4 answers

SQL Server Pre-Login Handshake Acknowledgement Error

We have a production website with a mixture of classic ASP, inline .Net and compiled .Net that talks to a SQL Server instance where both are VMs on the same physical box and everything there works great. In order to do some testing with new features…
Scott Salyer
  • 2,165
  • 7
  • 45
  • 82
19
votes
1 answer

Errors during Code First add-migration

Our add-migrations are failing routinely but not consistently. The migration always gets to the scaffolding step and then roughly 4 out of 5 times we will receive something like the following: System.Runtime.Remoting.RemotingException: Object…
Dane Vinson
  • 278
  • 1
  • 8
19
votes
1 answer

Set Script Task code dynamically in SSIS 2012

In my application, a script task is created dynamically. In SQL Server 2008's implementation of SSIS, the following method worked fine. private void SetSourceCode(ScriptTask scriptTask, string code, string codeName) { string…
user2746385
  • 191
  • 1
  • 3
19
votes
2 answers

Insert Multiple Rows Into Temp Table With SQL Server 2012

These StackOverflow questions here, here, and here all say the same thing, but I can't get it to run in SSMS or SQLFiddle CREATE TABLE #Names ( Name1 VARCHAR(100), Name2 VARCHAR(100) ) INSERT INTO #Names (Name1, Name2) VALUES …
KyleMit
  • 30,350
  • 66
  • 462
  • 664
19
votes
3 answers

Stop SQL Server from running until needed

This is not off-topic. The link to on-topic says: ...if your question generally covers...software tools commonly used by programmers...then you’re in the right place to ask your question! I have SQL Server 2012 installed on my PC, and usually don't…
ispiro
  • 26,556
  • 38
  • 136
  • 291
18
votes
3 answers

Why CTE (Common Table Expressions) in some cases slow down queries comparing to temporary tables in SQL Server

I have several cases where my complex CTE (Common Table Expressions) are ten times slower than the same queries using the temporary tables in SQL Server. My question here is in regards to how SQL Server process the CTE queries, it looks like it…