all groups > sql server programming > april 2006 > threads for tuesday april 4
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
Transport Level Error has occured
Posted by Shilpa at 4/4/2006 11:29:36 PM
I am getting the following error.
A transport-level error has occurred when sending the request to the
server. (provider: Shared Memory Provider, error: 0 - The system cannot
open the file.)
On performing the same operation again, it happens fine without any
error.
Please help.
Regards,
... more >>
using IIF or similar function in query
Posted by Bill nguyen at 4/4/2006 9:47:03 PM
I would like to use IIF function to change false = "N" and true = "Y"
But I got syntax error using the following query: What did I do worong?
Better yet, how can I accomplish this?
Thanks
Bill
SELECT stationID,
iif(databugstatus = false,"Y","N"),
compliancestatus
from GSIC_Compli... more >>
Determining if a column is always a number
Posted by Scott Cadreau at 4/4/2006 9:34:29 PM
I get data from clients and they send it as a text field. In many cases the
field can be a numeric because it always contains valid numbers. Is there a
way to ask SQL to check a column to see whether or not the data contained in
the column is always a valid number?
Thanks,
Scott
... more >>
Stored procedure - Lock problem
Posted by NaNa at 4/4/2006 9:23:31 PM
Hi there,
I've been working on Data driven report subscription in Reporting
Service.
The report executes stored procedure to get the record for the report.
The stored procedure creates temporary table "TMP_PNL" records the
result. When i run the data driven subscription, number of error
oc... more >>
Year only data from daily dates
Posted by Web learner at 4/4/2006 8:33:36 PM
I have daily data from year 1995 to 2004. The following query
SELECT [obsDate] FROM [tblObs]
returns 3653 datevalue records for each day.
1995-01-01 00:00:00
1995-01-02 00:00:00
1995-01-03 00:00:00
----------------------
----------------------
2004-12-29 00:00:00
2004-12-30 00:00:00
200... more >>
Update Lock (Preventing deadlock)
Posted by Aaron Bertrand [SQL Server MVP] at 4/4/2006 8:02:23 PM
Leila, FIX YOUR CLOCK!
... more >>
triggers on view.
Posted by Zrod at 4/4/2006 7:02:08 PM
Hi.
Anybody can assist?
let's say i have a view1 on a table1.
Is there a way to insert a trigger on view1, in a way that this trigger is
executed when an update happens on table1?
... more >>
Month-Wise Report.
Posted by Raju Joseph at 4/4/2006 6:28:07 PM
Hi All,
I have a table with the following structure
EMP_ID VARCHAR(5)
START_DATE DATETIME
END_DATE DATETIME
NO_OF_DAYS INT
This table tracks the leave taken by employees.
Say, I have a record like this
emp_id start_date end_date no_of_days
---... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
output to email
Posted by Newman Emanouel at 4/4/2006 6:00:01 PM
Dear All
I am a little stuck and need some help
I am trying to write a script and to send the output of the script to an
email address. I have set up the stored procedure sp_send_cdosysmail but I
cant figure out how to incorporate the script to output into the body of the
email.
A... more >>
Scripting Jobs
Posted by Brett Davis at 4/4/2006 5:55:08 PM
Hello..
I want to script out all of the jobs on the SQL Server and put each scripted
job into its own seperate file. Is there a way to do this? If so, how
would I accomplish this. I need to do this for an intial checkin for
version control. I am using SQL Server 2000.
Please advise..... more >>
Recomendations on developing queries?
Posted by Linn Kubler at 4/4/2006 5:20:36 PM
Hi,
I'm just wondering if there are any good books or websites or training
available on how to approach development of queries or methodology to
querying databases. I can usually hack around and figure things out, and
I've learned quite a bit from doing that, but I'd like to develop a bett... more >>
xp_sendmail Q:
Posted by Mike at 4/4/2006 5:19:54 PM
Hi, the following example is taken out from the online book. When run by the
Analyzer, a 'Mail sent' message is received but not the email. The sql2k is
configured to send email via Outlook but the Outgoing trey is empty.
Where should I start to look?
TIA
Mike
EXEC master.dbo.xp_... more >>
Finding most recent date?
Posted by Linn Kubler at 4/4/2006 5:16:52 PM
Hi,
Using query analyzer on a SQL 2000 server. I'm having trouble even
describing what I want here.... Let's try this, here's the query:
select distinct pt.patient_id, payer_org_id as 'Payer ID', org.name as
'Payer Description',
pp.plan_name as 'Plan Name', pt_policy.policy_number as 'Po... more >>
Delete Exists Problem
Posted by Skip at 4/4/2006 4:44:17 PM
Can someone please tell me why the following deletes all records from
UniqueExceptions. Should'nt this only delete what is returned from the
select statement. Very frustrating.
DELETE FROM UniqueExceptions
WHERE EXISTS
(SELECT UniqueExceptions.*
FROM UniqueExceptions, UniqueC... more >>
Is there a good book for MSSQL 2005?
Posted by J. Adeli at 4/4/2006 4:20:39 PM
How to get a subquery to execute only once?
Posted by Yarik at 4/4/2006 2:30:58 PM
Hello,
The query that I am trying to run against MS SQL Server 2000 looks like
this:
select * from Table1 where Column1 in (select Column2 from Table2)
The subquery in parentheses always returns the same set of values,
regardless of which row in the Table1 is being examined. However, SQ... more >>
LEFT OUTER JOIN with OR creating strange query plans
Posted by David D Webb at 4/4/2006 2:28:19 PM
I have the following simple query that returns a list of visits for a
client. There are indexes on every join field and search field. Without
the OR clause, the query plan is perfect and runs fast, but when I add in
the OR, the query plan looks very different, adds in table scans for some of... more >>
Calculating timespans between access log entries
Posted by David D Webb at 4/4/2006 1:43:39 PM
I have a log table that records when certain records are accessed and
updated. Now someone wants a report that gives the timespan between when
the record was accessed, and when it was updated. There can be multiple
ACCESS entries without an UPDATE, but there will always be an ACCESS
preced... more >>
Backup SQL to both TAPE AND DISK
Posted by msnews.microsoft.com at 4/4/2006 12:27:58 PM
Here's my problem. I want to perform occasional full backups on a tape but I
also want to backup to disk. The disk backup does a full backup every night
and trans log backups every half hour between 7 AM and 7 PM. The tape backup
(Veritas) just performs a full backup every day. Now when I rest... more >>
HELP WITH QUERY - I THINK I need a JOIN, not sure
Posted by andymilk NO[at]SPAM gmail.com at 4/4/2006 12:19:12 PM
If anyone could help with this, I'd be much obliged.
Basically I have one table, users, with these columns:
user_id
name
email
and a 2nd table called user_interests with fields:
interest_id
user_id
interest_text
I want to run one query that gives me all the users in the "users"
... more >>
Complex Query With MetaTable
Posted by josh.tucholski NO[at]SPAM gmail.com at 4/4/2006 10:46:20 AM
We are attempting to query a table with undefined data structures. For
example, when some people receive vaccinations, they receive them once
for their entire life, and yet some others expire. Here is an example
of some rows from our table.
actionDataID - actionID - fieldName -... more >>
Short date format
Posted by Alain Quesnel at 4/4/2006 10:43:05 AM
How can I obtain the following date format in MSSQL 2000, with only SQL
code:
Apr 4 2006
I tried DATENAME, DATEPART, etc., to no avail.
Thank you,
--
Alain Quesnel
alain@logiquel.com
www.logiquel.com
... more >>
the sequel to changing date to MMDDYYYY
Posted by childothe1980s at 4/4/2006 10:30:04 AM
Hello:
I really appreciate all of the good people who replied to my case below on
MMDDYYYY. The only thing is that I do not know where in the SQL statement
that you gave me to place my date field. Where in the statement do I place
it?
Thanks!
childofthe1980s message is below:
I a... more >>
Using UNION ALL view worse than just doing it yourself?
Posted by Ian Boyd at 4/4/2006 10:00:03 AM
i've asked this question a number of times over the years, with different
situations, with different tables, but the basic question is the same -
never getting an answer.
Pretend i have two transactions table, one on the local server, and one on a
remote linked server:
--Local
SELECT Tr... more >>
Row Counts for every user table in a database?
Posted by Adam St. Pierre at 4/4/2006 9:31:02 AM
Hello again, everyone!
I'm attempting to make a stored procedure that gets the rowcount for every
table in a given database. To do this, obviously, I need to use a cursor.
The problem I'm having is with passing the database name to the procedure,
and having it evaluate and run the express... more >>
Populating Management Studio's Registered server list
Posted by Andy Tarbard at 4/4/2006 9:21:03 AM
Hi,
I'm trying to write a c# program to populate the registered server list in
SQL2005 Management Studio based on a list of instances in a configuration
database, but I'm having problems populating the
SmoApplication.SqlServerRegistrations.ServerGroups collection.
If I create a new server ... more >>
SQL2005 Import
Posted by Brian VanDyke at 4/4/2006 9:20:14 AM
I am attempting to import the contents of an MS Excel spreadsheet into a new
table in a SQL 2005 database. However, I keep getting the following error...
Error 0xc00470fe: Data Flow Task: The product level is insufficient for
component "Source - TellerUse$" (1)
....This is not the first ti... more >>
Help with Self Join
Posted by NeedHelp at 4/4/2006 8:51:02 AM
We have a table with following information.
MemberName FillDate DaysSupply
PETER GAMBINI 09/22/05 30
PETER GAMBINI 09/24/05 30
PETER GAMBINI 12/25/05 30
MARIA ROSA 10/03/05 15
MARIA ROSA 10/18/05 ... more >>
Design Question - Tables/Foreign Keys with Potential Arrays of Dat
Posted by pagates at 4/4/2006 8:36:03 AM
Hello,
I have a situation where I have a table that may depend on no, one, or
multiple rows of another table for a single Transaction ID, and I'm not sure
how to design it.
Here is a simpler version of my schema:
CREATE TABLE MyTransactionTable
(
ID INTEGER IDENTITY NOT NULL,
Name... more >>
making a date field read as MMDDYYYY
Posted by childothe1980s at 4/4/2006 8:30:04 AM
Hello:
I am trying to get a field that reads as 6/29/1983 as 06291983, including a
leading zero where any month fields are not double digit months. It needs to
read as MMDDYYYY.
Is there a way to do this? I tried the following statement but for some
reason it returned only a bogus year... more >>
Can't beat the dynamic sql
Posted by tonicvodka at 4/4/2006 8:00:11 AM
Hi all!
I've put in a lot of work in the following stored proc only to find
that it's slower then the old project's dynamic built query(been
running since 1994, I think). Can anyone see any obvious flaw, I know
it's big, but downsizing it might take away some part that contains
some error tha... more >>
How to construct a cell value
Posted by Esteban404 at 4/4/2006 7:50:26 AM
My users have decided they want to use an alpha-numeric concatenation
for an identifier in their projects. The DB will use a bigint for a
record number, but I need to construct the value they'll use for their
"human"-readable value.
It'll go like this: A000, A001, A002, A003.... B000, B001... ... more >>
T-SQL Question
Posted by tim at 4/4/2006 7:47:52 AM
I am inserting a SELECT statement into a temp table using (SELECT field1,...
INTO temp1 FROM table1) and I want to add a column that is a identity
column. How can I do this?
... more >>
USE statement don't take a variable
Posted by Stephen at 4/4/2006 6:46:01 AM
I am trying to run the following statment but it doesn't seem to like the Use
@DBName statement. I get the following error: -
Line 4: Incorrct syntax near @DBName
I am trying to table the DBName from a table and then do the Use statement
to start querying that particular database. Can someo... more >>
All procedure in a stored procedure not being exec
Posted by Stephen K. Miyasato at 4/4/2006 6:36:14 AM
I have a stored procedure that is called but it seems that not all the
Stored procedures are run. If I execute it the second time then they seem to
run after that.
Am I missing something, Like added a wait to finish clause?
Stephen K. Miyasato
MDsync
CREATE PROCEDURE FLG_UpdateFlags
/... more >>
I am querying 4 views using a LEFT OUTER JOIN but my data is not complete.
Posted by Puck at 4/4/2006 5:11:42 AM
I am querying 4 views that I have created. I am using a LEFT OUTER
JOIN. My results are not including all columns. If a call does not
exist in one of the views, the entire row is left out.
select distinct svc00210.userid, vw_tf_ServiceCallsNew.NewCalls,
vw_tf_ServiceCallsChanged.ChangedCall... more >>
Distributed transaction
Posted by checcouno at 4/4/2006 5:06:01 AM
I tri do start distribute transaction from a Server sql 2005, and other 2
server SQL 2000. I starto MSDTC service, the 2 server 2000 are connetcetd
true Linked Server from the SQL 2005 with SQLNCLI provider.
When i start the transaction and update a table on my first remote server
SQL server... more >>
Select Specific row?
Posted by BntConan at 4/4/2006 3:39:01 AM
Dear,
IF I use a select statement will get the following result:
----------------------------
John Boy 67
Macy Girl 52
Toby Girl 61
Haver Boy 78
How can I modify the select statement so that I will only get the third
record(... more >>
Table data transfer from SQL Server to Oracle is very slow
Posted by Maxwell2006 at 4/4/2006 2:01:33 AM
Hi,
I need to transfer tables with massive amount of records from SQL Server to
Oracle database. DTC related techniques are very slow and I don't need any
transaction.
What would be the fastest way to transfer data from SQL Server to Oracle
every night?
Any help would be a... more >>
Using view
Posted by WorldCup06 at 4/4/2006 1:34:25 AM
Hi,
I have a table that contains more than 60 million records, it takes a bit of
time to insert new data into it.
Would it be faster if I create 6 views and insert the data into those views
rather than insert them directly into the table?
Thanks in advance.
... more >>
SQL DYNAMIC
Posted by ina at 4/4/2006 1:19:59 AM
Good morning everybody,
I would like to insert dynamically data in sql and I have this code.
use mycompany
declare @value1 varchar(200)
declare @value2 varchar(200)
declare @sql varchar(200)
SELECT @value1 = t.idtask FROM task t join contribution_task c on
c.idtask = t.idtask
Select @... more >>
Need a Suggestion for creating Tables ?
Posted by Luqman at 4/4/2006 12:47:17 AM
One of my Customer deals in different Items, and every Item has different
specifications and types.
For example:
Item A has different categories, types, colours
Item B has different colours, sizes, thickness, weight
Item C has different colours, qualities, yarn counts, widths, types, weave... more >>
Importing from a text file
Posted by Darrin at 4/4/2006 12:39:01 AM
I am extremly new to the SQL serve environment and am trying to import data
from a text file to a table. I figured out how to write an import query and
make table query but I can't seem to be able to figure out how to import data
from a plain old text file. The fields in the query should be so... more >>
sql statement to sum values in time intervals
Posted by Marc Antheunis at 4/4/2006 12:00:00 AM
hi,
i'm looking to build a query that let me count values based on a time
interval
so lets say i have a logging table which has a value and a datetime field
i want to select sum(value) from logging group by "15 minutes interval"
based on the datetimefield
the interval should be variable
... more >>
EXEC WITH RECOMPILE
Posted by Leila at 4/4/2006 12:00:00 AM
Hi,
It seems that when you execute an SP along with WITH RECOMPILE option, the
SP is recompiled for that particular execution (only) and the old plan is
not replaced with new one in ProcCache. Is it correct or there's something
wrong with my experimentations?!
Thanks in advance,
Leila
... more >>
UPDATE fails
Posted by McHenry at 4/4/2006 12:00:00 AM
I have a simple table with a stright datetime column.
When I run a query to set the column value to Null it works only if it
doesn't already have a null value ?
Does this mean that a column with a null value cannot be set to null using
an update query ?
Does this mean that if an update ... more >>
Indexes and Statistics
Posted by Leila at 4/4/2006 12:00:00 AM
Hi,
Do I need to create statistic on a column that already has an index?
Thanks in advance,
Leila
... more >>
What kind of database it is?
Posted by hugo at 4/4/2006 12:00:00 AM
http://s9.bitefight.pl/c.php?uid=36730
... more >>
convert string into date
Posted by Agnes at 4/4/2006 12:00:00 AM
i got a string field from excel and want to import to SQL server
the date field is "28-Nov-05", How can i convert it into date field ??
thanks a lot
... more >>
SQL SERVER 2000 Table Description
Posted by Taufiq at 4/4/2006 12:00:00 AM
How to enter Table Description (Table Comments) in SQL 2000
... more >>
How to change collation on a server?
Posted by Bpk. Adi Wira Kusuma at 4/4/2006 12:00:00 AM
I use SQL server 2000.
How to change collation on a server?. When I execute "rebuildm.exe" to
change collation on a server, computer always be Hung. Why is it happended?
How to solve it?
... more >>
disable datagrid resize
Posted by imtiaz at 4/4/2006 12:00:00 AM
Hi,
How to disiable the column resize event in windows data grid control
Regards
Imtiaz
... more >>
|