all groups > sql server (alternate) > june 2007 > threads for june 22 - 28, 2007
Filter by week: 1 2 3 4 5
Is Not Null and Query Optimization
Posted by db55 at 6/28/2007 4:22:12 PM
How does the phrase "Is Not Null" in the where clause effect the
effectiveness of a query?
If it is a determent to the effectiveness of the query, how do you
work around it?
Thanks,
... more >>
XML INTO SQL
Posted by KEN at 6/28/2007 2:44:13 PM
I need to open a newly created xml doc (in the same format) each time
a new one is sent to our web service. I would like to use a stored
procedure and call to it the problem is I keep getting a
XML parsing error: Invalid at the top level of the document.
See code
What I really need is a ... more >>
question about a query
Posted by nina297 at 6/28/2007 12:44:17 PM
I've written this query:
select distinct topics, questions, answer
from topics AS A, QuesNans AS B
where A.topicid = B.topicid
order by a.topics
The results are:
Topic Questions Answers
Topic Four Question 1 Answer to question 1
Topic One Quesstion 2 Ans... more >>
DELETE where syntax ... need help :)
Posted by cobolman at 6/28/2007 2:55:44 AM
I have a table with the following columns,
NAME, TYPE, TAG
And there may be 'duplicates' on name and type.
How can I delete them??
I want to delete all with duplicate NAME and TYPE
... more >>
SELECT QUESTION
Posted by k4 at 6/28/2007 12:27:17 AM
Here is my problem:
I have two tables. Table1 contains two fields. Field1 contains names
of job types (Accountant,Doctor,etc.) Field2 contains the number of
cases to select from Table2 for each job type.
Table2 contains three fields. Field1 contains Unit
codes(Unit1,Unit2,etc.).Field2 conta... more >>
Performance between Standard Join and Inner Join
Posted by Chamnap at 6/27/2007 10:04:45 PM
Hello, everyone
I have one question about the standard join and inner join, which one
is faster and more reliable? Can you recommend me to use? Please,
explain me...
Thanks
Chamnap
... more >>
Forcing an IDENTITY column to have a certain value
Posted by Weyus at 6/27/2007 8:11:50 PM
All,
Is there any way to _set_ an IDENTITY column to have a certain value
so as to create a gap in the set of identity values on purpose?
All I've found is SET IDENTITY_INSERT.
Thanks,
Wes
... more >>
How to reliably ensure that only one set of rows is bulk imported into a table at a time
Posted by Weyus at 6/27/2007 7:27:40 PM
All,
I need to do some bulk loading of data, and in order to do it, I need
to be able to do the following:
1) Retrieve the current identity value for the table using SELECT
IDENT_CURRENT('myTable')
2) Generate a data file with pre-created identity column values
3) SET INDENTITY_INSERT 'myT... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
How to make a SQL run longer?
Posted by Raj at 6/27/2007 11:16:26 AM
Hell All,
To reproduce one of our cusotmer's probem, I need to make the SQL to
run for more than a minutes before it returns the result set. I do not
have large amount of data in the database to simulate the dealy.
Is there a way in SQL to cause the delay while returning the result
set
Tha... more >>
mass alter table fields - script help
Posted by rcamarda at 6/27/2007 5:30:30 AM
Hello,
I need to alter fields in all my tables of a given database, and I
would to do this via a t-sql script.
Example, I want to change all fields called SESSION_ID to char(6). The
field is usually varchar(10), but the data is always 6 characters in
length. I have serveral fields that are fixe... more >>
Parse field into multiple rows
Posted by rcamarda at 6/27/2007 4:22:45 AM
Hello,
I am loading data from our MS Active Directory into our data
warehouse. (check out Mircosofts's Logparser, it can pull data from
ADS, server event logs and more. It can also create text files or load
directly to SQL. Its free and a pretty useful tool)
There is a field that contains the d... more >>
sql Cannot resolve collation conflict equals - comparing rows and fileds between Table1 and View1
Posted by Yas at 6/27/2007 3:17:49 AM
Hello,
I currently have Table1 and View1.
View1 is a query from 2 or 3 tables that works fine on its own.
However in my current query if I try to use it...something like...
SELECT a.col1, a.col2, a.col3, b.col1, b.col2, b.col3
FROM View1 a JOIN Table1 b on a.col1 = b.col1
... more >>
Stored Procedure definition not updating, causing DTS copy error
Posted by at 6/27/2007 1:49:57 AM
I've got a weird one here. I'm running a DTS package on SQL Server
2005. It copies a bunch of stored procedures. I renamed them on the
originating server and ran the DTS again.
The came over with the old name and code!
I deleted the DTS and built it from scratch, and the same thing
happened... more >>
How to find the maximum possible value of a given datatype
Posted by at 6/27/2007 1:39:49 AM
Does anyone know of a built-in function to return the maximum possible
value of a given datatype? I have to return the biggest value for a
smalldatetime or datetime in a view if the field is null, but can't
find such a function. The closest I've come is:
select datalength(cast(getdate() as sma... more >>
Concat tables into one row in view
Posted by at 6/26/2007 8:45:06 PM
If I have table1 and table2 with table2 having multiple rows tied to a
single row in table 1.
What I am trying to do is set up a view that has one row that shows
the following
table1.uniqueid, table1.name, table2.row1.detail, table2.row2.detail,
table2.row3.detail
I'd like to be able to do... more >>
sum columns into column in same table
Posted by azriley NO[at]SPAM gmail.com at 6/26/2007 8:33:07 PM
I have inherited a database that tracks if a customer ordered a
product, with 1 being a yes and 0 being no. What I want to do is sum
those columns (customer_tbl.ordered2004, customer_tbl.ordered2005,
customer_tbl.ordered2006) and set the value of that sum into a column
in the same table (custome... more >>
Free client
Posted by Sashi at 6/26/2007 2:13:45 PM
All, I'm new to MS SQL Server and I'm wondering if there is a free
client that will allow me to connect to a remote SQL Server instance.
Currently I can connect via the tsql command on a Solaris box but it
seems to offer limited options.
A PC based GUI front end is a good idea.
Anyone knows i... more >>
problem in date comparison
Posted by at 6/26/2007 10:42:30 AM
I have a problem in this query:
select order from ordertable
where orderdate >= '06/20/2007' and orderdate < '06/21/2007'
this query do not return any record
although there are records in the table matching the query
please help me
... more >>
problem about comparing date
Posted by at 6/26/2007 10:34:51 AM
I have a problem in this query:
select order from ordertable
where orderdate >= '06/20/2007' and orderdate < '06/20/2007'
this query do not return any record
although there are records in the table matching the query
please help me
... more >>
Strange performance issue with UPDATE FROM
Posted by Richard at 6/26/2007 8:31:39 AM
Hello!
I have this piece of SQL code:
UPDATE a
SET Field1 = c.Field1
FROM a
INNER JOIN b ON a.GUID1 = b.GUID1
INNER JOIN c ON b.GUID2 = c.GUID2
WHERE c.Type = 1
AND @date BETWEEN b.DateFrom AND b.DateTo
This query takes hours to complete.
Now while trying to find out what's causing... more >>
select alias -- invalid column name
Posted by sweetpotatop NO[at]SPAM yahoo.com at 6/26/2007 8:02:39 AM
Hi,
I got 'Invalid Column Name NewCol1' when I query the following:
Select col1, col2, (some calculation from the fields) as NewCol1,
(some calculation from the fields) as NewCol2,
NewCol1 = NewCol2 from
Table1 inner join Table2 inner join Table3....
Where
.....
Basically, I want to fi... more >>
sql profiler trace file
Posted by ofirmgr NO[at]SPAM gmail.com at 6/26/2007 3:20:20 AM
im trying to understand how the profiler works. so i started 2
profilers,one listen to another and I saw the profiler is running:
exec sp_trace_create @P1 output, 1, NULL, NULL, NULL
which means @tracefile = NULL
so where from the profiler read the results?!
... more >>
compare 2 values in same solumn
Posted by mcolson at 6/25/2007 3:44:07 PM
I am trying to compare the last two values in the same column of a
table. First of all, I have a column titled Row_Index that uses an
index which starts at 1 and increments by 1. What I am trying to do
is compare the values in the column 'Shift_Date' for the maximum value
of Row_Index and the ... more >>
Trigger Deadlock
Posted by DennBen at 6/25/2007 5:57:16 AM
I am doing an update to set a field value = anothe field value (in the
same table) where it is not supplied. I'm handling this in the
trigger, but am getting deadlocks.
Do you see anything wrong with this that would cause deadlocking?
ALTER TRIGGER [trg_myTable_UPDATE]
ON [dbo].[myTable... more >>
problem with highscore
Posted by zuuperman at 6/25/2007 2:59:56 AM
Hi folks
I have a little problem converting from an access database to the SQL
server
I need to have a highscore that shows the top 10 scores, grouped by
email.
In my access db i had this query:
"SELECT TOP 10 First(users.user_naam) AS FirstOfuser_naam,
First(users.user_voornaam) AS First... more >>
SQL 2000 date format problem after migration W2k to W2k3
Posted by Maciej07 NO[at]SPAM gmail.com at 6/25/2007 1:52:04 AM
Hello,
We are using SQL server 2000 on W2k Server and MS Access 2000 ADP
(like front-end). Now we try to change operating system for SQL Server
2000 from W2k to W2k3 and we found problem with date format - we
receive error: "Cannot convert date type varchar to datetime".
Datetime used in ap... more >>
DB hostname, username, password etc
Posted by MackTheKnife at 6/24/2007 7:31:58 PM
I'm trying to get into an installation of v.6.5 to use with another
server and I need the following information:
Database hostname
Database name
Database usernane
Database password
Is this information available anyplace within the installation files?
I'm not asked for uname and pwd to get... more >>
Foreign Key
Posted by ArunDhaJ at 6/23/2007 10:26:40 AM
Hi Friends,
Is there any way to get the table name which is referenced by the
foreign key
for example: consider two table "Staff" and "Department"
Staff with following columns
PK_ID
FK_DepartmentID
Name
Address
Department with following columns
PK_DepartmentID
Dept... more >>
BULK INSERT ignores UNIQUE index with IGNORE_DUP_KEY set?
Posted by Weyus at 6/22/2007 10:33:07 PM
All,
Just want to make sure that I understand what's going on here.
I have a table with IGNORE_DUP_KEY set on a unique, multi-column
index.
What I'm seeing is this:
1) When performing a BULK INSERT, the UNIQUE index is not being
respected and rows which violate the unique index are in... more >>
correct syntax for this select in SQL Server?
Posted by Jim Lawton at 6/22/2007 9:19:31 PM
This (demo) statement is fine in Access, and so far as I can see, should
be OK in SQL Server.
But Enterprise Manager barfs at the final bracket. Can anyone help
please?
select sum(field1) as sum1, sum(field2) as sum2 from
(SELECT * from test where id < 3
union
SELECT * from test where id ... more >>
Unable to connect to SQL Server Express Locally or Remotely
Posted by Billy at 6/22/2007 12:41:50 PM
I have read all of the posts regarding this subject as well as 3
"Dummies" guides and I keep having the same problems. I have a very
simple multi-user application that has to hit a database. We
cuerrently have this system deployed and it is working fine on a
domain based network. We are scali... more >>
Deadlock transaction
Posted by Altman at 6/22/2007 6:17:45 AM
I have a customer using our program with SQL server and is
occasionally getting a "Transaction (process ID xxxxx) was deadlocked
on lock resources with another process and has been chosen as the
deadlock victim." From what they are telling me, there shouldn't be
any deadlock happening as they s... more >>
|