all groups > sql server programming > september 2007 > threads for thursday september 20
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
Difference in query execution from QA and application
Posted by Arjan de Haan (ha) at 9/20/2007 10:48:58 PM
Hi.
Not sure if this is the proper newsgroup, but here it goes...
We have a view (large, accessing lots of tables) which for some reason is running fine
when called from the Query Analyzer - returning within a couple of seconds - but times out
when executed from our application. It is exac... more >>
my first attemp at a function... one error left, but not sure why
Posted by Aussie Rules at 9/20/2007 10:17:54 PM
Hi,
I have some data in a field that I need to convert into a new value. I want
to be able to select from my table, but have the resultset have the
converted values, not the actual table values.
for example, a normal select against the table with the actual values would
be
select fiel... more >>
SQL query question
Posted by stevenleongusa NO[at]SPAM gmail.com at 9/20/2007 10:11:23 PM
I am new to SQL query. Can someone help me to solve this question?
1. Given the following schema of an employees table:
*employees (*
* empid integer primary key, -- employee id number*
* dept string, -- the employee's department number*
* salary float, ... more >>
urgent help needed. Extract part of a string value
Posted by Aussie Rules at 9/20/2007 8:45:15 PM
Hi,
I have a database with a col that contains latitude and longatude values
stored in hours, minutes and seconds such as S26-34.8.
I need to be able to convert from this HMS format to decimal format.
To do this I have to get the values of the Hours, Minutes and Seconds and
do some mat... more >>
Sql PASS or Sql PASS OVER
Posted by Steve Dassin at 9/20/2007 8:04:37 PM
Does anyone recall Ben-Gan's quite eloquent plea for furtherance
of the OVER clause:
Itzik Ben-Gan and Sujata Mehta
OVER Clause and Ordered Calculations
http://www.insidetsql.com/OVER_Clause_and_Ordered_Calculations.doc
which follows the sql standard of a window that's quite simple and
pow... more >>
Calling all SQL Junkies!!!
Posted by bfount NO[at]SPAM gmail.com at 9/20/2007 7:56:41 PM
I have been working on this query for 2 days now and I am offically
stuck.
Scenario:
An Application using a sql 2005 backend creates several tables daily
that have a date suffix.
(I.E. vpn_events_2007_09_21)
i need to write a report against this table and join it to other
tables which also ha... more >>
Question about "DROP PROC"
Posted by Curious at 9/20/2007 1:53:15 PM
I see sample SQL Statement below:
IF OBJECT_ID('tempdb..#TruncateTable') IS NOT NULL
DROP PROC #TruncateTable
Obviously, #TruncateTable is a temporary TABLE. How come it's using
"DROP PROC #TruncateTable" instead of using "DROP TABLE
#TruncateTable"? I wonder if this is a correct SQL statem... more >>
64 bit memory usage
Posted by Mark at 9/20/2007 1:31:41 PM
Hello,
We are going to be running SQL Server 2005 Standard on a Windows 2003 Server
(standard or enterprise) machine with 8 GB of RAM on a Dell 2950. For
various political reasons (please don't question) we have pressure to use a
32 bit OS rather than 64 bit OS.
I'm told that a 64 bit S... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
parsing a varchar field to use with soundex
Posted by Blasting Cap at 9/20/2007 1:09:58 PM
I need to write a stored procedure that will take a field and parse it,
then run a soundex function against it, and return anything with a
soundex value like the string i am passing in.
For example, the data looks like this:
Rec 1: Brown house
Rec 2: House, brn roof
Rec 3: Apartment, ... more >>
Stored procedure error or ASP error?
Posted by Justin Doh at 9/20/2007 1:06:01 PM
I have been working this for quite a while, but I am not making any progress
to find the cause of this error - "Error updating recommendation"
The question is whether there is something wrong in @BidAmt numeric(11,2)
notation on its stored procedure or whether there is any issue with ASP cod... more >>
Where is the missing row?
Posted by Jay at 9/20/2007 10:31:15 AM
SQL Server 2000
The following code should product 3 rows, but it only produces 2.
How can I get it to produce 3 (without changing the data in the tables)? The
only way I can think of is to dump the join and do it in a procedural loop.
Query:
use tempdb
if OBJECT_ID('tmp_names') is not... more >>
Linked server
Posted by Mark Goldin at 9/20/2007 10:28:19 AM
I am trying ro create a linked server. If I specify a data source that =
points to local data it works fine, but if I use a mapped drive then =
select statemnet returns:
OLE DB provider "VFPOLEDB" for linked server "specifications" returned =
message "Invalid path or file name.".
Msg 7303, Le... more >>
I need some assistance...not sure how to do this
Posted by Chris at 9/20/2007 10:16:02 AM
Hi,
I am tasked with a query with which I am not sure how to start. I need to
cut ordes in an order table to match the quantity we have in inventory so in
each product in the inventory table, i have to get the quantity on hand, then
go through the orders table, sum up all the orders for that ... more >>
restore my table
Posted by rodchar at 9/20/2007 9:16:02 AM
hey all,
is there an easy way to restore just a particular table in my db from a
backup?
thanks,
rodchar... more >>
Questions about a trigger
Posted by Curious at 9/20/2007 9:11:47 AM
I see SQL statements for creating a trigger as below:
CREATE TRIGGER TRcorChangeEmailAddress
ON dbo.DistributionEmailInstance
AFTER INSERT, UPDATE
AS
DECLARE @MyEmailAddress DTEmailAddress
SET @MyEmailAddress = 'John.Doe@any.com'
IF UPDATE ( EmailAddress )
BEGIN
UPDATE dbo.Distr... more >>
Script to create all tables in a database
Posted by qjlee at 9/20/2007 8:52:02 AM
I have an existing database which contains more than 100 tables. Is there any
way I could create the script to recreate these tables all in one time. I
can not just copy the whole database because I need to make some change in
the data type.
Thanks,... more >>
copy of my table
Posted by rodchar at 9/20/2007 8:22:01 AM
hey all,
is there an easy way to make a copy of my table, besides backing up the
whole db... more >>
Link table issue
Posted by Peter Hyssett at 9/20/2007 8:04:03 AM
Hi.
Part of my system (edited for security) is like this:
CREATE TABLE Entity1 (Entity1key char(10) NOT NULL, lots of other columns)
CREATE TABLE Entity2 (Entity2key char(3) NOT NULL, other columns)
CREATE TABLE Link (Entity1key char(10) NOT NULL, Entity2Key char(3) NOT NULL,
... more >>
Getting first non-null field in recordset
Posted by Froefel at 9/20/2007 7:52:45 AM
I'm facing a challenge for which I'm looking for some help on how to
approach it.
Given the following sample table, which mimics an extraction of log
records for a given product:
TxID ProductID Flag Name Location Inv2 Timestamp
=============================================... more >>
Sort order by day or month
Posted by bcap at 9/20/2007 7:42:21 AM
How can I query a date in chronological order by the day of month? I
am trying to make a list of birthdays by the day of month it is versus
year.
For example:
Jan:
1/1/2000
1/13/1989
1/22/1993
1/23/1999
1/30/1958
Any thoughts and advice is much appreciated.
... more >>
date having a number to day
Posted by Jesus at 9/20/2007 5:00:00 AM
with datepart function have a number corresponding to year to certainly date.
How can obtend the day having a number to day and to the year 'x'.
thank's for all... more >>
Newbie having problems
Posted by J at 9/20/2007 3:20:15 AM
Hi Everyone,
I am newish to SQL and am trying to write a script to pull data in from one
data base container table and up date a field in the "USE" database in a
temporary table.
I am getting most of the coding to work but I am stuck on a point which is
stopping the process from being au... more >>
distributed query
Posted by Marco Sellani at 9/20/2007 3:02:03 AM
I've this problem:
I've a lot of stored procedures with code like this to move data between
databases:
USE DB1
SELECT *
INTO DB2.Company
FROM Company
how can i parametering the target database DB2 ??
Thanks.
marco.
... more >>
Is there a Better Way than SendResultsRow for a CLR Stored Procedure?
Posted by Charles Law at 9/20/2007 2:02:30 AM
I am using CLR in SQL Server 2005, and the read from the database and
manipulation of the data is reasonably fast. What seems to be really slow is
the output of my results.
I produce an array containing ~47,000 elements and I wish to return each as
a row to the caller of my CLR Stored Proce... more >>
Sorting data in a certain way
Posted by Blackberry at 9/20/2007 1:46:47 AM
Hi All
Wondered if you could help. I'm using SQL queries in Access 2003 and I
can't fathom the below.
My table data is defined as follows:
TERMID SHORTNAME YEAR
0 Sep 2007
0 Sep ... more >>
populate table or database?
Posted by claudia.inaciofong NO[at]SPAM googlemail.com at 9/20/2007 12:42:17 AM
I'm new in sql server 2005, and I was wondering how can I populate a
table or database?
Cheers
C
... more >>
Should I use a contraint?
Posted by Michael C at 9/20/2007 12:00:00 AM
I have a table that stores email that are to be sent out via a service. The
email can have a status of
1. Waiting to send
2. Sent
3. Send fail
The table has a field called DateSent which stores the date the email was
sent. This field will only have a value if Status = 2. Should I add a
con... more >>
Calling Stored Procedure with...
Posted by AshokG at 9/20/2007 12:00:00 AM
Hi,
What's wrong with this code?
DECLARE @LocationCode VARCHAR (10)
SET @LocationCode = 'THIS WORLD'
EXEC PrintMessage 'ThisProcedure', 'Calling AnotherProcedure With: ' +
@LocationCode
I'm getting this error
Msg 102, Level 15, State 1, Line 3
Incorrect syntax near '+'.
... more >>
SQL Server 2000 - error 8650 - Inter-query parallelism
Posted by Stephen Howe at 9/20/2007 12:00:00 AM
Hi
Running SQL Server 2000, SP4 one one ouf our servers when I last checked.
I believe it has multiple processors as sometimes Query Analyser shows the
small yellow circle symbol with arrows on execution plan icons.
One of our programs produced
[Intra-query parallelism caused your server... more >>
can views or SPs be used in a In/Not In ?
Posted by luna at 9/20/2007 12:00:00 AM
we have a set criterea for records that shouldn't be shown in queries, this
is replicated in practically every SP
eg select records from table where table1.ID is null and table2.id is null
and table3.id is null
could i put the criteria say in a view or SP and reference it with NOT
IN(vie... more >>
Get a list of servers on a network.
Posted by Mufasa at 9/20/2007 12:00:00 AM
Is there any way to find out what servers are on a network? We need this
because we think we may have 'rogue' servers out there.
TIA - J.
... more >>
SQL 2005 Table scripting issue??
Posted by LPR-3rd at 9/20/2007 12:00:00 AM
I am having a problem when I script a table out of SMS 2005. Below is
the script generated....
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
USE [Closing_Balance]
GO
/****** Object: Table [dbo].[CB_TypeListByLoc] Script Date:
09/20/2007 08:52:09 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER O... more >>
Insert data from XML file into MSSQL 2005 ... what is wrong?
Posted by aja74 at 9/20/2007 12:00:00 AM
Hello
I have XML file:
<?xml version="1.0" encoding="windows-1250" ?>
<transfer type="myType" version="1.1">
<header>
</header>
<body>
<entities type="doc" approx_count="93">
<docs>
...
</docs>
....
</entities>
<entities type="state" approx_count="20210">
<... more >>
Read Uncommitted instead of query hints
Posted by Bassam at 9/20/2007 12:00:00 AM
Hello
If if have a complex SELECT query with say 10 tables in Joins in a stored
procedure , if i start the procedure by setting transaction level to be READ
UNCOMMITTED , will that have the same effect as setting query hint WITH
(NOLOCK) in each individual table in the query ? like
From ... more >>
SQL 2000 UNION bug?
Posted by João Araújo at 9/20/2007 12:00:00 AM
The select * from [table2] query returns this:
f1 f2 f3
15202958 1.0000 8.6007
Q0114894 1.0000 67.1990
U0247625 1.0000 101.8559
U0512099 4.0000 72.4024
It should return:
f1 f2 f3
15202958 1.0000 8.6007
Q0114894 1.0000 67.1990
U0247625 1.0000 10... more >>
|