SQL Server

Microsoft SQL Server powers your entire data estate by supporting structured and unstructured data sources. It builds on previous versions of SQL Server, which have been industry leading for four years in a row and a leader in TPC-E. It scales to petabytes of data and allows customers to process big data through PolyBase using T-SQL over any data. SQL Server has also been the least vulnerable database during the last seven years. SQL Server brings data insights with business intelligence capabilities that provide analytics at a fraction of the cost on any device along with advanced analytics with support for R and Python.

More details about SQL Server are available in the SQL Server documentation.
If you have a technical issue, please open a post on the developer forums through Stack Overflow or MSDN.


  • Hot ideas
  • Top ideas
  • New ideas
  • My feedback
  1. DECRYPTBYPASSPHRASE - returns NULL at times

    The environment is Microsoft SQL Server Web (64-bit) on Windows Server 2016 Standard (10.0).
    I have two stored procedures, one to encrypt and other to decrypt.

    CREATE PROCEDURE USPENCRYPTBY_PASSPHRASE
    (@Passphrase NVARCHAR(50), @Id int, @date NVARCHAR(25))
    AS

    UPDATE T SET ColEncrypted = ENCRYPTBYPASSPHRASE(@Passphrase,@date,1,CONVERT(VARBINARY,T.PK))
    FROM TableA T WHERE T.PK = @Id

    GO

    CREATE PROCEDURE USPDECRYPTBY_PASSPHRASE
    (@Passphrase NVARCHAR(50), @Id int)

    AS

    SELECT convert(date, convert(nvarchar, DecryptByPassPhrase(@passphrase,ColEncrypted,1,CONVERT(varbinary,PK)))) as DATEOFBIRTH

    WHERE PK = @Id

    GO

    Here
    @Passphrase is of 8 characters length,
    PK is primary key of TableA and is an int identity column
    @date is text to be encrypted…

    1 vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Bugs  ·  Flag idea as inappropriate…  ·  Admin →
  2. SSMS 18.4 IntelliSense does not recognize proper nodes column reference with exist() method

    Here is a simple T-SQL, parsing xml

    DECLARE @xml xml = '<A>b</A>'

    SELECT

    x.c.exist(&#39;.&#39;) as Yes
    

    FROM @xml.nodes('A') x(c)

    Run it. It's valid T-SQL

    Note that IntelliSense highlights "x.c.exist('.')"
    Hover hint shows that column 'c' cannot be used directly, but only can be used with ...exist method.

    That is exactly what I am using it with, in working T-SQL code.

    Therefore it is IntelliSense bug.

    See attachment as well

    1 vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)

    We’ll send you updates on this idea

    3 comments  ·  Bugs  ·  Flag idea as inappropriate…  ·  Admin →
  3. SQL Server Management Studio shuts down when DB Diagram is opening for modify

    It's impossible to open for modifying some DB Diagramm!
    SQL Server Management Studio 15.0.18206.0 just shuts down!

    1 vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Bugs  ·  Flag idea as inappropriate…  ·  Admin →
  4. 2017 Query Store Capture Mode All - not capturing trivial queries

    My observation and understanding from my DBA who spoke to a MS Engineer, that Query Store by design does NOT capture queries which contain only scalar expressions, given that their plans are trivial and not really relevant for performance troubleshooting.

    However, Query Store is NOT only used for performance trouble shooting but also being able to know what procedures and functions actually get executed. This is especially true with older SQL Server databases that have a lot of legacy code. Having Query Store “choose” to not store those queries is really hurting our capability to “clean house” so to speak.

    1 vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Bugs  ·  Flag idea as inappropriate…  ·  Admin →
  5. Return statement does not always stop execution of a stored procedure

    Attachment contains the repro script. In it the stored procedure is created and then executed. The select statement returns results though it follows the return command.

    2 votes
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Bugs  ·  Flag idea as inappropriate…  ·  Admin →
  6. Long SQL Server IN-Momory tables creation and server restart

    There are performance issues about creating In-Memory tables and restarting SQL Server instance.
    1. Creating single In-Memory table takes about 200ms (standard table is less than 20ms)
    2. After creating about 1000 In-Memory tables and restarting SQL Server instance, it takes hours to bring database online. The walkaround with trace flag 9944 is not enough.

    Example script that creates such tables is in the script. All tests consider SCHEMA_ONLY durability.

    1 vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Bugs  ·  Flag idea as inappropriate…  ·  Admin →
  7. sqlcmd doesn't print messages or results until "end-of-batch"

    I'm using sqlcmd in a Linux environment, within maintenance scripts etc.
    When I have a SQL Statement that loops (waits for various status or similar) I want the output to be displayed at the client/sqlcmd so that waiting users can see what's happening (feedback to user/caller).

    Here is an example sql file:
    (note: formatting seems to be wrong, &#39 should really be a single quote, and there are to many newlines...)

    set nocount on   
    
    go
    select getdate() as now
    go
    declare @cnt int = 10
    declare @time char(8)
    while (@cnt &gt; 0)
    begin
    SET @time = convert (varchar(30), getdate(), 8)
    1 vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Bugs  ·  Flag idea as inappropriate…  ·  Admin →
  8. SSMS Keyboard shortcuts

    I'm calling this a bug since this has been working feature in prior versions of SSMS. The F8, F7 and Ctrl-Alt-T keyboard shortcuts are gone from SSMS 18.x. Additionally the Task List shortcut changed from Ctrl - T to Ctrl-Alt-K. This is the second time that the F8/F7 have been messed with. I think back in SSMS 2014 they disappeared. Only to return.

    Changing Keyboard shortcuts is sacrilegious. The F8/F7 shortcuts have been part of SSMS since the beginning. You don’t change shortcuts! They have to come back!

    1 vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Bugs  ·  Flag idea as inappropriate…  ·  Admin →
  9. SSMS 18.4 download just loops, Downloaded the 539MB file 4 times

    I downloaded the 18.4 install file of 539MB 4 times, and as soon as it finishes, the open in 1 second just changes to open in 4 minutes again, then it starts to download the 539MB all over again

    1 vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Bugs  ·  Flag idea as inappropriate…  ·  Admin →
  10. Function Inlining returns worng result without error

    Function inlining has a bug in combination with String concatenation. The following code makes it very simple to understand if you turn on/off the inline option.

    I already had two cases where this caused a lot of confusion for a customer.

    SET ANSINULLS ON
    GO
    SET QUOTED
    IDENTIFIER ON
    GO
    CREATE TABLE dbo.Test(TestId int primary key, TestTxt varchar(100), SortOrder Int)
    go

    CREATE TABLE dbo.Test2(TEstId int, Id2 int)
    go
    INSERT INTO dbo.Test (TestId,TestTxt, SortOrder) values (1, 'Vl1',3)
    INSERT INTO dbo.Test (TestId,TestTxt, SortOrder) values (2, 'Vl2',1)
    go
    INSERT INTO dbo.Test2(TEstId, Id2)
    SELECT 1, 3
    INSERT INTO dbo.Test2(TEstId, Id2)
    SELECT 1, 4

    1 vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Bugs  ·  Flag idea as inappropriate…  ·  Admin →
  11. Count(*) on VARCHAR Index with blank NVARCHAR or NULL check results in double the rows returned

    I have a table with a VARCHAR column and an index on it. Whenever a SELECT COUNT(*) is done on this table that has a check for COLUMN = N'' OR COLUMN IS NULL it returns double the number of rows. SELECT * with the same where clause will return the correct number of records.

    After reading this article: https://sqlquantumleap.com/2017/07/10/impact-on-indexes-when-mixing-varchar-and-nvarchar-types/ and doing some testing I believe the collation of the column and the implicit conversion isn't the fault (at least not directly). The collation of the column is Latin1GeneralCI_AS.

    The database is on SQL Server 2012, and I've…

    1 vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Bugs  ·  Flag idea as inappropriate…  ·  Admin →
  12. SQLPackage does not correctly detect function dependencies, deployment script fails

    https://github.com/microsoft/DACExtensions/issues/24

    Steps to reproduce:

    Create a new database.
    Run the following creation scripts:
    CREATE TABLE [dbo].someTable NOT FOR REPLICATION NOT NULL) ON [PRIMARY]
    GO

    CREATE FUNCTION [dbo].someOtherFunction RETURNS @someResults TABLE (Id INT)
    AS
    BEGIN
    INSERT INTO @someResults(Id)
    SELECT * FROM [dbo].[someTable] st WHERE @id = st.Id
    RETURN;
    END
    GO

    CREATE FUNCTION [dbo].someFunction RETURNS TABLE
    AS
    RETURN
    (
    SELECT * FROM [dbo].someOtherFunction
    )
    GO

    Extract the dacpac using:

    C:\Program Files\Microsoft SQL Server\150\DAC\bin\SqlPackage.exe /a:Extract /ssn:$server /sdn:$dbName /st:300 /p:CommandTimeout=300 /tf:extracted.dacpac
    Create a script using:

    C:\Program Files\Microsoft SQL Server\150\DAC\bin\SqlPackage.exe /a:Script /tsn:$server /tdn:$newDbName /tt:300 /p:CommandTimeout=300 /sf:extracted.dacpac /op:script.sql
    Look over the script and…

    1 vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Bugs  ·  Flag idea as inappropriate…  ·  Admin →
  13. Query checking doesn't take DROP TABLE into account for temporary tables

    DROP TABLE IF EXISTS #Bug

    SELECT 42 AS Field1
    INTO #Bug

    SELECT Field1
    FROM #Bug

    GO

    DROP TABLE IF EXISTS #Bug

    SELECT 42 AS Field1, 42 AS Field2
    INTO #Bug

    SELECT Field1, Field2
    FROM #Bug

    fails with Invalid column name 'Field2'. The query checker uses the information it has about the schema for #Bug in the second batch, which is invalid because the first thing the second batch does is drop the table.

    2 votes
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Bugs  ·  Flag idea as inappropriate…  ·  Admin →
  14. Visual Studio Subscriptions Links for SQL Server 2019 are broken

    The links for downloading SQL Server 2009 availed at https://my.visualstudio.com/Downloads?q=sql%20server are broken.

    Tried downloading the following edition of SQL Server 2019

    a) Express

    b) Express with Advanced Services

    c) Developer

    but, all the links are broken as of 2020-04-01.

    1 vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Bugs  ·  Flag idea as inappropriate…  ·  Admin →
  15. Manual failover without data loss not working in SQL2019

    We have setup two Linux SQL2019 CU3 instances on Ubuntu with HA enabled and I get an error when I execute: ALTER AVAILABILITY GROUP [ag6x52] SET (ROLE = SECONDARY); to manually failover over to the secondary replica.

    The message is:
    Msg 41104, Level 16, State 5, Line 1
    Failover of the availability group to the local replica failed because the availability group resource did not come online due to a previous error.

    My AG is as follows

    Create AVAILABILITY GROUP ag6x52
    WITH (CLUSTER_TYPE = NONE )
    FOR REPLICA ON
    N'sql52' WITH (

      ENDPOINT_URL = N&#39;tcp://172.16.6.52:5022&#39;,
    
    AVAILABILITY_MODE = SYNCHRONOUS_COMMIT,
    FAILOVER_MODE =
    8 votes
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Bugs  ·  Flag idea as inappropriate…  ·  Admin →
  16. SqlPackage.exe does not deploy "allow snapshot isolation" even when "ScriptDatabaseOptions" is enabled.

    SqlPackage has the option "allow snapshot isolation" in database settings. Even when this is enabled and ScriptDatabaseOptions is ON, SQLPackage does not enable snapshot isolation on the target database.

    1 vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Bugs  ·  Flag idea as inappropriate…  ·  Admin →
  17. Master Data Services Excel Add In error setting Locked property of the Range class during publish


    1. a column that is designated as a domain based attribute by supplying an invalid code.

    2. Publish the result

    3. When MDS reports "Validating changes..." a dialog appears with the message "Unable to set the Locked property of the Range class"

    1 vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Bugs  ·  Flag idea as inappropriate…  ·  Admin →
  18. fix AAS Bug with Calculation Groups Sideways recursion with Ordinals

    We have hit a (another) problem with Calculation Groups that means that we have had to take off Ordinals on all our Calculation Items

    I've provided all the details https://github.com/otykier/TabularEditor/issues/414 so wont repeat here. If there is a better place to raise this please let me know

    1 vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Bugs  ·  Flag idea as inappropriate…  ·  Admin →
  19. SQL Server 2019 log shipping setting error on Linux. 'Log shipping is not installed on this instance'

    We have running SQL server 2019 on CentOS 7.
    The error we get when we try to enable log shipping is:
    RegQueryValueEx() returned error 2, 'The system cannot find the file specified.'
    Msg 22001, Level 1, State 1
    Msg 32018, Level 16, State 3, Procedure master.dbo.spaddlogshippingsecondary_primary, Line 129
    Log shipping is not installed on this instance.

    Try sql 15.x version is all errors.
    mssql-server-15.0.2000.5-5.x8664 , mssql-server-15.0.4003.23-3.x8664 , mssql-server-15.0.4013.40-8.x8664 , mssql-server-15.0.4023.6-2.x8664

    mssql-server-14.0.3281.6-2.x86_64 version is succeed.

    Is it bug to mssql-server-15.x version?

    1 vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Bugs  ·  Flag idea as inappropriate…  ·  Admin →
  20. SSMS v18.4 injects text into currently-open query window when renaming object/column in Object Explorer

    If an object or column is renamed in an Object Explorer node, the name text of the next object/column node is inserted at the current cursor position in the currently-open query window, as if you had performed a drag-and-drop of the node name to that location.

    SQL Server Management Studio 15.0.18206.0
    Microsoft Analysis Services Client Tools 15.0.1567.0
    Microsoft Data Access Components (MDAC) 10.0.14393.0
    Microsoft MSXML 3.0 6.0
    Microsoft Internet Explorer 9.11.14393.0
    Microsoft .NET Framework 4.0.30319.42000
    Operating System 10.0.14393

    1 vote
    Sign in
    (thinking…)
    Sign in with: Microsoft
    Signed in as (Sign out)

    We’ll send you updates on this idea

    0 comments  ·  Bugs  ·  Flag idea as inappropriate…  ·  Admin →
← Previous 1 3 4 5 278 279
  • Don't see your idea?

SQL Server

Categories

Feedback and Knowledge Base