Viewing 14 posts - 226 through 239 (of 239 total)
Try taking out the "(nolock)" after the "as dm" and moving it to after the "LastMonthSales dm1"
This works
select *
from sysusers as Org (nolock)
inner join (select distinct dm1.UID as UID
...
February 10, 2006 at 1:37 pm
Do you have any more details about the table layouts?
--Jeff
February 10, 2006 at 1:22 pm
Hopefully this will work for you:
create table TicketType
(
TicketTypeID int,
TicketTypeDescription varchar(255)
)
create table Client
(
ClientID int,
ClientName varchar(255)
)
create table Ticket
(
TicketID int,
ClientID int,
TicketTypeID int,
TicketDate datetime
)
insert TicketType values(1, 'Ticket_1')
insert TicketType values(2, 'Ticket_2')
insert TicketType values(3, 'Ticket_3')
insert Client...
February 10, 2006 at 10:51 am
This works if you need it as a character string
declare @col_mm_no smallint
declare @col_yr_no smallint
select @col_mm_no = 5,
@col_yr_no = 2005
select right('0' + cast(@col_mm_no as varchar), 2) + '/01/' + cast(@col_yr_no...
February 10, 2006 at 10:32 am
If you have a table containing the list of courses you can do the following:
create table Course
(
CourseID integer,
CourseName varchar(255)
)
create Table StudentCourse
(
StudentID integer,
AllCoursesTaken varchar(1024)
)
insert course values(1, 'English')
insert course values(2, 'Calculus')
insert...
February 10, 2006 at 10:20 am
For question 2, instead of having a table with 26 columns each representing a value, it may be easier to store the data in tables like these:
create table PersonAttribute
(
PersonID integer,
AtttributeTypeID...
February 10, 2006 at 10:11 am
I would optimize the insert/updates to not block the reads. You could shorten or eliminate the use of transactions or allow the reads to not wait with the WITH NOLOCK...
January 31, 2006 at 3:32 pm
If someone is inserting or updating data into the system, why do you want to send your users away? There query may take a little longer because of waiting for...
January 31, 2006 at 2:42 pm
I'm not clear what you mean by 'in process mode'. If you mean the tables are being accessed via INSERT/UPDATE statement, then in a typical OLTP system, they will be...
January 31, 2006 at 1:46 pm
You will need some sort of ETL process that runs at a regular interval. The method that I use is something like the following. For each table write SQL something...
January 31, 2006 at 8:13 am
If you are concerned about getting back dirty data or some incomplete data, SQL Server normally prevents this. Your select statement will wait for any inserts or updates that are...
January 31, 2006 at 7:51 am
In SQL, bits are represented by 0 or 1. It doesn't translate the string 'TRUE' to a 1. If the source data is a string 'TRUE', then a case statement...
January 30, 2006 at 4:17 pm
I think you are over complicating things. A stored procedure can take a text field as an argument and insert it directly into the table.
create table tblNews
(
NewsID int identity(1,1),
...
January 30, 2006 at 2:16 pm
A "begin transaction" statement does not require an "end"
The following works but I agree that its best to do the update by qualifying the balance in the where clause.
create table table1 ...
January 30, 2006 at 1:39 pm
Viewing 14 posts - 226 through 239 (of 239 total)