SQL Server 2005 or Visual Studio 2005 - writing my first procedure, any tips or good starting points? - sql-server-2005

I'm about to write my first procedure to check if yesterdays data exists in one database, and if it select some of the data, use a count and insert that data into another database. If the data doesn't exist, then send me an email.
I'm using SQL Server 2005 and I'd like to ask the community for tips or good starting knowledge on smart procedure coding.
Thanks!

Here is an article on MSDN about stored procedures on SQL Serve 2005 that should help.

Related

Sql Server 2000 - table last modified

Does anyone know of ANY way to query a Sql Server 2000 database to find out when tables were last modified please?
It is unfortunately not stored in SQL 2000 unless you have custom columns storing that type of data for the table. So if you are looking for something built into SQL Server you are sadly out of luck.

How to merge tables from 2 databases in SQL Server 2008

I'm using SQL Server 2008 - just a standard edition. Sorry if this is a rather basic question, but I know very little about SQL
I have 2 databases I've previously created using Visual Studio that would now benefit from being merged. By merged I mean copying the tables from the 2nd database to the first and deleting the 2nd database.
Is there a simple way of doing this through the SQL Management Studio?
You can use OPENROWSET to read data from one database and merge it into another.
For example:
USE DBToMergeInto;
INSERT INTO TableToMergeInto
SELECT * FROM OPENROWSET
('SQLOLEDB',
'Trusted_Connection=yes;Server=192.168.1.1\ServerToMergeFrom',
'DbToMergeFrom.dbo.TableToMergeFrom')

How can I post updates (commits) in oracle db to SQL Server 2005

We have an application (BaaN) on Oracle Database.
We also have an application that is on SQL Server 2005 which uses Oracle (BaaN) contents.
Currently we cache all contents of the Oracle DB to SQL Server nightly through linked server from SQL Server to Oracle.
Thought of using a trigger on Oracle db tables to write contents to Oracle table (DeltaCommits) as the commits occur, and then periodically look for entries in DeltaCommits from SQL Server using a scheduled job.
Or can you please suggest a better way to accomplish this ..
Thanks
It's possible to use replication to transfer data between Oracle and SQL server.
This guide looks like a useful starting point which may help you to decide whether this is a route you want to consider.

How to compare DTSs in SQL Server 2005

Once your databases are converted from SQL Server 2000 to SQL Server 2005, is there any way to compare DTSs on two servers to see if they are still essentially the same? I need to see if my dev and prod are the same, and comparing them manually is really time consuming.
If they were still in 2000, I could use the Red-Gate tool DTS Compare, but that doesn't work in 2005. I can save each as a Visual Basic file, and then compare those (and that kind of works), but the steps may be output in a different order. Is there something out there that is better?
I would say, don't use DTS jobs in SQL Server 2005.
There are a complete new and reworked method to do those things: SSIS.
Here you find an introduction:
http://www.accelebrate.com/sql_training/ssis_tutorial.htm
Yes, maybe you can't compare it perfectly, but DTS Jobs are run out of support since SQL 2005 (remember, we are in 2009 :) )

Creating a job in SQL Server 2005

Am pretty new to SQL Server 2005. Can someone help me to create a job in SQL Server? This link(http://www.databasedesign-resource.com/sql-server-jobs.html) says to create under the jobs category in managememt tab. But i am not able to find one such category in my SQL Server Management Studio. Is it not possible to create a job using stored procedures or queries?
Thanks,
Geetha
In 2005 it's sql server agent -> jobs
For tsql read this