Side effect of SQl server upgrade from 2008 R2 to Server 2012, logical name of log file changed for one database

I came to know that name has changed when I tried to shrink the file. Here is the error message I got:
Shrink failed for LogFile "Tfs_TESTTFS_Log'. (Microsoft.SqlServer.Smo)
Additonal information
An exception occured while executing a Transact-SQL statement or batch.
(Microsoft.SqlServer.COnnectionInfo)
Could not locate file 'Tfs_TESTTFS_Log' for database 'Tfs_TESTTFS' in sys.database_files. The file 
either does not exist, or was dropped. (Microsoft Sql Server, Error: 8995)
This is test environment upgrade and I checked on production environment which is still on SQL 2008R2, shrink works fine.
Please help.

I did in place Upgrade.
Before Upgrade
Logical Names
Database Name: Tfs_TESTTFS
Database Log: Tfs_TESTTFS_Log
After Upgrade
Logical Names
Database Name: Tfs_TESTTFS
Database Log: TfsVersionControl_Log
Thx

Similar Messages

  • SQL Server 2012 stops running after setup files are copied.

    SQL Server 2012 setup stops running after setup files are copied.
    I've experiencing the same issue on two different machines. Both are 64 bit running Server 2008.
    On both of them I tried installing using the files from the ISO. I initially used winzip to extract the files. The setup was running fine, but the SQL Server engine had an error when it installed. Then using the Add/Remove programs i uninstalled all of the
    SQL Server 2012 applications, including the setup files.
    Now when i try to install using the "New SQL Server stand-alone..." wizard it will copy the setup files and then the wizard never comes back. I've tried mounting the ISO, extracting with winrar, Burning the ISO to a dvd and downloading the 3 files. I also
    tried mounting ISO of the version that was just recently released. I run into the same issue with all of them.
    Thanks for the help.

    can you try 
     setup.exe
    /Action=install /x86 /UpdateEnabled=false
    If this doesn't work please use below FAQ to locate and upload SQL Server setup logss.
    FAQ
    Regards,
    Ahmed Ibrahim
    SQL Server Setup Team
    My Blog
    This posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click
    "Mark as Answer" and "Vote as Helpful"
    on posts that help you.
    This can be beneficial to other community members reading the thread.
    Thank you, it's work!!! :) Maybe problem was in /UpdateEnabled=false and I could try to install a x64 version... but too late, setup in progress and I do not want to have to try all over again :)

  • "set deadlock_priority" not effective in SQL Server 2012?

    I am trying to control which of two sessions is chosen as the deadlock victim in SQL Server 2012. I have set up a test that induces a deadlock by updating two tables in opposite order with a "waitfor" in between the updates. I can consistently
    repro the deadlock and have code that will catch it and re-try the transaction.
    However, when I run "set deadlock_priority low" for one of the sessions, it does not change which victim is chosen. SQL Server consistently chooses the session that starts last as the deadlock victim regardless of this setting. I have verified
    that the setting is correct by selecting deadlock_priority from sys.dm_exec_sessions. I have tried setting the session that starts first to "low" and the one that starts second to "high". In spite of that, the second one is always
    the one that gets chosen as the victim.
    Is this the expected behavior?
    Thanks,
    Ron Rice
    Ron Rice

    I didn't try extremely hard, but I was not able to reproduce the issue. Running in the Northwind database, I had this in one window:
    SET DEADLOCK_PRIORITY LOW
    go
    BEGIN TRANSACTION
    go
    SELECT * FROM Orders WITH (REPEATABLEREAD) WHERE OrderID = 11000
    WAITFOR DELAY '00:00:02'
    UPDATE Orders SET CustomerID = 'ALFKI' WHERE OrderID = 11000
    go
    ROLLBACK TRANSACTION
    and in the other window I had:
    SET DEADLOCK_PRIORITY HIGH
    go
    BEGIN TRANSACTION
    go
    SELECT * FROM Orders WITH (REPEATABLEREAD) WHERE OrderID = 11000
    WAITFOR DELAY '00:00:02'
    UPDATE Orders SET CustomerID = 'ALFKI' WHERE OrderID = 11000
    go
    ROLLBACK TRANSACTION
    And every time I tried, it was the first window that fell on the floor.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • SQL Server 2012 Service Pack 2 Configuration file path: is empty

    I have begun installing SQL 2012 Service Pack 2 on a test system and I go to the page where it is Ready to update.  The configuration file path: at the bottom of the screen was empty.  Is this normal or will I need to go to the default locations
    of Bootstrap to find the configuration file this upgrade is going to use?  This is something that is odd as a majority of our current installations is automated using a configuration file and a path for the Upgrade files.
    Rick

    Hi Rick,
    Based on your description, I make a test on my computer. When I go to the ‘Ready to update’ page, I also find that the ‘configuration file path’ box is empty, below is my screenshot. This is a normal phenomenon during the installation of SQL Server Service
    Pack.
    We don’t need to find the configuration file from SQL Server setup location, just click the Update button to perform the Service Pack installation. After the update process, I install SQL Server 2012 Service Pack 2 successfully.
    Besides, there is also a similar article about installing SQL Server Service Pack for your reference.
    Steps to Install SQL Server 2008 Service Pack 1 (SP1):
    http://www.mssqltips.com/sqlservertip/1764/steps-to-install-sql-server-2008-service-pack-1-sp1/
    Thanks,
    Lydia Zhang

  • SQL Server 2012 Management Studio:Importing XML file to new Table of new Database-XML parsing: unexpected end of input???

    Hi all,
    In the Notepad, I created an xml file (ZenQroducts.xml) :
    <Qroducts>
    <Qroduct>
    <SKU>1</SKU>
    <Desc>Book</Desc>
    </Qroduct>
    <Qroduct>
    <SKU>2</SKU>
    <Desc>DVD</Desc>
    </Qroduct>
    <Qroduct>
    <SKU>3</SKU>
    <Desc>Video</Desc>
    </Qroduct>
    In my SQL Server 2012 Management Studio, I executed the following code:
    --to create a new object Qroducts in a new database OPENXMLtesting
    CREATE DATABASE OPENXMLtesting
    GO
    CREATE TABLE Qroducts(
    sku INT Primary KEY,
    qroduct_desc VARCHAR(30));
    INSERT INTO Qroducts (sku, qroduct_desc)
    SELECT X.qroduct.query('SKU').value('.', 'INT'),
    X.qroduct.query('Desc').value('.', 'VARCHAR(30)')
    FROM (
    SELECT CAST(x AS XML)
    FROM OPENROWSET(
    BULK 'H:\ZenQroducts.xml',
    SINGLE_BLOB) AS T(x)
    ) AS T(x)
    CROSS APPLY x.nodes('Qroducts/Qroduct') AS X(qroduct);
    SELECT sku, qroduct_desc
    FROM Qroducts;
    I got the following message:
    Msg 9400, Level 16, State 1, Line 6
    XML parsing: line 13, character 12, unexpected end of input
    I have no ideas why I got this "XML parsing:line 13, character12, unexpected end of input" message. Please kindly help, advise me on where I made mistake and how I can resolve this problem, and respond in this Forum.
    Thanks in advance,
    Scott Chang
     

    Hi Manish, Thanks for your response.
    Yes, it is a duplicate with Qroducts/Qroduct instead of Products/Product. I did it, because I don't know how to remove the existing "Products" database.
    Again, I got the existing "Qroducts" database in this second trial!!??  I am comletely lost in doing "Importing XML file to SQL Table" now!!  I think that I have not touched T-SQL and XML programming, since 2008. I
    did not catch the new features of T-SQL 2008, XML, SQL/XML, XQuery, etc. for long time. Recently, I did not know what DECLARE, @x, SET,...were, and dived into the SQL/XML and XQuery programming. I knew the SQL Basics (SELECT, FROM, WHERE,..), creating
    the names of databases and tables in SQL Server 2008/2012 Management Studio (Express) before. This morning, I found an old T-SQL 2008 Prgrammer's Guide that has the new features of SQL Server 2008 for T-SQL, XML, XQuery, etc. I just starting reading
    it to know what DECLARE, @x, SET,... are. But, I still don't know where the existing databases "Products" and "Qroducts" (created by me) are - they are not in the Databases of SQL Server 2012 Management Studio I am using!!??  Could
    you please kindly point out where the "Products" and "Qroducts" databases are?
    Prashanth responded to my posted question too and he asked to to try his code: DECLARE @xml XML, SELECT @xml =' <Qroducts>.....SELECT product.value.....FROM @XML.nodes.....AS.... I just learned that his code is doing the thing we
    want to do and print the results below the SQL Query. This is not what I need in doing my SQL/XML programming. I am reading/studying the new (2008) features of T-SQL, XQuery 1.0: An XML Query Language (Second Edition), and Microsoft XQuery Language Reference
    (SQL Server 2012 Books Online) closely now. I hope that I can resume the T-SQL, XML Query, SQL/XML, XQuery in my SQL Server 2012 Management Studio soon.
    Please tell me  where the existing databases "Products" and "Qroducts" I created in my previous trials in my SQL Server 2012 Management Studio.  This is what I need to know and to delete them, before I do this kind of "Importing
    XML file to Table of SQL Server 2012 Management Studio"  programming again.
    Please kindly help, advise and respond again.
    Many Thanks,
    Scott Chang

  • SQL Server 2012 Multi-Site clustering with 2 nodes for HA and DR

    Usually we setup 2 Node Prod cluster for Local HA and 1 or 2 Nodes in other data centre for DR
    Given that we have an option to setup multi-site / multi-subnet clustering from SQL 2008 R2/2012. I am planning to use just 2 nodes, 1 in prod data centre and 1 in DR data centre with 2 or 3 instances. This will act as both HA and DR solution.
    I would like to know if this solution is good, and any disadvantages, any best practices, etc.? By implementing this I can save some cost on physical servers.
    Following will be configured:
    * Will be using different subnets, quorum on different server with "Node and File Share Majority"
    * All virtual IPs will be registered for virtual name, and Subnetdelay, Subnet threshold will be modified accordingly
    * All nodes on same domain
    * Use SAN Disk with replication to DR site

    SQL 2008 R2 doesn't support multi-subnet clustering. You would still need 3rd party component like VLAN and Disk Replication. SQL 2012 is the first version to support multi-subnet clustering without using VLAN. you would still need disk replication hardware/software.
    Taken from my book
    Since nodes are often located in two different data centers at geographically dispersed locations, there is no shared storage between the nodes in a multi-site cluster. Clustering across two different data centers provides a higher level of availability and
    protection at the storage level as we have more than a single copy of the data.
    For SAN replication technology implemented in such clusters, the main activity is to keep data replicated between the sites. Typically, if we have nodes on two different sites, we would have two different network infrastructures and the nodes would be in
    different subnets. In such cases, if we are on a SQL Server version before 2012, we need to use third party VLAN (Virtual LAN) technology so that one IP address travels between two sites. This is called wide-IP. Companies hesitate with this solution because
    of the need to buy a third party solution to deploy the VLAN. Using VLAN technology means the same IP address would failover to the remote site in case of a local site disaster. Network administration might consider this as an overhead to maintenance and an
    extra piece of the networking component that needs to be secure.
    With SQL Server 2012 we do not need to use stretch VLAN technology but SAN replication is still needed for multi-site clustering. The OS version for this can be from Windows Server 2008 R2 and above. In this deployment, we can have a SQL virtual network
    name having an “OR” dependency on two different IP addresses. One address would be representing each subnet. With the “OR” dependency, if IP1 or IP2 is online we just use the network name. This is one of the Enterprise Editions only features.
    Other option which you can think of, without using 3rd party solutions would be AlwaysOn Availability Group. I have written details about it in my book.
    Balmukund Lakhani | Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    This posting is provided "AS IS" with no warranties, and confers no rights.
    My Blog |
    Team Blog | @Twitter
    Author: SQL Server 2012 AlwaysOn -
    Paperback, Kindle

  • SQL Server 2012 Management Studio: Import XML File to SQL Table - XML parsing: illegal qualified name character

    Hi all,
    In my SQL Server 2012 Management Studio, I executed the following code:
    CREATE TABLE Products(
    sku INT Primary KEY,
    product_desc VARCHAR(30));
    INSERT INTO Products (sku, product_desc)
    SELECT X.product.query('SKU').value('.', 'INT'),
    X.product.query('Desc').value('.', 'VARCHAR(30)')
    FROM (
    SELECT CAST(x AS XML)
    FROM OPENROWSET(
    BULK 'H:\ZenProducts.xml',
    SINGLE_BLOB) AS T(x)
    ) AS T(x)
    CROSS APPLY x.nodes('Products/Product') AS X(product);
    SELECT sku, product_desc
    FROM Products;
    I got the following message:
    Msg 9455, Level 16, State 1, Line 5
    XML parsing: line 3, character 12, illegal qualified name character
    I have no ideas why the "product" in the statement "SELECT X.product.query('SKU').value('.','INT')" is not legal qualified name charcter!!!???  Please kindly help, advise and respond.
    Thanks in advance,
    Scott Chang

    Hi Manish, Thanks for your response.
    Here is a copy of my ZenProducts.xml:
    <Products>
    <Product>
    <SKU>1<</SKU>
    <Desc>Book</Desc>
    </Product>
    <Product>
    <SKU>2<</SKU>
    <Desc>DVD</Desc>
    </Product>
    <Product>
    <SKU>3<</SKU>
    <Desc>Video</Desc>
    </Product>
    I found the wrong "<<" in my xml file and changed it to the right "<" for the statement<SKU>1</sku>. I executed the corrected code and I got the following new message:
    Msg 2714, Level 16, State 6, Line 1
    There is already an object named 'Products' in the database.
    I don't know how to remove the old, existing the 'Products' object in the database and execute the corrected code again. Please kindly help, advise and tell me how to resolve this new problem.
    Many Thanks,
    Scott Chang
    P. S. I played with another project to get the 'Products' object in my database before. Frankly, I don't know where the old 'Products' object and the database are. Please enlighten me in resolving this matter more clearly.
    You welcome Scott, As Olaf mentioned in this post, there was already a table exists , so need to drop your Products table.
    Apart from this, I guess either you did not pasted the full XML file or what, I needed to have the (  </Products>)closing tag in your XML file as follows.
    <Products>
    <Product>
    <SKU>1</SKU>
    <Desc>Book</Desc>
    </Product>
    <Product>
    <SKU>2</SKU>
    <Desc>DVD</Desc>
    </Product>
    <Product>
    <SKU>3</SKU>
    <Desc>Video</Desc>
    </Product>
    </Products>
    You can use following script to drop if your 
    Products table is already existing.
    if exists(select 1 from sys.tables where name ='Products')
    drop table Products
    CREATE TABLE Products(
    sku INT Primary KEY,
    product_desc VARCHAR(30));
    INSERT INTO Products (sku, product_desc)
    SELECT X.product.query('SKU').value('.', 'INT'),
    X.product.query('Desc').value('.', 'VARCHAR(30)')
    FROM (
    SELECT CAST(x AS XML)
    FROM OPENROWSET(
    BULK 'H:\ZenProducts.xml',
    SINGLE_BLOB) AS T(x)
    ) AS T(x)
    CROSS APPLY x.nodes('Products/Product') AS X(product);
    SELECT sku, product_desc
    FROM Products;
    Let us know if you face any other problem.
    Thanks
    Manish
    Please click Mark as Answer if my post solved your problem and click
    Vote as Helpful if this post was useful.

  • SQL Server 2012 Express bulk Insert flat file 1million rows with "" as delimeter

    Hi,
    I wanted to see if anyone can help me out. I am on SQL server 2012 express. I cannot use OPENROWSET because my system is x64 and my Microsoft office suit is x32 (Microsoft.Jet.OLEDB.4.0).
    So I used Import wizard and is not working either. 
    The only thing that let me import this large file, is:
    CREATE TABLE #LOADLARGEFLATFILE
    Column1
    varchar(100), Column2 varchar(100), Column3 varchar(100),
    Column4 nvarchar(max)
    BULK INSERT
    #LOADLARGEFLATFILE
    FROM 'C:\FolderBigFile\LARGEFLATFILE.txt'
    WITH 
    FIRSTROW = 2,
    FIELDTERMINATOR ='\t',
    ROWTERMINATOR ='\n'
    The problem with CREATE TABLE and BULK INSERT is that my flat file comes with text qualifiers - "". Is there a way to prevent the quotes "" from loading in the bulk insert? Below is the data. 
    Column1
    Column2
    Column3
    Column4
    "Socket Adapter"
    8456AB
    $4.25
    "Item - Square Drive Socket Adapter | For "
    "Butt Splice" 
    9586CB
    $14.51
    "Item - Butt Splice"
    "Bleach"
    6589TE
    $27.30
    "Item - Bleach | Size - 96 oz. | Container Type"
    Ed,
    Edwin Lopera

    Hi lgnusLumen,
    According to your description, you use BULK INSERT to import data from a data file to the SQL table. However, to be usable as a data file for bulk import, a CSV file must comply with the following restrictions:
    1. Data fields never contain the field terminator.
    2. Either none or all of the values in a data field are enclosed in quotation marks ("").
    In your data file, the quotes aren't consistent, if you want to prevent the quotes "" from loading in the bulk insert, I recommend you use SQL Server Import and Export Wizard tools in SQL Server Express version. area, it will allow to strip the
    double quote from columns, you can review the following screenshot.
    In other SQL Server version, we can use SQL Server Integration Services (SSIS) to import data from a flat file (.csv) with removing the double quotes. For more information, you can review the following article.
    http://www.mssqltips.com/sqlservertip/1316/strip-double-quotes-from-an-import-file-in-integration-services-ssis/
    In addition, you can create a function to convert a CSV to a usable format for Bulk Insert. It will replace all field-delimiting commas with a new delimiter. You can then use the new field delimiter instead of a comma. For more information, see:
    http://stackoverflow.com/questions/782353/sql-server-bulk-insert-of-csv-file-with-inconsistent-quotes
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • SQL Server 2012 Undetected Deadlock in a table with only one row

      We have migrated our SQL 2000 Enterprise Database to SQL 2012 Enterprise few days ago.
      This is our main database, so most of the applications access it.
      The day after the migration, when users started to run tasks, the database access started to experiment a total failure.
      That is, all processes in the SQL 2k12 database were in lock with each other. This is a commom case of deadlock, but the Database Engine was unable to detect it.
      After some research, we found that the applications were trying to access a very simple table with only one row. This table has a number that is restarted every day and is used to number all the transactions made against the system.   So, client
    applications start a new transaction, get the current number, increment it by one and commit the transaction.
      The only solution we found was to kill all user processes in SQL Server every time this situation occurs (no more than 5 minutes when all clients are accessing the database).
      No client application was changed in this migration and this process was working very well for the last 10 years.
      The problem is that SQL 2k12 is unable to handle this situation compared to SQL 2k.
      It seems to occurs with other tables too, but as this is an "entry table" the problem occurs with it first.
      I have searched internet and some suggest some workarounds like using table hints to completely lock the table at the begining of the transaction, but it can't be used to other tables.
      Does anyone have heard this to be a problem with SQL 2k12? Is there any fixes to make SQL 2k12 as good as SQL 2k?

    First off re: "Unfortunatelly, this can't be used in production environment as exclusive table lock would serialize the accesses to tables and there will be other tables that will suffer with this problem."
    This is incorrect. 
    Using a table to generate sequence numbers like this is a bad idea exactly because the access must be serialized.  Since you can't switch to a SEQUENCE object, which is the correct solution, the _entire goal_ of this exercise to find a way to properly
    serialize access to this table.  Using exclusive locking will not be necessary for all the tables; just for the single-row table used for generating sequence values with a cursor.
    I converted the sample program to VB.NET:
    Public Class Form1
    Private mbCancel As Boolean = False
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Dim soConn As ADODB.Connection
    Dim soRst As ADODB.Recordset
    Dim sdData As Date
    Dim slValue As Long
    Dim slDelay As Long
    'create database vbtest
    'go
    ' CREATE TABLE [dbo].[ControlNumTest](
    ' [UltData] [datetime] NOT NULL,
    ' [UltNum] [int] NOT NULL,
    ' CONSTRAINT [PK_CorreioNumTeste] PRIMARY KEY CLUSTERED
    ' [UltData] Asc
    ' )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 80) ON [PRIMARY]
    ' ) ON [PRIMARY]
    mbCancel = False
    Do
    ' Configure the Connection object
    soConn = New ADODB.Connection
    With soConn
    .ConnectionString = "Provider=SQLNCLI11;Initial Catalog=vbtest;Data Source=localhost;trusted_connection=yes"
    .IsolationLevel = ADODB.IsolationLevelEnum.adXactCursorStability
    .Mode = ADODB.ConnectModeEnum.adModeReadWrite
    .CursorLocation = ADODB.CursorLocationEnum.adUseServer
    .Open()
    End With
    ' Start a new transaction
    Call soConn.BeginTrans()
    ' Configure the RecordSet object
    soRst = New ADODB.Recordset
    With soRst
    .ActiveConnection = soConn
    .CursorLocation = ADODB.CursorLocationEnum.adUseServer
    .CursorType = ADODB.CursorTypeEnum.adOpenForwardOnly
    .LockType = ADODB.LockTypeEnum.adLockPessimistic
    .Open("SELECT * FROM dbo.ControlNumTest")
    End With
    With soRst
    sdData = .Fields!UltData.Value ' Read the last Date (LOCK INFO 1: See comments bello
    slValue = .Fields!UltNum.Value ' Read the last Number
    If sdData <> Date.Now.Date Then ' Date has changed?
    sdData = Date.Now.Date
    slValue = 1 ' Restart number
    End If
    .Fields!UltData.Value = sdData ' Update data
    .Fields!UltNum.Value = slValue + 1 ' Next number
    End With
    Call soRst.Update()
    Call soRst.Close()
    ' Ends the transaction
    Call soConn.CommitTrans()
    Call soConn.Close()
    soRst = Nothing
    soConn = Nothing
    txtUltNum.Text = slValue + 1 ' Display the last number
    Application.DoEvents()
    slDelay = Int(((Rnd * 250) + 100) / 100) * 100
    System.Threading.Thread.Sleep(slDelay)
    Loop While mbCancel = False
    If mbCancel = True Then
    Call MsgBox("The test was canceled")
    End If
    Exit Sub
    End Sub
    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
    mbCancel = True
    End Sub
    End Class
    And created the table
    CREATE TABLE [dbo].[ControlNumTest](
    [UltData] [datetime] NOT NULL,
    [UltNum] [int] NOT NULL,
    CONSTRAINT [PK_CorreioNumTeste] PRIMARY KEY CLUSTERED
    [UltData] Asc
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = on, FILLFACTOR = 80) ON [PRIMARY]
    ) ON [PRIMARY]
    go insert into ControlNumTest values (cast(getdate()as date),1)
    Then ran 3 copies of the program and generated the deadlock:
    <deadlock>
    <victim-list>
    <victimProcess id="processf27b1498" />
    </victim-list>
    <process-list>
    <process id="processf27b1498" taskpriority="0" logused="0" waitresource="KEY: 35:72057594039042048 (a01df6b954ad)" waittime="1970" ownerId="3181" transactionname="implicit_transaction" lasttranstarted="2014-02-14T15:49:31.263" XDES="0xf04da3a8" lockMode="X" schedulerid="4" kpid="9700" status="suspended" spid="51" sbid="0" ecid="0" priority="0" trancount="2" lastbatchstarted="2014-02-14T15:49:31.267" lastbatchcompleted="2014-02-14T15:49:31.267" lastattention="1900-01-01T00:00:00.267" clientapp="vbt" hostname="DBROWNE2" hostpid="21152" loginname="NORTHAMERICA\dbrowne" isolationlevel="read committed (2)" xactid="3181" currentdb="35" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128058">
    <executionStack>
    <frame procname="adhoc" line="1" stmtstart="80" sqlhandle="0x020000008376181f3ad0ea908fe9d8593f2e3ced9882f5c90000000000000000000000000000000000000000">
    UPDATE [dbo].[ControlNumTest] SET [UltData]=@Param000004,[UltNum]=@Param000005 </frame>
    <frame procname="unknown" line="1" sqlhandle="0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000">
    unknown </frame>
    </executionStack>
    <inputbuf>
    (@Param000004 datetime,@Param000005 int)UPDATE [dbo].[ControlNumTest] SET [UltData]=@Param000004,[UltNum]=@Param000005 </inputbuf>
    </process>
    <process id="processf6ac9498" taskpriority="0" logused="10000" waitresource="KEY: 35:72057594039042048 (a01df6b954ad)" waittime="1971" schedulerid="5" kpid="30516" status="suspended" spid="55" sbid="0" ecid="0" priority="0" trancount="1" lastbatchstarted="2014-02-14T15:49:31.267" lastbatchcompleted="2014-02-14T15:49:31.267" lastattention="1900-01-01T00:00:00.267" clientapp="vbt" hostname="DBROWNE2" hostpid="27852" loginname="NORTHAMERICA\dbrowne" isolationlevel="read committed (2)" xactid="3182" currentdb="35" lockTimeout="4294967295" clientoption1="671156256" clientoption2="128058">
    <executionStack>
    <frame procname="adhoc" line="1" sqlhandle="0x020000003c6309232ab0edbe0a7790a816a09c4c5ac6f43c0000000000000000000000000000000000000000">
    FETCH API_CURSOR0000000000000001 </frame>
    <frame procname="unknown" line="1" sqlhandle="0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000">
    unknown </frame>
    </executionStack>
    <inputbuf>
    FETCH API_CURSOR0000000000000001 </inputbuf>
    </process>
    </process-list>
    <resource-list>
    <keylock hobtid="72057594039042048" dbid="35" objectname="vbtest.dbo.ControlNumTest" indexname="PK_CorreioNumTeste" id="lockff6e6c80" mode="U" associatedObjectId="72057594039042048">
    <owner-list>
    <owner id="processf6ac9498" mode="S" />
    <owner id="processf6ac9498" mode="U" requestType="wait" />
    </owner-list>
    <waiter-list>
    <waiter id="processf27b1498" mode="X" requestType="convert" />
    </waiter-list>
    </keylock>
    <keylock hobtid="72057594039042048" dbid="35" objectname="vbtest.dbo.ControlNumTest" indexname="PK_CorreioNumTeste" id="lockff6e6c80" mode="U" associatedObjectId="72057594039042048">
    <owner-list>
    <owner id="processf27b1498" mode="U" />
    <owner id="processf27b1498" mode="U" />
    <owner id="processf27b1498" mode="X" requestType="convert" />
    </owner-list>
    <waiter-list>
    <waiter id="processf6ac9498" mode="U" requestType="wait" />
    </waiter-list>
    </keylock>
    </resource-list>
    </deadlock>
    It's the S lock that comes from the cursor read that's the villian here.  U locks are compatible with S locks, so one session gets a U lock and another gets an S lock.  But then the session with an S needs a U, and the session with a U needs an
    X.  Deadlock. 
    I'm not sure what kind of locks were taken by this cursor code on SQL 2000, but on SQL 2012, this code is absolutely broken and should deadlock.
    The right way to fix this code is to add (UPDLOCK,SERIALIZABLE) to the cursor
    .Open("SELECT * FROM dbo.ControlNumTest with (updlock,serializable)")
    So each session reads the table with a restrictive lock, and you don't mix S, U and X locks in this transaction.  This resolves the deadlock, but requires a code change.
    I tried several things that didn't require a code, which did not resolve the deadlock;
    1) setting ALLOW_ROW_LOCKS=OFF ALLOW_PAGE_LOCKS=OFF
    2) SERIALIZABLE isolation level
    3) Switching OleDB providers from SQLOLEDB to SQLNCLI11
    Then I replaced the table with a view containing a lock hint:
    CREATE TABLE [dbo].[ControlNumTest_t](
    [UltData] [datetime] NOT NULL,
    [UltNum] [int] NOT NULL,
    CONSTRAINT [PK_CorreioNumTeste] PRIMARY KEY CLUSTERED
    [UltData] Asc
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = on, FILLFACTOR = 80) ON [PRIMARY]
    ) ON [PRIMARY]
    go
    create view ControlNumTest as
    select * from ControlNumTest_t with (tablockx)
    Which, at least in my limited testing, resovlved the deadlock without any client code change.
    David
    David http://blogs.msdn.com/b/dbrowne/

  • Moving the log file of a publisher database SQL Server 2008

    There are many threads on this here. Most of them not at all helpful and some of them wrong. Thus a fresh post.
    This post regards SQL Server 2008 (10.0.5841)
    The PUBLISHER database primary log file which is currently of 3 blocks and not extendable,
    must be moved as the LUN is going away.
    The database has several TB of data and a large number of push transactional replications as well as a couple of bi-directional replications.
    While the primary log file is active, it is almost never (if ever) used due to its small fixed size.
    We are in the 20,000 TPS range at peak (according to perfmon). This is a non-trivial installation.
    This means that
    backup/restore is not even a remotely viable option (it never is in the real world)
    downtime minimization is critical - measured in minutes or less.
    dismantling and recreating the replications is doable, but I have to say, I have zero trust in the script writer to generate accurate scripts. Many of these replications were originally set up in older versions of SQL Server and have come along for the
    ride as upgrades have occurred. I consider scripting everything and dismantling the whole lot pretty high risk. In any case, I do not want to have to reinitialize any replications as this takes, effectively, an eternity.
    Possible solution:
    The only option I can think of is to wind down everything, such that there are zero outstanding uncommitted transactions and detach the database, delete the offending log file and reattach using the CREATE DATABASE xyz ATTACH_REBUILD_LOG option.
    This should, if I have understood things correctly, cause SQL Server to recreate the default log file in the same directory as the .mdf file. I am not sure what will happen to the secondary log file which is not moving anywhere at this point.
    The hard bit is insuring that every transaction in the active log files have been replicated before shutdown. This is probably doable. I do not know how to manually flush any left over transactions to replication. I expect if I shut down all "real"
    activity and wait for a certain amount of time, eventually all the replications will show "No replicated transactions are available" and then I would be good to go.
    Hillary, if you happen to be there, comments appreciated.

    Hi Philip
    you should try this long back suggested way of stopping replication and restore db and rename or detach attach
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/6731803b-3efa-4820-a303-4ffb7edf154a/detaching-a-replicated-database?forum=sqlreplication
    Thanks
    Saurabh Sinha
    http://saurabhsinhainblogs.blogspot.in/
    Please click the Mark as answer button and vote as helpful
    if this reply solves your problem
    I do not wish to be rude, but which part of the OP didn't you understand?
    Specifically the bit about 20,000 transactions a second and database size of several TB. Do you have any concept whatsoever of what this means? I will answer for you, "no, you are clueless" as your answer clearly shows.
    Stop wasting bandwidth by proposing pointless and wrong solutions which indicate that you did not read the OP, or do you just do this to generate points?
    Also, you clearly failed to notice that I was on the thread to which you referred, and I had some pointed comments to make. This thread was an attempt to garner some input for an alternative proposal.

  • Ssis - import data from flat file to table (sql server 2012)

    i have create a ssis for importing data from flat file to table in sql server 2012.
    but i got the below error for some column in data flow task.
    error: cannot processed because than one code page (950 and 1252)
    anyone helps~

    Hi,
    The issue occurs because the source flat file uses ANSI/OEM – Tranditional Chinese Big5 encoding. When processing the source file, the flat file connection manager uses code page 950 for the columns. Because SQL Server uses code page to perform conversions
    between non-Unicode data and Unicode data, the data in the code page 950 based input columns cannot be loaded to code page 1252 based destination columns. To resolve the issue, you need to load the data into a SQL Server destination table that includes Unicode
    columns (nchar or nvarchar), and convert the input columns to Unicode columns via Data Conversion or the Advanced Editor for the Flat File Source at the same time.
    Another option that may not be that practical is to create a new database based on the Chinese_Taiwan_Stroke_BIN collation, and load the data to non-Unicode columns directly.
    Reference:
    http://social.technet.microsoft.com/Forums/windows/en-US/f939e3ba-a47e-43b9-88c3-c94bdfb7da58/forum-faq-how-to-fix-the-error-the-column-xx-cannot-be-processed-because-more-than-one-code-page?forum=sqlintegrationservices 
    Regards,
    Mike Yin
    TechNet Community Support

  • Using WMI alert for mirroring in Sql server 2012

    We are using mirroring in Sql Server 2012  and we are using WMI alerts for some of events such as Connection lost,Manual failover,...
    In alert definition we have set the followings:
    Type: WMI event alert
    NameSpace:
    \\.\root\Microsoft\SqlServer\ServerEvents\MSSQLSERVER
    Query: select * from DATABASE_MIRRORING_STATE_CHANGE where State = 6
    The alert is bing triggered correctly,but on email description instead of having meaningful explaination like 'Connection lost',We have the same query:
    Query: select * from DATABASE_MIRRORING_STATE_CHANGE where State = 6
    We have used the same implementation in our Sql Server 2008 servers and it is working fine.This mashine (Sql Server 2012) is a new mashine.
    I would appreciate if someone help me on this.AlsoI checked and 'Include body of e-mail in notification message' was already set.
    Thanks
    Aspet
    A.G

    Are you looking for alerting related to mirroring like below ?
    http://www.mssqltips.com/sqlservertip/1859/monitoring-sql-server-database-mirroring-with-email-alerts/
    http://technet.microsoft.com/en-us/library/cc966392.aspx
    Raju Rasagounder Sr MSSQL DBA

  • Finalizing SQL Server 2012 SP2 update

    Hi,
       I just successfully upgraded SQL Server 2012 Developer Edition from SP1 CU8 to SP2.
       Here is the actual portrait I have in my control panel (Installed programs + version):
           Version changed after SP2 update (through Windows Update):
             Microsoft SQL Server 2012 Express LocalDB                          11.2.5058.0
            Microsoft SQL Server 2012 Transact-SQL ScriptDom              11.2.5058.0
            Microsoft SQL Server 2012 Transact-SQL Compiler Service    11.2.5058.0
            Microsoft SQL Server 2012 Native Client                                11.2.5058.0
            Microsoft SQL Server 2012 Policies                                        
    11.2.5058.0
            Microsoft SQL Server 2012 Setup (English)                            11.2.5058.0
            Microsoft VSS Writer for SQL Server 2012                              11.2.5058.0
            Microsoft System CLR Types for SQL Server 2012                  11.2.5058.0
            SQL Server Browser for SQL Server 2012                               11.2.5058.0
          Version changed only after installing corresponding Features Pack component:
             Microsoft SQL Server 2012 T-SQL Language Service              11.2.5058.0    
             SQL Server Report Builder 3 for SQL Server 2012                  11.2.5058.0
             Microsoft SQL Server 2012 Management Objects                   11.2.5058.0
          Version did not change:
             Microsoft SQL Server System CLR Types                                10.51.2500.0
             Microsoft SQL Server 2012 Data-Tier App Framework            11.1.2902.0
    My questions:
    1. Am I missing any components update or is my actual SP2 setup OK?
    2. Even if I tried to install DACFramework SP2 Feature pack by running corresponding installer, it told me that I had an higher version...  Does any of you have a different version number for this component?
    3. I actually have SSDT for VS2010 installed.  The corresponding versions I actually have are the following:
               Microsoft SQL Server Data Tools 2010                                 
    10.3.31009.2
               Microsoft SQL Server Data Tools - enu                                 
    10.3.31009.2
               Microsoft SQL Server Data Tools Build Utilities - enu             10.3.31009.2
        Should I consider upgrading any component so they work with SQL 2012 SP2 properly?  If so, could someone provide me the corresponding download/webpage links?
    4. Finally, should I upgrade to CU2 which is actually available. Among other problems, I notice that it should fix an index rebuild problem.  Any other major issues it targets?  Is there any easy way I can test if I should install this update or
    not?
    Thanks for helping.

    Hi again,
      I knew I was at SP2 level now.  My request is more about the Features Pack components as well as the CU2 which is actually out:
    1- Features Pack components that I couldn't update:
             Microsoft SQL Server System CLR Types                                10.51.2500.0    
    --> presume was for VS2008
             Microsoft SQL Server 2012 Data-Tier App Framework            11.1.2902.0       --> is this the real last version?
    2- SQL Server Data Tools vs Visual Studio 2010 SP1 + SQL Server 2012 SP2
               Microsoft SQL Server Data Tools 2010                                 
    10.3.31009.2
               Microsoft SQL Server Data Tools - enu                                 
    10.3.31009.2
               Microsoft SQL Server Data Tools Build Utilities - enu             10.3.31009.2
        Do I have the last versions possible (VS2010) or should I update something?
    3- SQL Server 2012 SP2 CU2
        What simple test can I do in order to verify if I really need to install this patch or not?
    Thanks for helping!

  • SQL Server 2012 Developer Edition Installation Problem

    Hi,
    I have just been given a new PC by my IT department so am trying to get all the software I need onto the PC. Since I am now running windows 7 I wanted to try SQL Server 2012, however whenever I go to install it, one of the checks always fails as follows:-
    SetupCompatibilityCheck
    Checks whether the current version of SQL Server is compatible with a later installed version.
    This version is not compatible with a later installed version. For more information, see the compatibility information at http://go.microsoft.com/fwlink/?LinkId=160850.
    All other checks are successful but no matter whether I use the MSDN disc the software is on or the downloaded copy, the software doesn't seem to like my PC. I don't understand how the software can believe there is something
    newer than SQL Server 2012 on the system. When I run the discovery tool elsewhere in the installer it reports that nothing is installed.
    Is anyone able to give me some information on what might be triggering this? I did install Visual Studio 2008 and Visual Studio 2010 on the system prior to this, as well as SQL Server 2008 R2, but I have since removed all of these products again in order
    to try and identify the cause of this problem. Now with nothing left on the system again, it still reports this same error. Could it be something is left over from those installations that is causing this problem? 
    Any help would be much appreciated
    Regards
    Paul

    (07) 2012-08-14 09:04:37 Slp: Initializing rule      : SQL Server Setup Product Incompatibility
    (07) 2012-08-14 09:04:37 Slp: Rule is will be executed  : True
    (07) 2012-08-14 09:04:37 Slp: Init rule target object: Microsoft.SqlServer.Configuration.SetupExtension.SetupCompatibilityCheck
    (07) 2012-08-14 09:04:37 Slp: Sco: Attempting to create base registry key HKEY_LOCAL_MACHINE, machine
    (07) 2012-08-14 09:04:37 Slp: Value cannot be null.
    Parameter name: version
    (07) 2012-08-14 09:04:37 Slp:    at System.Version..ctor(String version)
       at Microsoft.SqlServer.Configuration.SetupExtension.SetupCompatibilityCheck.Microsoft.SqlServer.Configuration.RulesEngineExtension.IRuleInitialize.Init(String ruleId)
       at Microsoft.SqlServer.Configuration.RulesEngineExtension.RulesEngine.Execute(Boolean stopOnFailure)
    (07) 2012-08-14 09:04:37 Slp: Rule initialization failed - hence the rule result is assigned as Failed
    Hi Paul,
    Any progress?
    This issue you met may be due to there are still registry keys left related to the SQL Server, even though we have uninstalled the SQL Server.
    To fix the issue, we can remove the left keys manually:
    1. Click 'Start' > 'Run' > type 'regedit' > press Enter key.
    2. Backup this registry keys that related to SQL Server under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
    3. Delete keys that relate to SQL Server under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall.
    4. Restart the setup installation.
    If you have any problem, please feel free to let me know.
    Thanks,
    Maggie
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.

  • SQL Server Data Tools – Business Intelligence for Visual Studio 2013 (SSDT BI) and SSIS on SQL Server 2012

    This great blog entry titled
    SQL Server Data Tools - Business Intelligence for Visual Studio 2013 (SSDT BI), link below, highlights the lack of support for SSIS projects using SQL Server 2012, VS 2013 and SSDT BI for VS 2013. I see there is a new version
    on SSDT BI for VS 2013 (12.0.2430.0, File Name: SSDTBI_x86_ENU.exe, Date Published: 10/27/2014) link below.
    Does this version support SSIS projects using SQL Server 2012 using VS 2013 and SSDT BI for VS 2013?
    http://blogs.msdn.com/b/analysisservices/archive/2014/04/02/sql-server-data-tools-business-intelligence-for-visual-studio-2013-ssdt-bi.aspx
    http://www.microsoft.com/en-us/download/details.aspx?id=42313

    Hi cjrinpdx,
    According to the picture, it seems that we can use SSIS 2012 support is not included in SSDT-BI for VS 2013. And based on the previous versions, SSIS always different from SSRS, SSAS.
    SSDT-BI for Visual Studio 2012 supports versions of SQL Server as follows:
    SSAS project can target SQL 2012 or lower
    SSRS project can target SQL 2012 or lower
    SSIS project can target only SQL 2012
    The following blog is for your reference:
    http://blogs.technet.com/b/dataplatforminsider/archive/2013/11/13/microsoft-sql-server-data-tools-update.aspx
    Since I have no environment to test this at this moment,
    I recommend you that submit the feedback at
    https://connect.microsoft.com/SQLServer/. 
    Thank you for your understanding.
    Regards,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

Maybe you are looking for

  • How to write data from planning folder into a planning cube in BPS

    Hi All, I have an issue in writing data from planning folder to planning cube. I updated the excel sheet in planning folder in UPSPL tcode. After clicking on save button in the excel sheet the data did not get updated into the cube. I set the real ti

  • Why when i connect my iphone it comes up with a different name

    when i connect my iphone to the computer it thinkes it my partners phone can anyone help me fix this

  • PRCI-1113 : Directory /u01/app/grid/product/11.2.0/gridhome does not exist

    Hi All, I have installed Clusterware 11gR2 on two node cluster Solaris 10 U9 SPARC. After that I run Oracle Database installer and clicked next. In Installation Options I checked ""Create and Configure Database". After that I got the error message: P

  • How to complile java programs?

    Hi, everyone I have a problem.I am working with eclipse and i have never tried to compile a java program with the dos. i think that the steps to do this are: "I have a project on Desktop in a folder named Tdma.There are some java files in this folder

  • About oracle development tools

    I have heard about oracle development tools are supported to use visual studio. I am confused , is it for developing whole application as we design in oracle designer and forms builder or just for debug the PL/SQL codes? please tell me about oracle d