Viewing 15 posts - 106 through 120 (of 388 total)
In SQL Server 2005, you would need three separate DELETE, UPDATE and INSERT statements. You can find an example (look at the last example) here: http://www.sqlservercentral.com/columnists/jSebastian/2912.asp
January 13, 2009 at 11:10 pm
I did some search on internet to see there are any references to similar errors. The one given below looks interesting. http://social.msdn.microsoft.com/forums/en-US/sqlsmoanddmo/thread/94f476c9-6d22-44e2-ba15-0786c0dfffaa/
It speaks about two downloads/feature-packs and probably...
December 17, 2008 at 9:23 am
So what is the problem you are facing? Did you get an error?
December 17, 2008 at 8:27 am
I had tested it on SQL Server 2005 while writing the article. Did not test on SQL Server 2008 yet. However, I would expect it to work on SQL Server...
December 16, 2008 at 8:09 pm
Try executing the scripts for each object one by one and this might help you to identify the statement that fails.
October 16, 2008 at 12:18 am
Jason Hall (10/15/2008)
October 15, 2008 at 11:59 pm
You can do this by prefixing the table with the database name. For example, the trigger in db1 can run something like "INSERT INTO DB2.dbo.TableName(column1, column2)....".
However, I would not recommend...
October 15, 2008 at 3:51 am
Use a CASE expression like the example given below:
SELECT
CASE INDEX_CODE WHEN 'Bnk' THEN 'BankDep'
ELSE Index_code
END AS IndexCode
from TableTest
October 15, 2008 at 3:42 am
Thanks,
Most people did not like the previous article because it was too short. May be they would like this 🙂
October 15, 2008 at 3:37 am
Configure database mail on the server and create a trigger in the table. Add the code to send an email using Database Mail. This article might help you to configure...
October 13, 2008 at 10:29 am
VARCHAR2 is not a valid data type in SQL Server.
Try the following
create table tbl (
name as varchar(50) not null
)
GO
insert into tbl (name)
Select name from account union
Select...
October 12, 2008 at 10:22 pm
Another option:
SELECT * FROM SYS.COLUMNS
WHERE OBJECT_ID = OBJECT_ID('TableName')
October 12, 2008 at 10:17 pm
This is how you can store it to a variable
IF EXISTS(
SELECT ID
FROM mytable
WHERE [Start] = convert(datetime,@Start,120)
AND [End] = convert(datetime,@End,120))
BEGIN
SELECT @Existing = 1
END...
October 12, 2008 at 9:53 pm
You need to specify the table name after "alter table". For example:
create table schematest (data xml(ElementTest))
go
alter table schematest alter column data xml
October 11, 2008 at 2:47 am
Viewing 15 posts - 106 through 120 (of 388 total)