all groups > sql server programming > june 2007 > threads for friday june 1
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
Where to store XSD data?
Posted by erdos at 6/1/2007 10:23:11 PM
For MSSQL 2005, if I am storing XML documents in a table and at some
point want to query against those documents, an XML column type is
best. Each XML document also has an associated XSD file. If I want
to ensure data integrity and have typing available with xml sql, how
should I store the XS... more >>
Newbie - Please Help - Count or Sum?
Posted by Chamark via SQLMonster.com at 6/1/2007 8:08:10 PM
Using SQL 2000. I need to be able to provide a report that shows employees
with 1, 2, 3, 4, 5, 6 errors. Table is like this.
Associate----error_type-----error_date. There are five error types. My report
needs to look like this:
--------------------------------------------------------------------... more >>
T-SQL Reference
Posted by The Cornjerker at 6/1/2007 6:41:52 PM
We have upgraded from SQL 7 to SQL 2005. Version 7 came with a manual
named:
Microsoft SQL Server Transact-SQL and Utilities Reference, Volume 1
that basically shows all the sql commands and gives examples. Is
there one of these for SQL Server 2005? If not, is there something
similar? J... more >>
Export table from SQL2005 to Access for editing - then import to S
Posted by DJ Word at 6/1/2007 5:40:00 PM
I am trying to help a client who has customer information stored in a SQL2005
database that they want to correct using Access, and then restore to the
SQL2005 database.
We don't have a lot of experience with SQL, other than running queries, but
we tried using the import/export wizard to exp... more >>
SSIS ( copy filed from network drive )
Posted by Bob at 6/1/2007 3:26:30 PM
sorry for the cross post.
noticed I posted to wrong group after I sent it the first time.
I have a package that works fine when fired from within BIDS.
It also runs fine if I connect to integration services and RUN the package.
When I add the package to a job, it executes successfully,
but... more >>
Msg 2601 Cannot insert duplicate key row in object '' . . .
Posted by Gordon Linoff at 6/1/2007 2:43:01 PM
We are doing a simple SELECT query in SQL Server 2005 that is returning the
following error:
Msg 2601, Level 14, State 1, Line 1
Cannot insert duplicate key row in object '' with unique index ''.
The statement has been terminated.
This error message is highly suspicious for two reasons... more >>
Re-write Qry without table variable
Posted by Liz at 6/1/2007 2:02:02 PM
Can anyone help me re-write this query without using the table variable?
Using SQL 2000.
Sorry about the formatting, it got lost once I pasted it here.
Thanks in advance!
Liz
--DECLARARTION FOR VARIABLES
declare @Claim_Service_Date_Start datetime
declare @Claim_Service_Date_End dateti... more >>
Simple query qustion for same column data merge
Posted by Ben at 6/1/2007 1:52:47 PM
Hi,
I have a table like following:
Column1 Column2
Partnumber PartnumberID
ADDG-1123 1
ADDG-1124 2
ADDG-1125 3
How to write a query to outp... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Cross scripts
Posted by Just D. at 6/1/2007 1:17:06 PM
It was a very interesting external DOS command many years ago allowing us to
add some external directory to the current one to make the files located in
this external directory visible like they are located in the current
directory.
Is there any way to join two databases on the same MS SQL ... more >>
memory setting in SQL SERVER 2005
Posted by mvp at 6/1/2007 1:03:00 PM
Hello EveryBody,
How can I set memory allocation to maximum (Of windows server) in SQL SERVER
2005.
We do have SQL SERVER 2005 running on Windows 2003 server which has 4 GB of
memory but I am not able to set all 4GB memory to SQL SERVER 2005 in setting
(From prpperty of sql server).
I can s... more >>
Begin Date from End Date
Posted by Colette at 6/1/2007 12:59:02 PM
I'm having some issues getting the days between two dates. I need to:
1.) subtract the begin date (cov_effective_date) from the end date
(cov_expiration_date) + 1
2.) Then, add the total days covered
3.) If it's greater than 20, then 20 will be added to my report
4.) If it's less than 20, the... more >>
removing duplicates
Posted by Dan D. at 6/1/2007 12:59:00 PM
Using SS2000 SP4. I found this code on this site to remove dupes.
DELETE FROM YourTable
WHERE EXISTS
(SELECT *
FROM YourTable AS T
WHERE addrkey = YourTable.addrkey
AND row_id < T.row_id)
I'd like to flag the duplicates first. Is this correct?
update YourTable set dupe_keep = 'Y... more >>
filtering duplicates
Posted by R C at 6/1/2007 12:56:00 PM
hi,
i have a table products. fields are:
productID
productCode
productName
productPartNumber
price
....
the primary key is productID but there is a unique constraint for
productCode, productPartNumber.
The staging table that the data is in prior to being inserted into this
table has d... more >>
Execute DTS from a DTS
Posted by Peps at 6/1/2007 12:01:22 PM
Is there a way of kicking off a DTS after successful completions of
other DTS's? I have a single DTS that's dependent on the successful
executions of 3 other DTS's. This job should not execute if any of
those previous 3 jobs failed.
Can anyone point me in the right direction? Thanks!
... more >>
BULK INSERT ERROR: Cannot perform bulk insert. Invalid collation name ....
Posted by gv at 6/1/2007 11:14:09 AM
Hi all,
Trying to bulk insert a csv file from a bcp command generated file but, get
this error:
Server: Msg 4839, Level 16, State 1, Line 3
Cannot perform bulk insert. Invalid collation name for source column 45 in
format file '\\MyServer\drive_e\temp\usage.fmt'.
First Column in Distin... more >>
Find first available block that does not intersect a range
Posted by Karch at 6/1/2007 10:38:30 AM
Given a number of numeric ranges, I need to find the first available row
(range) that can accomodate a requested block of contiguous values. For
example, given the following table definition:
CREATE TABLE [dbo].[tbl_AllocatedRange](
[RangeID] [int] IDENTITY(1,1) NOT NULL,
[RangeStart] [bi... more >>
Locking behavior in SQL Server 2005 - Expert help appreciated
Posted by at 6/1/2007 10:33:15 AM
Hello All,
I would like to know if there is a list with changes on the locking
behavior between SQL Server 2000 and SQL Serve 2005.
Just as an example, In SQL Server 2000, declaring a cursor "FOR
UPDATE" automatically adds a UPDLOCK hint to the cursor. In SQL Server
2005, this does not happ... more >>
DateDiff in a function
Posted by AkAlan at 6/1/2007 10:02:01 AM
Hi I have a function with a start date, start time, end date and end time. I
want to add a line in the function using Datediff () where I can get the
difference in hours between (start date and start time) and ( end date and
end time). Is it possible to do this from within the function. I'm t... more >>
Trigger that updates a column in same table?
Posted by Dave at 6/1/2007 9:25:00 AM
I have a trigger as follows that I want to update a column in the same table
on an insert...is this possible?
CREATE TRIGGER T_Insert_TableA ON dbo.TableA
FOR INSERT
AS
DECLARE @Id INT
SELECT @Id = inserted.TableA FROM inserted
BEGIN
UPDATE TableA
SET ColumnA = ColumnA * 1.25
W... more >>
Select Into vs Insert Into - Performance Issue
Posted by Ulysses at 6/1/2007 9:09:01 AM
I am running SQL Server 2000 in Simple Recovery Mode. Memory and Disk
Activity is not an issue.
I am working on a Reporting Solution and the DB is primarily used for
Reporting, i.e., not a lot of transactional processing on the tables ... the
inserts and updates only occur when data is bul... more >>
SQL 2005 Encryption "How many fields are to many to encrypt"
Posted by ltmsmgc at 6/1/2007 8:36:47 AM
I have a customer that says they want all of there data encrypted.
That would be 40 plus odd fields in a 96 field table.
We will be using Symmetric (AES)
I am wondering if there are pros and cons regarding encrypting ONLY
the most sensitive data vs maybe some data that is not as sensitive.
... more >>
SQL 2005 newbie question
Posted by Mike P at 6/1/2007 8:34:27 AM
How do you view triggers in SQL Server 2005?
*** Sent via Developersdex http://www.developersdex.com ***... more >>
sql server 2005 sp2
Posted by farshad at 6/1/2007 8:33:01 AM
Hi,
I would like to download SP2 for sql server 2005.
On microsoft web site:
http://www.microsoft.com/downloads/details.aspx?FamilyId=d07219b2-1e23-49c8-8f0c-63fa18f26d3a&DisplayLang=en
1)
Not sure which one of the three .exe files i should download.
Any suggestions please?
when runn... more >>
SQL 2005 Most Effecient way to Encrypt using Bulk Insert
Posted by ltmsmgc at 6/1/2007 8:32:49 AM
I have a table that contains approximately 2 million records on any
given day.
I the table has 96 fields and 40 or so are customer data that needs to
be encrypted.
We upload the data using the Bulk Insert.
Can anyone shed some light on what might be the best to get the data
being bulk inse... more >>
In SQL SERVER 2005 Queries are running very very slow.
Posted by mvp at 6/1/2007 7:58:02 AM
Hello Everybody,
We have upgraded database to sql server 2005 from 2000 in QA environment.
Still we have 2000 running in production with the exact same data what we
have in QA database.
We have found that after upgrading QA database to 2005 queries are running
extremely slow. All the indexe... more >>
Compare String
Posted by Verlin Moser at 6/1/2007 7:53:01 AM
I am triing to compare 2 strings and return what is different.... more >>
SELECT INTO query with DISTINCT and IDENTITY
Posted by ranco NO[at]SPAM speernet.nl at 6/1/2007 6:51:25 AM
Hi,
I am experiencing a strange problem with the query below:
SELECT DISTINCT(TABLE_SCHEMA) AS [Name], IDENTITY(INT, 1,1) [Id]
INTO ##TEMP_SCHEMA
FROM [INFORMATION_SCHEMA].[TABLES]
ORDER BY [TABLE_SCHEMA];
In SQL Server 2005, this query produces a temporary table with one
record for eve... more >>
Logical vs Physical Read
Posted by Ed at 6/1/2007 6:36:00 AM
Can someone please explain to me the diff. between those two and when the
Logical and Physical Read happen from Indexing standpoint?
Thanks
Ed... more >>
Deployment of web application in .Net 2.0
Posted by Amit at 6/1/2007 6:17:37 AM
Hi,I am new to .net 2.0 and have just built one web application and
deployed the application on web server. The problem which i am facing
is that if i make any changes in the .cs files or aspx files then
everytime i have to publish the site and give new upload for whole
site everytime which i fe... more >>
Error log
Posted by Leo Demarce at 6/1/2007 6:06:02 AM
from what table and from what database is the error log contained?
Thank you.... more >>
Without Cursors
Posted by Adam Sankey at 6/1/2007 5:57:03 AM
Is there a way of doing this without a case (just a update statement)?
I would be able to join tblQSMLoadItem_1 to tblLocation on AssetRef (to
MachineName) except for the EffectiveDate as there can be multiple location
for each item!
declare @AssetRef varchar(32)
declare cur cursor fast_f... more >>
Backup Question - [WP]
Posted by WILDPACKET at 6/1/2007 5:35:00 AM
Me totally new to SQL.
I created a backup job to backup MOM DB to D:\ drive. It works fine but I
noticed when the backup completes successfully daily it is adding to the
existing file I want it to overwrite the exsiting backup file instead of
adding.
Do I need to delete the job and ... more >>
Index on Calculated Column in an Indexed View not being used
Posted by jamesthurley at 6/1/2007 5:24:00 AM
Hi all,
I have an indexed view which is a join on three tables. The indexed view
also defines a column which is calculated from a few fields across two of the
tables. I have an index on this calculated column.
When I run a query which is filtered on the calculated column the index
isn'... more >>
[SQL2K] Get Error when using Execute
Posted by Bzh 29 at 6/1/2007 5:20:00 AM
Hi,
I'm wondering if there is a way to get info that an error occurs when
executing multi request with an Execute ?
I was using @@ERROR but it seems that is only contains the last request
execute in the muti-request ...
Example :
My Stored proc receive a string (VARCHAR 8000) that con... more >>
Handling "/" character in query
Posted by Kirk at 6/1/2007 5:05:14 AM
I have a table where one of the fields ("Filename") contains ftp urls
and looks like this:
"ftp://Engineering/OldRev's/230273A0.TIF"
When I do a query, it looks like this:
SELECT FileName, PathName
FROM FilesList
WHERE Filename Like '230%' AND PathName Like '%engineering%'
ORDER BY File... more >>
Fail-safe script to move data
Posted by Mike De Petris at 6/1/2007 3:56:41 AM
I need to schedule the migration of some data each night from one sql
server to another.
The databases has the same structure, but tables are filled by
applications on the first server, and each night inserted records have
to be moved to the second server. This way the first server will
restart... more >>
SSIS XML Source to SQL Server destination problem
Posted by Cris at 6/1/2007 3:47:00 AM
Hi,
I have an SSIS package which calls a web service and returns a Dataset
object in the form of an xml file (it does this successfully).
The Data Flow then picks up the file using an xml source task (in which use
inline schema is specified) , and passes it to an SQL Server Destination task ... more >>
Reference Tables Data
Posted by Sundara Murthy at 6/1/2007 3:43:00 AM
Hi Experts,
If i delete Master Table Data, automaticaly delete the reference table also.
is it possible in sqlserver2000
regards
Sundara Murthy S... more >>
Named query
Posted by surya at 6/1/2007 2:49:00 AM
can any body tell me in which scenarios i can use named query
thanks in advance
surya... more >>
Difference between READ COMMITTED and With(NoLock)
Posted by NAVIN.D at 6/1/2007 2:15:01 AM
when i mention at sp level as it SET TRANSACTION ISOLATION LEVEL READ
COMMITTED is that equivalent to using no lock on all update and select?
... more >>
Bulk insert UTF-8 files into SQL Server 2000
Posted by mahesh.aloysius NO[at]SPAM gmail.com at 6/1/2007 12:45:55 AM
I have a UTF-8 encoded file. How do i bulk insert this file into SQL
server. When i do the insert it gives me some special characters.
I've tried DataFileType='widechar' and codepage=1252 but dosen't seem
to work
I'm sure that SQL Server supports UTF-2 and UTF-4 files, but not sure
for UTF-... more >>
ORDER BY in 2005 view
Posted by Ray Greene at 6/1/2007 12:00:00 AM
Now that ORDER BY doesn't work the same in views as it did in 2000, is
it possible to get a view to return a sorted result?
I need something that will work like this did in 2000:
SELECT TOP 100 PERCENT *
FROM tblData
ORDER BY columnID
--
Ray Greene... more >>
db table design question
Posted by ricva at 6/1/2007 12:00:00 AM
We have an application which has its settings stored in a database
(SQL Server 2000)
We have (strong) disagrements on the best way to store these values,
and I am looking for advice on doing this.
Most of the values are not used by the stored procedures, just the
applications running on the c... more >>
Best way for generating a Sequenzenumber
Posted by Michel at 6/1/2007 12:00:00 AM
Hi
I'm interested to know what the best way would be to create a sequenze
number. For creating the number I would prefer not to use the Identity
function from a table. I'm more thinking to use a stored procedure.
How can I prevent that a number will be created twice? What are your
thoughts... more >>
migration sql 2000 to sql 2005
Posted by Mike at 6/1/2007 12:00:00 AM
I have to migrate around 15-20 databases that currently reside on SQL 2000
server, what is the best way to migrate them to SQL 2005? I've read some
posting on scripting the database, attaching to the sql 2000 database, etc.
what is the best way to migrate the db's to 2005?
... more >>
automatically retreiving stored procedure result set columns
Posted by PJ6 at 6/1/2007 12:00:00 AM
Is there a reliable, built-in (even if not documented) way of retrieving the
names and types of columns output by a stored procedure in SS25K?
One could dynamically generate SQL based on the required parameters, and
then execute it with guesses at acceptable default values. I don't exactly
... more >>
stop service
Posted by simonZ at 6/1/2007 12:00:00 AM
I would like to know, how to stop analysis service from job or from cmd
prompt?
thanks,Simon
... more >>
|