TOP

Copy a table from one database to another in SQL Server 2008

select * into Web_AllowanceAdjustment.dbo.SForceUser from Web_HearstSalesForce.dbo.[User]

Read More
TOP

SQL SERVER – 2008 – Configure Database Mail – Send Email From SQL Databas

http://blog.sqlauthority.com/2008/08/23/sql-server-2008-configure-database-mail-send-email-from-sql-database/

Read More
TOP

MSSql delete all tables from database

SELECT ‘DROP TABLE “‘ + TABLE_NAME + ‘”‘ FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME LIKE ‘[prefix]%’

http://stackoverflow.com/questions/4393/ms-sql-drop-all-tables-whose-names-begin-with-a-certain-string

This will generate a script…

Read More
TOP

MSSQL 2008 Enable FILESTREAM How TO

1. On the Start menu, point to All Programs, point to Microsoft SQL Server 2008, point to Configuration Tools, and then click SQL Server Configuration Manager.

2. In the list of services, right-click SQL Server Services, and then click Open.

3. In the SQL Server Configuration Manager snap-in, locate the instance of SQL Server on which you want to enable FILESTREAM.

4. Right-click the instance, and then click Properties.

5. In the SQL Server Properties dialog box, click the FILESTREAM tab.

6. Select the Enable FILESTREAM for Transact-SQL access check box.

7. If you want to read and write FILESTREAM data from Windows, click Enable FILESTREAM for file I/O streaming access. Enter the name of the Windows share in the Windows Share Name box.

8. If remote clients must access the FILESTREAM data that is stored on this share, select Allow remote clients to have streaming access to FILESTREAM data.

9. Click Apply.

10. In SQL Server Management Studio, click New Query to display the Query Editor.

11. In Query Editor, enter the following Transact-SQL code:

EXEC sp_configure filestream_access_level, 2
RECONFIGURE

12. Click Execute.

http://technet.microsoft.com/en-us/library/cc645923.aspx

Read More
TOP

SQL Statement select from one table where not in another table

select FileId
from Files
where FileId not in (select FileId
from FileComponentFile)

Read More
TOP

SQL where in

select * from FileAttribute

where  fID  in  (select fid from v_ers_hydropower)

Read More
TOP

MSSQL OpenQuery Example

SELECT *
FROM OPENQUERY(192.168.25.xxx, ‘
      SELECT *
      FROM table 
      WHERE column = ”value”
  ’)

Read More
TOP

Hottest Questions – Stack Overflow

http://stackoverflow.com/

lots of IT questions & answers

Read More
TOP

Migrating SQL Server 2000 to SQL Server 2008

http://www.dell.com/downloads/global/solutions/public/white_papers/SQL_2000_SQL_2008_Migration_Guide.pdf

Read More
TOP

How To Get Output Into SQL Server Table

Read More

Switch to our mobile site