Learning SQL Server 2008 & Stored Procedures - mysql

I have a background in LAMP development and have recently started learning sql server. Whilst the principles of databases are the same, there are a lot of features in SQL Server that are not abundant in or are different to a simple MySQL database, e.g. stored procedures, syntax etc
Can anyone recommend any decent books that encompass the bespoke features possessed by sql server (vs MySQL) perhaps something that is geared towards someone who has underlying knowlegde of RDBMS's..

Microsoft® SQL Server® 2008 T-SQL Fundamentals - I got this book when SQL 2008 came out and it gives you a good wrap on what SQL Server Transact SQL can offer you.

Try Paul Nielsen's Sql Server Bible, its good enough

Related

Convert stored procedures from SQL Server 6.5 to SQL Server 2008

I have been using SQL Server 6.5. I am now migrating to SQL Server 2008. How can I restore the stored procedures and data in an easy way.
This would not be easy way since there were some major changes from 6.5 to 7.
One of the ways i suggest to estimate is following:
Upgrade to sql server 2000 first. SQL 2000 has a compatibility option for 6.5 (and 2008 doesnt have it).
After that upgrade to 2008.
Possibly this wont protect you from rewriting your code. Two things i can remember for now are
1) you will have to change all double quotes " to single quote '
2) you will have to check all the NULL checks
I am not sure if the way i suggest will automate all this for you, but chance is this way will save you some time.

Which is the best for Microsoft SQL Server 2008

Which is the best for Microsoft SQL Server 2008? I would like to have information on PIVOT, Triggers, Stored Procedures, CLR integration, Service Broker etc all in one book.
Read SQL Books on line.
Books are a very personal choice. So its hard to recommend 1. But i find the publishers wrox and o'reilly do an excellent range of books on SQL and other topics.

sql-server-2008 audit tables

In one of my application Iam using SQL SERVER 2008, I like to implement audit tables for few tables. One option I have to create triggers on the respective tables. Can anyone suggest me any other good, robust and secure option.
SQL Server 2008 has a new auditing feature: Auditing in SQL Server 2008.
There is also Change Data Capture
Triggers are the usual way to go. Another option could be to handle this in your stored procedures. Of course this assumes, that all data modification goes via stored procedure. Since you are on SQL Server 2008 and assuming you don't care about any lower version, check out the new auditing features here: http://msdn.microsoft.com/en-us/library/dd392015.aspx
You don't mentione which edition of SQL Server you are using as the Auditing features are only available in the Enterprise edition.
You should download a copy of the free eBook Developing Time-Oriented Database Applications in SQL by Richard T. Snodgrass from here: http://www.cs.arizona.edu/people/rts/tdbbook.pdf.
He talks about auditing and many other time related issues in databases.

Is there an alternative to the Adventureworks database for SQL Server 2008?

I want to use something lighter than adventureworks. Is there an alternative at all? I have had a look at the Chinook database, but I just want see if there is an alternative. Google search doesn't help either.
Microsoft SQL Server Community Projects & Samples
Microsoft SQL Server Product Samples: Databases

How can I detect which version of SQL (eg SQL 2008 or SQL Azure)

I need to detect which version of SQL I am dealing with to perorm various tasks, I need specifically detect if I am on SQL 2008 or SQL Azure.
How can I do this with detection code written in SQL?
A good place to start might be: Programmatically detect SQL Server Edition.