Viewing 15 posts - 3,886 through 3,900 (of 4,085 total)
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,...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
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...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
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 =...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
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...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
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...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
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...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
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(),...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 2, 2010 at 1:23 pm
Jim-720070 (9/2/2010)
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
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,...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
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
...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
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. ...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 31, 2010 at 6:30 am
Arjun Sivadasan (8/31/2010)
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
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...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 30, 2010 at 11:31 am
Arjun Sivadasan (8/30/2010)
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 30, 2010 at 11:17 am
Brandie Tarvin (8/30/2010)
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 30, 2010 at 11:07 am
Viewing 15 posts - 3,886 through 3,900 (of 4,085 total)