all groups > sql server programming > october 2007 > threads for thursday october 11
Filter by Day: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
TableAdapterManger with UpdateAll to cascade key updates
Posted by Matthew at 10/11/2007 10:15:01 PM
Does a Local Database cache (sql server ce) support primary key- foreign key
relationships?
In case you are not familiar with the TableAdapterManager, this question
also applies to TableAdapter.Update().
We've been unable to get parent-child relationships to update when calling
update on... more >>
I have a 'complex' SQL query o
Posted by leon at 10/11/2007 9:08:00 PM
Hi,
I have a 'complex' SQL query on two mysql tables which I need to join.
One contains RENTAL AGREEMENT DATA and the other REAL ESTATE DATA. I
need to join the two tables to see which APARTMENTS are not rented out
for the current month.
Important is
1. I need to SELECT property_id from the... more >>
Intermittent string truncation error
Posted by Emma at 10/11/2007 8:27:00 PM
Using SQL 2005
We have a proc that we are calling from an ASP.NET application using
ADO.NET. It is intermittently return the following error message: 'Error
executing the command exec [proc_name] to DataSet. String or binary data
would be truncated. The statement has been terminated.'
... more >>
SQL Server doesn't exist
Posted by vovan at 10/11/2007 6:54:55 PM
My program written in VB6 uses SQL Server. It works fine on all machines
with Windows XP in my client company. I tested it on Vista machine in my
company and everything was fine.
My client bought a new laptop with Vista installed my program and it doesn't
work. It cannot create connection to ... more >>
Table Searching Question
Posted by ArkApex at 10/11/2007 5:21:56 PM
Hi All,
This is my first time posting. I am hoping one of you will be able to
help me with this question I have had since I started my job last
spring. Is there any way to search a table in a SQL database for a
particular value? For instance, if I wanted to search an entire table
called 'Cloc... more >>
please help with count sql syntax
Posted by Mary at 10/11/2007 5:05:00 PM
Please help. i really need help
I have a table that has a set of records with phone number. Some of these
numbers appear once and some appear more than ones. I would like an sql
statement that count the sum of the phone number that appears more than once
only.
Name ... more >>
need help to find rows ...
Posted by light_wt at 10/11/2007 4:15:04 PM
I have a 3 tables. Two are look up tables and the third is a child table.
First lookup table is d1, it has three integer fields:
m_key (primary key),
m_loc,
okey,
Second look up table is d2, 3 fields:
Lkey (primary key)
okey,
m_loc
The Child table has 4 columns:
mPK (primary Key),... more >>
Best design for a distributed database system
Posted by dgleeson3 NO[at]SPAM eircom.net at 10/11/2007 2:45:57 PM
Hello all
I am creating a VB.Net distributed SQL server 2005 application.
Each computer in the system has a database with a table of users and
their telephone numbers.
Each computer has a unique 4 digit identifying code.
The central server runs an application which reads the database tabl... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Parse String function needs to be more efficient
Posted by Stephanie at 10/11/2007 2:12:02 PM
I need to make this ParseString function faster as I call it thousands of
times. Any suggestions?
CREATE function ParseString (@cPattern nvarchar(4000), @cExpressionSearched
varchar(4000), @nOccurrence smallint = 1 )
returns varchar(4000)
as
begin
DECLARE @TempcExpressionSearched v... more >>
Predicate value when retrieving a value
Posted by Loren Dummer at 10/11/2007 2:11:25 PM
Is it possible to have the predicate value a variable.
Example:
DECLARE @XmlData xml
,@Predicate int
,@Value nvarchar (65)
SELECT @XmlData = '<DocumentPacket>
<Party>
<Number>1000</Number>
... more >>
Signal Waits
Posted by CLM at 10/11/2007 1:54:01 PM
I've just started reading all about wait stats. I've got a couple of 2000
SP4 servers with problems and what I did was run DBCC SQLPERF(Waitstats) and
then go down and look at the bottom Total line. Here is the bottom line:
Total 6.7750426E+8 1.4171142E+10 5.3916744E+9
Now if you divide the ... more >>
tempdb limited to 4gb for express?
Posted by paul at 10/11/2007 1:44:03 PM
On one machine I have sql server2005 full and 2005 express and both instances
can have a tempdb of 5gb. A tester machine has only the express instance (
sp1 or sp2 ) and I can't set (using sqlwb) the size of tempdb above 4gb. If I
set to 5gb, I will get back an out of space error eventhough th... more >>
Grouping Data
Posted by Wannabe at 10/11/2007 1:15:02 PM
I have a table "Hours" that holds data for a timecard web app.
It holds data like so:
id daterecorded projectid personnelid hours
1 10/08/07 10 56 6
2 10/09/07 10 56 3
3 10/10/07 ... more >>
CDATA disappearing
Posted by Clint Pidlubny at 10/11/2007 1:10:03 PM
I'm having an issue with CDATA wrappers disappearing when I either do a SQL
insert or select, I'm not sure which end they are being removed at. Here's a
basic example. I have a table setup with one column, defined as a XML field,
then I insert:
Insert test_xml values ('<lead_id><![CDATA[233... more >>
get most recent record
Posted by rodchar at 10/11/2007 1:04:03 PM
hey all,
SELECT EmployeeID, StartDate, EndDate, SalaryStatus,
ContractAnniversaryDate
FROM HistoryTable
WHERE (StartDate =
(SELECT MAX(StartDate) AS 'Recent Date'
FROM HistoryTable
... more >>
Where Comparison
Posted by Anonymous at 10/11/2007 12:03:01 PM
SQL Server 2000
SELECT Field1,
Field2
FROM tablename
WHERE Field1 <> Field2
If I have the following data:
Field1 Field2
AAA-00263 AAA-00263
BBB-1234 BBB-1234; CCC-... more >>
Connect Suggestion: inline scalar UDFs
Posted by Russell Fields at 10/11/2007 11:53:39 AM
Vote if you care:
I found the suggestion from Andrew Novick at Microsoft Connect to implement
inline scalar UDFs, with all the performance benefits that you would expect.
It would create a class of scalar functions that you could use without the
enormous performance penalties currently expe... more >>
Trying to select a subset of a record
Posted by JR at 10/11/2007 11:51:47 AM
I have a bunch of records in SQL server that I am trying to update
another field with a subset of the data in them. The format of the
data is <value1>/<value2>/<value3>/<value4> where <value> could be any
alpha numberic value of any length.
I want to get <value2> out of it, without the slashe... more >>
Dual Inner Joins
Posted by Robert at 10/11/2007 11:39:47 AM
Hello:
I'm using VB6, an SQL Database and Crystal reports Dev edition XI.
I'm trying to INNER JOIN 3 tables together and can't seem to get the
syntax correct. Following is my SQL Statement:
.Open "SELECT DISTINCT ORDER_HEADER.entry_date,
ORDER_HEADER.customer_name, ORDER_HEADER.or... more >>
QUERY with Months
Posted by LUIS at 10/11/2007 11:07:02 AM
I am using MS SQL 2000. I have a tblINVOICE table with
InvoiceID,
CustomerID,
Date and
Total columns,
other table is tblMONTHS with
MonthID and
MonthName.
QUERY I need is like :
.........................................
Customer(1)
January $ 123.89
February $ 56.... more >>
Check Constraint Pattern Matching
Posted by INTP56 at 10/11/2007 10:54:02 AM
I want to put a constraint on a varchar column.
In words, the first character must be [A-Z] or [a-z], then every other
character must be in the range [A-Z] or [a-z] or [0-9] or [_]
I don't know if I'm being dense, but I can't seem to figure out how to
specify that check constraint.
TIA,... more >>
Convert question (char to datetime) for comparison
Posted by Elmo Watson at 10/11/2007 10:46:33 AM
I've got a field in my table that's char(6) - like :
0705 (YYMM)
What I need to do is do a comparison to an acutal date
Select (fields) from Table
Where MyCharField < '6/1/2007'
I've been playing around with the Convert function, but have been
unsucessful.
How exactly can this be done?
... more >>
how to disable encoding window
Posted by light_wt at 10/11/2007 9:32:00 AM
I use SQL Server Management Studio.
Each time when I click on button "New Query" the Encoding window always pop
up.
Is there an option to stop SSMS from doing it?
Thanks.
... more >>
return a single record
Posted by cris at 10/11/2007 9:12:04 AM
hello,
i have 1 table that has no keys or unique values. the table is made up of 2
feilds, customer_code, customer_name. i want to return 1 record each unique
customer_code and 1 value for a customer_name(even if there are several, 1 is
enough). ultimately, i want the number of rows returns... more >>
Query assistance on table sys.dm_db_index_physical_stats
Posted by Big Ern at 10/11/2007 9:03:02 AM
All -
I'm trying to execute this query against a database with a compatibility
level of 80, and I get errors on the DB_ID() portion of the query. I've found
when you are at a compatability level of 80, this will not work and need to
pass the name instead. When I try and pass the DB_NAME() ... more >>
sql query question
Posted by claudia.inaciofong NO[at]SPAM googlemail.com at 10/11/2007 8:32:50 AM
Hi,
I have this query below:
select distinct City.CityName
from City
where City.CityID IN (select distinct CityCode as CityID from dest
where dest.destID=@destID)
The result of the query now is null because in my dest table I don't
have any cityCode = 0...
My question is without ad... more >>
Replication and the little hand under the Database
Posted by PSULionRP at 10/11/2007 8:17:02 AM
I am looking within SQL Server Management Studio---SQL Server 2005.
How come my replicated databases do not show the little hand under them like
it does in Enterprise Manager???
I appreciate your help in advance.
Thanks.
PSULionRP... more >>
problem with DELETE statement using subquery or exists?
Posted by E L at 10/11/2007 7:01:23 AM
I think this is possible, here is the background I have a query that
looks like this:
SELECT T1.Field1, T1.Field2 FROM T1 LEFT OUTER JOIN
T2 ON T1.Field1 = T2.Field1 AND T1.Field2 = T2.Field2
WHERE (T2.Field1 IS NULL) AND (T2.Field2 IS NULL)
T1 and T2 as tables have the SAME structure wher... more >>
Synchronize data in two databases
Posted by Lasse at 10/11/2007 6:18:44 AM
Hi, Is it possible to synchronize two databases, 2005 express and 2005
enterprise editions.
I want one way synchronize, the express edition should get new data in
certain tables from the enterprise edition. The databases are in the same
lan.
If possible is there an article or maybe some hin... more >>
storing xml in a variable
Posted by Erick at 10/11/2007 12:40:48 AM
I'm trying to return a record as xml and storing it into a variable
using sql 2000
Can any one help
eg
declare @A varchar(2000)
set @a = (select * from Audit for xml raw)
since the select returns one record as a single column containing a
large character field how come i can't store it in... more >>
IN Statement
Posted by Michael at 10/11/2007 12:04:00 AM
Hi All
I have to convert an Oracle Statement to an SQL Server Statement and I can't
find any information about this. So has anyone an Idea how I can convert this
special IN Statement?
and (a.nLfdAbteilungNr, kst.nLfdKostNr) in
(select qam.nLfdAbteilungNr , max(qam.nLfdKostNr)
... more >>
Need help w/ SQL Statement
Posted by DG at 10/11/2007 12:00:00 AM
I have an inventory table that contains lead-times for items. I have the
statment that will get me the Min, Max, Avg, and Count for each items lead
time. Now I need one that will return the last lead time for each item.
Example:
ITEM_ID, LEAD_TIME, RECEIPT_DATE
ABC, 10, 9/12/2007
ABC, 5,... more >>
Parallelism
Posted by Mark at 10/11/2007 12:00:00 AM
Under what circumstances could you envision a decent reason for disabling
SQL Server's ability to do parallelism with query execution?
Thanks,
Mark
... more >>
Permissions in Fixed Server Roles
Posted by Paddy at 10/11/2007 12:00:00 AM
What I would like to know is how can I understand what permissions
each fixed server role has. e.g. Is there any documentation that lists
xp's and the fixed server role that can execute them?
The reason for this is listed below....
I need to update the account an sysadmin.
It is being wid... more >>
Stored procedure vs sql advice
Posted by Peter Boulton at 10/11/2007 12:00:00 AM
Hi,
First, I admit I am pretty new to sql server....
I'm writing an app in C++ where I connect to sql server (200 or 2005) via
OLEDB and use ADO as my 'interface' to the server. The app itself is a
Business Intelligence app which is moving from proprietary database to
hosting the databa... more >>
qeury type question (two tables)
Posted by Jure Bogataj at 10/11/2007 12:00:00 AM
Hello!
Has anyone a simple solution to this types of queries (presenting two tables
with sample data)
TABLE_DOCUMENTS
DocID DocName
1 Doc0001
2 Doc0002
3 Doc0003
4 Doc0004
TABLE_VERSIONS
VerID... more >>
Need help with design
Posted by vovan at 10/11/2007 12:00:00 AM
Our salespeople currently get 50% commissions from the difference between
sale price and cost:
Commissions = 0.5*(SalePrice - Cost)
Now the management decided to change this rule. Every salesman is going to
have her own split percentage. The percentage may change from time to time.
For insta... more >>
|