SQL Server

SQL SSIS, insert only new rows.

SSIS workflow is really amazing when you have to add some automatism in your data flow processes. But sometimes is better to make same checks before start with a really dangerous BULK operation. One of the most noise stuff I have to do is to launch insert of new records when I receive updates from web (web services, XML data). But when I do this I'm always afraid about duplicated rows. Ho to check if a row exist, in SSIS? SSIS Package contains a component called lookup. Very intuitive name. So if you need to insert only...

Write intelligent query with if exist ... drop.

Usually when we build a query we start the .sql file, or command in the query editor with a simple command ... CREATE PROCEDURE ... bla bla bla. Ok but if I'm building a database from scratch is very probably that my procedure will be modified a lot of time. So every time we have to launch the command DROP PROCEDURE, or ALTER PROCEDURE. This sounds good if you are building your object. But in case of you want to store as a BACKUP PROCEDURE some scripts in the network, is better to produce this scripts as ATOMIC...

SQL 2005 and Linked server (Cannot obtain the schema rowset "DBSCHEMA_TABLES_INFO")

If you have a SQL 2005 machine with a (x64) installation, some of the system queries have a different name, like [some_command]sys_64. So when you try to connect your powerfull SQL2005 to an old remote SQL2000, probably in x32 version, you can receive a strange error like Cannot obtain the schema rowset "DBSCHEMA_TABLES_INFO". In many forums you can find a link to a microsoft KB that explains to you that you have to install the SP4 in the old SQL and maybe everything will done. Usually I like to know why something doesn't run ... So, when you execute from SQL2005 a...