sql-server-2008

Mail Headers in SQL Server Database Mail

I am using SQL Server 2008 Database Mail feature to send emails. How do I add custom headers in mail message. ...

SQL server remote connection enable

I am able to do remote enable sql server 2008 through the following way: All sql service start TCP/IP enable Named Pipes enable set TCP port(1433) and UDP port(1434) through the windows firewall Set TCP port(14792) of sql server. But this problem has been solved in some network..... I have tried to solve in another office by same pr...

Difference between SQL Server 2008 vs SQL server 2008 native client ?

I want to know the wt is the exact difference between SQL Server 2008 vs SQL server native client ? ...

SQL Server 2008 create database issue

Hello everyone, I want to create a SQL Server 2008 database, and I need to create the database on a network shared location, like \\10.10.10.123\share, but this network shared location is protected by a username and password. My question is, how to assign such username and password in SQL Server create database statement? BTW: I have ...

Symmetric Encryption in SQL Server 2008

When I use Symmetric Encryption on a database and then back it up and then restore it to another SQL Server and use the same keys I can't decrypt the data. Is there a way around this? Using SQL Server 2008 Code: GO CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'PASSWORD' GO CREATE CERTIFICATE PasswordFieldCertificate WITH SUBJECT = ...

Can I edit extended properties for a table using Management Studio 2008?

I want to edit the description of a table object using Mgt Studio with SQL 2008. It doesn't look like there is a GUI was to do it anymore. Am I missing it? ...

SQL 2008 Spatial ordering of objects

I have a dataset containing the start and end points (both OSGB36 and corresponding WGS84 coordinates) of sections of a road network. I am able to import this data in SQL and create geometry and geography data types for the start and end points and for the entire object (LINESTRING etc). Viewing the coordinates in SQL query window enab...

Getting metadata from another database in an sproc in SQL Server?

How do I create a stored procedure that exists in one database but runs the below code against another (any) database? SET @sql1 = N'INSERT INTO #Tables SELECT' + N' t.TABLE_NAME as TableName' + N',t.TABLE_SCHEMA as SchemaName' + N',(SELECT OBJECTPROPERTY(OBJECT_ID(t.TABLE_SCHEMA + ''.'' + t.TABLE_NAME),''T...

SQL Sever 2008 Database Project deployment issue

hi I'm having issue with how to to deploy (a SQL2008 project) to multiple dbs. I'm using VS2010 + SQL Server 2008 Database project, it imports the "DevDB", works all fine. Now I want to deploy it to a different DB "TestDB", both DBs are on the same SQL server. It's keep complained about ".mdf and .log" conflicts. In SQL 2005 db proje...

OPENROWSET & SQL Server 2008 Security (SSAS)

Hi! I try to fill a SSAS Mining Model with Data from a (local) SQL Server Table Both SQL Server and SSAS (all 2008) are on the same (devlopment machine) WinXP64. SQL Server Security is 'Windows Authentication' MDX Code: INSERT INTO MINING STRUCTURE [ttseries] ( [col1], [col2], [col3], [col4] ) OPENROWSET( 'SQLOLEDB', 'Server=(local...

SQL Server 2008 - Transparent Data Encryption undecrypted access

My question is a duplicate of - http://stackoverflow.com/questions/2230189/oracle-transparent-data-encryption-undecrypted-access - but for SQL Server 2008. Can I set up a SQL Server 2008 database in a way that all of the following statements are true? a) certain columns, potentially all columns are encrypted, so that direct file acce...

xp_md5.dll for 64-bit

I am right now using this extended stored procedure in one of the test database on sql server 2008 and it works fine. I tried to do the same on a different sql server and it did not work on that. Then I got an explaination that the former was a 32 bit processor and latter was a 64 bit processor. Is there anyway to make use of this extend...

Update trigger insert Null

Hi! I am trying to create trigger on SQL Server 2008. I want that if i update field in tabele log that the new value update field in another table Doc. This is the code for trigger: Create TRIGGER dbo.DocSt ON dbo.log AFTER UPDATE IF (SELECT COUNT(*) FROM inserted) > 0 BEGIN IF (SELECT COUNT(*) FROM deleted) > 0 ...

Sql 2008 Developer to Sql Azure Migration

Hi My company is deciding for switching its existing application to azure platform (only Sql Part). So we need to upload our db from local to cloud. For migration i came across various tools like 1. cerebrata 's tools 2. SqlAzure Migration wizard 3. Microsoft Sql Data Sync 4. Conventional Script way via management studio. But all the a...

Keys/indexes for revisions of user submitted text

I have a table: id:int revision:int text:ntext In general I will need to retrieve the latest revision of text for a particular id, or (considerably less frequently) add a new row containing a new revision for a particular id. Bearing this in mind, it would be a good idea to put indexes on the id and revision columns. I don't have a pr...

how to schedule backup in sql server 2008 ?

how can I schedule daily backup at 9:00pm in SQL server 2008? ...

Customise default 'New Stored Procedure' SSMS 2008 Template

I am trying to customise the default query which is put in place when you click New Stored Procedure... from the Object Explorer on SQL Server Management Studio 2008. I have found how to change the 'Create Stored Procedure (New Menu)' template from the Template Explorer, however this means I will have to keep opening the template explor...

Does this mySQL "spatial" query work in SQL Server 2008 as well?

Before I embark on a a pretty decent overhaul of my web app to use a spatial query, I'd like to know if this MySQL query works in SQL Server 2008: SELECT id, ( 3959 * acos( cos( radians(37) ) * cos( radians( lat ) ) * cos( radians( lng ) - radians(-122) ) + sin( radians(37) ) * sin( radians( lat ) ) ) ) AS distance FR...

Scripting advanced security properties in SQL Server 2008?

Under SQL Server 2008, you can set the permissions for a given user down to the table and/or field level. In the GUI, it's easy to select the "Securables" and apply them, but is it possible to script the changes? ...

Trigger insert old values- values that was updated

I need to create trigger in SQL Server 2008 that gone insert all values from one row in which some value was changed into Log table! For example if i have table Employees that have column id, name , password, and i update this table and insert new value for column name, than i need to insert values that was in table Employees after upda...