Categories
Bugs Visual Studio

Odd Database Project issue with VS 2010

Recently I stumbled upon really weird issue with VS 2010. We have bunch of database projects created in VS 2010 which are part of our regular development build. As part of my task, I was trying to automate deployment of these database projects using PowerShell and came across really really strange issue that I have never seen before.

I was simply checking out database project from our source control and using MSBUILD (aka MSFT Build Engine) to build and deploy the database project to my test SQL Server instances. Ideally what it does is it allows me to deploy that database at instance that I wish with database name of my selection. But with my surprise when I built and tried to deploy the project I was welcomed with this error …

 

Categories
Bugs Tips

Error Deploy01234: The target database schema provider could not be determined. Deployment cannot continue.

This was the error that I was getting when i was trying to deploy our database project to one of our test system in a batch script. To me it was a bit surprise because I had done same process many times in past and it has worked just fine. But today I spent hefty amount of time to resolve this issue. Whole error that I was getting was  something like below,

 

—— Deploy started: Project: Database, Configuration: Debug Any CPU ——

C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\TeamData\Microsoft.Data.Schema.TSqlTasks.targets(120,5): Error Deploy01234: The target database schema provider could not be determined.  Deployment cannot continue.

   Done executing task “SqlDeployTask” — FAILED.

  Done building target “DspDeploy” in project “TheDatabase.dbproj” — FAILED.

Done executing task “CallTarget” — FAILED.

Done building target “DBDeploy” in project “TheDatabase.dbproj” — FAILED.

Done building project “TheDatabase.dbproj” — FAILED.

Build FAILED.

 

Categories
Bugs SQL Server

Issue with Backup sets of Backup in SSMS 2012

Just like many fellow early adopters, me too have installed shiny new SQL Server 2012 in my work machine. And I have been using it quite a while. Since it is “Powered by Visual Studio” now it has look and feel of VS 2010 too (for me main reason was included support of BIDS … or say SSDT Smile). As a go-to guy for SQL Server, I am responsible for maintaining all SQL Server instances .. and every  now and then I have to play a role of DBA too.

Yesterday I ran into really strange issue. I have to restore a SQL Server 2008 R2 database to another machine with same edition. Since there were couple of devs around my desk to show off I fired up brand new SSMS 2012 (it feels really a bit nice when you have some toy to play with while others looking at you Winking smile … just kidding). All I had to do was to restore database using GUI just to show them how they can do by them self. But with my surprise when I opened up restore screen for database and pointed it to my backup what I saw was really strange (add shocking and disappointing). In new SSMS 2012 you will not see list of all backup sets inside your backup !!! Instead of that you will have to use so called new feature “TIMELINE” by browsing my backups using some stupid date time picker !! And this is really confusing because now I have to guess which backup I have to use because this TIMELINE doesn’t tell me exactly what were the dates when I took backups

To explain this issue I have prepared process which can be used to reproduce this issue. Following steps will reproduce the issue,

Categories
Babbling Bugs

And I have “4,294,967,295” messages in my inbox !!

I have more then 4 billion messages in my inbox, and without doubt I will be record holder for “the most emailed a person ever” or “person with super giant mail box” or “person who does nothing but keeps getting (and reading) emails” …..and so on …..

Don’t believe me … here is the proof … a snapshot from my mail client

thunderbird_messages

And say if each message is of minimal size, 1 KB then for all of these messages my local mail box will be of approximately 4TB in size !! (think of re-downloading all messages again if my PC dies Disappointed smile ) .. Pretty cool right ??

Categories
Bugs SQL Server

Resolving … Agent XPs disabled issue in SQL Server 2005

SQL Server sometimes behaves very strangely for no apparent reason. Few days back I was playing with our staging server and I had to stop SQL Server service for some testing purposes. When I started it back, I saw that SQL Server Agent was disabled and next to it a message showing that “Agent XPs disabled”

From my experience it generally means that SQL Server Agent service is not running. But looking at SQL Server Configuration Manager I found that service was just OK. But just to try, I restarted SQL Server Agent but I was still getting same message and disabled SQL Agent !!

After some googling I found that it is rather very common issue with SQL Server Agent !! Apparently sometimes for no reason, Agent XPs gets disabled in SQL Server environment. When I ran,

EXEC sp_configure 'Agent XPs'
Categories
Bugs SQL Server Visual Studio

Intellisense in SQL Server 2008 r2 management studio

This quick post is about my recent experience with SSMS for SQL Server 2008 r2. Usually I use some other 3rd party tool for SQL Server Development because it is sort of more easier to use when we are developing (but that tool is not good at all when it comes to managing SQL Server).

If you are a developer like me who is required to work with application but mostly deals with database … and you happen to use SSMS for SQL Server 2008 R2 then you might already have noticed that you have … hmm.. sort of lost … intellisense in SSMS (or SQL Server Management Studio, a default tool for interaction with SQL Server) after installing Visual Studio 2010 SP1 updated. This is really weird issue. I / We generally when release an update for our application we make sure that for any reasons our other applications that are using that one application doesn’t lose some functionality. And I don’t understand how come guys at such a professional company like MSFT don’t understand this common app release / testing process ??

Categories
Bugs SQL Server Tips

‘Delete ‘ with Alias in T-SQL

Last week I was working on something where I was required to write a delete query against few records in table. Now a days I am kind of habituated to use alias for tables whenever I write any query (mostly because of tool I am we are using for SQL development, which don’t have intellisence if alias is not being used for table name !!) and in other case it was join between two tables was required to delete records. So as with other query, I wrote my simple delete query with alias … and found that when you use alias delete statement is a bit different !!! Below is how I reproduced same issue in my laptop. (Note: Query is using a test table I created using good ol’ AdventureWorks sample database)

-- Delete from table using Alias
Delete from TableFoo TF where City='Renton'
go

But parsing this query gave me following error

Msg 102, Level 15, State 1, Line 1

Incorrect syntax near ‘TF’.