Skip to main content

Q&A: Can you BCP out a #Temporary table?

Q: If I create a temporary table with: SELECT OrderID,OrderDate,Total INTO #TempOrders FROM Invoices Can I then BCP the data into a file with ?: … SET @cmd = ‘bcp “#TempOrders” out “C:TempOrders.txt” -T EXEC xp_cmdshell ‘bcp ‘ + A: No. Because BCP will create a new connection, it will not be able to see […]

Free Online Training for SQL Server 2005 from Microsoft

As part of Microsoft’s push to improve dba/developer knowledge and uptake of SQL Server 2005, Microsoft have released free training for SQL Server 2005 available online until 1st November 2006. There’s currently seven free courses covering installation, administration, programming and other features of SQL Server 2005. Included in each course are hands-on virtual labs, and […]

SQL Server 2005 June CTP Released

Today sees Microsoft release the June Community Technology Preview (CTP) of SQL Server 2005. It’s a public preview and can be downloaded by anyone (you don’t need a MSDN subscription for this one) By the same note, Microsoft also announced at Tech.Ed that they will be shipping SQL Server 2005 and Visual Studio 2005 in […]

DDL Trigger – Prevent and Notify DDL Changes

SQL Server 2005 allows you to create DDL Triggers in a database, that fire whenever someone attempts to change the structure of your database. Ever accidentally created tables / views / sprocs in the master database? Well Greg Low published a trigger you can place in the master database to prevent changes there. Apparently Greg’s […]

Setting your default database to tempdb

Personally I like to set the default database for all logins to tempdb. It helps people remember to select the correct database before they start doing things. If someone forgets to change their database, i’d rather them attempting to do crazy things in tempdb instead of master. There are some programs / install scripts that […]

Go home early with WAITFOR

It’s late at night, you’re still at work, waiting for long running task to complete so you can go home. Well why not make SQL Server 2005 wait for you? Well gather your things and make use of the new WAITFOR statement, thats been introduced as part of Service Broker. You can ask SQL Server […]