Viewing 15 posts - 3,886 through 3,900 (of 4,087 total)
You'll need to create a DDL Trigger.
CREATE TRIGGER YourTrigger
ON ALL SERVER
AFTER DROP_TABLE
AS
<Your code here.>
You'll need to use the EVENTDATA function to get the command issued to see if the table...
September 9, 2010 at 1:08 pm
It actually sounds like the OP wants both a primary and secondary sort for each sort order choice. If that is the case, there are two options:
1) Have...
September 9, 2010 at 10:47 am
You can also use the Information_Schema.Columns system view. It does all of the joins for you, and I find it much easier to remember one view.
SELECT Table_Schema, Table_Name, Column_Name,...
September 7, 2010 at 11:32 am
Instead of pulling back all nodes and then checking whether the local name matches, you should just pull back the nodes that do match.
@x.exist('//ConsumerID') = 1
From there, it's simple to...
September 3, 2010 at 12:31 pm
You can specify attributes using [path/@attr]. For example,
SELECT
'center' AS ,
td = [server] ,
'' ,
'center' AS ,
td = [DatabaseName] ,
'' ,
'center' AS ,
td = [Status] ,
'' ,
'center' AS ,
td =...
September 3, 2010 at 12:15 pm
SQL is unaware of the calling application, so it cannot manipulate the calling application. SQL just returns the data. It is up to the calling application to use...
September 3, 2010 at 10:13 am
The main issue is that you are using
INSERT INTO TABLE(Fields)
VALUES(Values)
when you should be using
INSERT INTO TABLE(Fields)
SELECT expressions
FROM INSERTED
I would also recommend using TRY...CATCH blocks.
There are also undefined variables in your...
September 2, 2010 at 2:26 pm
If you have a specific problem, it would help if you specified what it was. If you just want to know how to get started, look up CREATE TRIGGER...
September 2, 2010 at 1:27 pm
Also, the format that you're looking for in the CONVERT is 112, which gives you YYYYMMDD without the need to use REPLACE to get rid of extraneous characters.
SELECT Convert(varchar(8), Getdate(),...
September 2, 2010 at 1:23 pm
Jim-720070 (9/2/2010)
September 2, 2010 at 1:12 pm
Depending on the number of tables and the types of updates, replication may actually be your best option. SSIS is going to have a hard time dealing with deletes,...
September 2, 2010 at 6:29 am
A conditional expression can't appear in your THEN clause. The generic way to fix this is to move it to the WHERE clause with an AND.
WHERE CASE
...
September 1, 2010 at 6:53 am
Matt Miller (#4) (8/30/2010)
Actually - compile errors (which I believe is what you'd get if you try to insert into a column that doesn't exist)
Actually, that's a runtime error. ...
August 31, 2010 at 6:30 am
Arjun Sivadasan (8/31/2010)
August 31, 2010 at 6:18 am
I think he's inserting into a temp table, then deleting from the temp table, and then inserting the remaining records into the production table.
If that is the case, you might...
August 30, 2010 at 11:31 am
Viewing 15 posts - 3,886 through 3,900 (of 4,087 total)