Viewing 15 posts - 316 through 330 (of 670 total)
You can query the Inserted and Deleted tables within the trigger, but I'm not sure this is a good solution. How often are records added/modified in this table. ...
April 6, 2012 at 12:50 pm
it's hard to figure out what you're looking for without sample data and expected results. Can you provide these as well as table layouts for the 2 tables involved?
January 3, 2012 at 7:32 am
can you provide some table layouts, sample data and expected output? What have you tried so far?
January 3, 2012 at 7:24 am
How do you know which results are for Reading and which are for Writing? Here's a dynamic pivot that will need some tweaking to work, but it's a...
July 19, 2011 at 7:38 am
You should be very careful when using Table valued functions. It can cause huge performance problems. What does the function look like? How often is it used?...
July 19, 2011 at 7:19 am
You didn't specify where the CourseCode is coming from, but here's an unpivot statement that will work
SELECT RegistrationNumber, LectureNumber, RoomNumber, AttendanceCode, CreatedBy
FROM
(SELECT RegistrationNumber, [11], [12], [13],...
July 18, 2011 at 6:31 am
what are you using the SPs for? Usually these are used to retrieve the data. If so, then the source DB would be the place.
July 13, 2011 at 11:35 am
What exactly is the function doing? Is it updating a date field in the existing table?
June 13, 2011 at 7:11 am
Close, but you first have to put the join_type column in the table and populate it.
declare @t table (
USERID char(4),
...
June 9, 2011 at 12:34 pm
declare @t table (USERID char(4), ACCOUNT_ID varchar(5), TEL char(1), JOIN_DATE smalldatetime)
insert into @t
select '0001','c0001','x','01/06/2011' union all
select '0001','c0001','x','12/23/2011'
select * from @t
update t
set t.JOIN_DATE = j.Join_Date
from @t t
inner join (select UserID,...
June 9, 2011 at 8:16 am
How does data get inserted? Directly from an app? Seems to me that by returning a severity 16 for a warning is going to cause the app to...
June 9, 2011 at 7:38 am
I still don't understand why. What have you tried so far? Here is a script that generates the table and data as well as a select statement against...
June 9, 2011 at 7:33 am
Why don't you want to specify the joins properly. Are you saying that there are foreign keys and you want to read the system tables to find out what...
June 9, 2011 at 6:32 am
You can query information_Schema.columns to get column names and datatypes. Just be careful. If the structure of the table changes, but not the xml, then you will get...
June 9, 2011 at 6:30 am
Have you tried a union? It could be slow based the volume of data, but duplicates would be removed.
SELECT *
FROM T1 INNER JOIN T2
ON T1.Var1=T2.Var1
UNION
SELECT *
FROM T1...
June 2, 2011 at 1:00 pm
Viewing 15 posts - 316 through 330 (of 670 total)