all groups > sql server programming > july 2006 > threads for friday july 28
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
SQL distance between Latitude and Longitude?
Posted by John Baima at 7/28/2006 8:50:00 PM
Does anyone have a script for calculating the distance between two
different points expressed in Latitude and Longitude? I thought that
we had that in our database, but we were not actually storing Latitude
and Longitude but some calculated values and I would like to change it
to just straight L... more >>
Deep SQL .Net integration question
Posted by Sean at 7/28/2006 8:49:01 PM
Is it possible for SQL 2005 to be holding an old sproc signature to a
specific table as it relates to ADO.Net or other .net functionality?
My short story is that I have made a net gain in the number of columns on a
table and I am getting errors when I create new update sprocs for that table. ... more >>
Stress Testing
Posted by Agi at 7/28/2006 6:00:09 PM
Hello, theres,
I set up a simple environment, 2 machines, one for sql 2000 EE(2 HT
CPUs, 2G RAM) , one for IIS + .net 2.0 (2 CPUs, 1G Ram)
In sql server,I create a simple table UserPwd (20000 records) to
store userid/password then write a simple procedure to do login, I set
userid as primar... more >>
Server & DTS question
Posted by Blasting Cap at 7/28/2006 5:21:09 PM
We're having to move SQL to a new server, which must be a new name.
Previously, I had been using an old name, and when the server was
replaced, we just gave the new one the old one's IP and name when we
brought it online.
Is there a way though, for me to make DTS and jobs in SQL "portable"... more >>
Help with Update and logging
Posted by KT at 7/28/2006 4:54:15 PM
Is there a way to run an update without it increasing the log size. I have
to do this on 2 million records and log file grows from 6GB to 25GB.
Thanks in advance.
... more >>
Odd behavier
Posted by plan9 at 7/28/2006 3:32:01 PM
Hello
The situation is I have two select situations one with a count and the other
with a SUM, The COUNT instruct goes well, the SUM instruct is a little picky
I had to make a date convertion to char to solve the 156 error that I had.
The weird stuff is that with the COUNT instrut I hadn't ... more >>
Standard naming convention for index and triggers?
Posted by tshad at 7/28/2006 3:28:00 PM
Is there a standard naming convention (best practice) for indexes, triggers
and keys?
I've seen indexes as:
Table name + Column name(s) + Unique/Non-uniqueness +
Clustered/Non-clustered
OrderDetails_OrderIDOrderDetailID_U_Cidx
This is fine if it is only one column, but what if the... more >>
Create Rule
Posted by HP at 7/28/2006 2:04:02 PM
Can you create a rule on more than one column? I want to create a rule for
the following condition, fldname1 != '' OR fldname2 != ''. Is it possible? if
so how?
Your help will be greatly appreciated.
THanks!... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Select Data from a stored procedure from within a stored procedure
Posted by Ed at 7/28/2006 1:29:14 PM
Hi, hopefully this is an easy question to answer (I don't mind feeling
dumb).
I have a stored procedure that calls a remoted stored procedure that is
selecting data (ie. select name from tblNames)
So my question is: How do I access the data from within my stored
procedure?
(ie. Select * ... more >>
Displaying output parameter in query analyzer
Posted by jerryk at 7/28/2006 1:08:35 PM
Hi,
Sorry for the basic question, but how does one user and display the value of
a stored procedures output parameter in Query Analyzer.
I tried the following:
Declare @ID int
exec myproc 1, 45, @ID
select @ID
I got NULL, when the result should have been a number.
Thanks,
jerr... more >>
Question about summing up different fields in different records
Posted by herman404 at 7/28/2006 12:54:25 PM
Hi everyone, I have some trouble writing a SQL stored procedure that
can do the following:
We have data in one table in numeric form, but we want to sum the data
in this table based on the values of two different alpha fields. To
illustrate, let me write the following example:
Table with t... more >>
any performance diff using -Between- or >= and <= ?
Posted by Rich at 7/28/2006 12:21:01 PM
Hello,
I need to run several queries that use 3 date args. Is there any
significant different between the following select statements? Performance?
what you capture?
Select ....
Where (date1 between @a and @b) and (date2 between @c and @d)
and (date3 between @e and @f)
Or
Selec... more >>
Query Profiler
Posted by Mark Goldin at 7/28/2006 12:19:29 PM
Would it be possible to monitor for a few days every query's execution and
collect the longest execution time (just that) for each different query?
Thanks
... more >>
Spreadsheet totals
Posted by Blasting Cap at 7/28/2006 12:08:43 PM
I have a query that I need to do subtotals on. The query is as follows:
select
ba,
rg,
sum(order_qty) as oqty,
sum(order_val) as oval
from sales_ord_curr_yr a
inner join sales_product on
sales_product.prod_cd = a.prod_cd
inner join tblproducthierarchy on
sales_product.level_1_1 + sales_... more >>
Stored Procedure executed from DTS
Posted by Fergus at 7/28/2006 11:41:02 AM
How can I access the Package Object which is executing my Stored Procedure.
I see lots of examples of running DTS from stored procedure. What I want is
to find out which package is executing my stored procedure (via exec sql) so
I can log the package name and step name along with my results.
-... more >>
parse again
Posted by Roger at 7/28/2006 11:15:26 AM
Hi MICROSOFT
Platform: Windows 2003 R2 64 bit 32 GB RAM
Sql Server 2005 Enterprise 64 bit with SP1 and all fixes
applied
Executing Parse in Sql Server 2005 Management Studio I get the following
error:
".Net SqlClient Data Provider: Msg 0, Level 11, State 0, Line 0
A seve... more >>
Too slow updates in a large table - Please help
Posted by Jay at 7/28/2006 10:49:23 AM
I have a very standard UPDATE query wherein I am updating a column in
one table-1 with data from column in another table-2 using a INNER JOIN
- standard stuff.
Now, I have several identical table-1s which I am updating with the
identical SQL statements. When I run it on tables with around 700K... more >>
Query to reconcile data
Posted by Timothy.Rybak NO[at]SPAM gmail.com at 7/28/2006 9:18:42 AM
I have a table with 3 columns:
Processdate ReportingPoint SerialNumber
When my customer starts construction on a part, they send a broadcast
to me that contains a date/time stamp, the serial number of the part,
and the reporting point "39".
Several hours, possibly days later, when... more >>
CLR and datatable
Posted by Curtis at 7/28/2006 9:11:02 AM
I am getting this error when I run my function
System.Data.SqlClient.SqlException: Invalid use of side-effecting or
time-dependent operator in 'SET ON/OFF' within a function.
System.Data.SqlClient.SqlException:
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception,
Boole... more >>
Database with many tables or multiple databases with lesser tables
Posted by Naveen at 7/28/2006 9:10:02 AM
We are building a large application (a financial system) that, after
normalization, would approximately need 1500 or so tables. The question is
should we build this as one database or should we separate it out into
multiple databases.
There is a case for separating out into 5 or so databases... more >>
Use SSIS For split record
Posted by Anja at 7/28/2006 8:16:02 AM
Hi,
I've many rows and I want to split them in many columns, with SSIS.
I've this scenario:
INPUT TABLE
id date
--------------------
1 2006-02-04
1 2006-03-08
1 2006-10-15
2 2006-03-07
2 2006-09-17
OUTPUT TABLE
id date1 dat... more >>
Save Schema Only
Posted by David at 7/28/2006 8:05:41 AM
How can I save a database schema without the table data but include views
and stored procedures? Thanks.
David
... more >>
SQL Server not responding.
Posted by kpraoasp NO[at]SPAM yahoo.com at 7/28/2006 8:00:17 AM
Hi,
I have SQL Server running on my local PC and that has around 40 Gig
assigned to it. I am running a stored procedure using isql from MS-DOS
prompt. this stored procedure inserts millions of rows into a table
(approx 400 Million). This process may take upto 3-4 days to run. The
stored proce... more >>
Exec in TSQL (SQL Server 2000)
Posted by Norbert Meiss at 7/28/2006 7:37:01 AM
Hi,
I need to know the result of a formula which contains placeholders for
actual values. It works with writing the value to a table and read it again
from there into a variable. But it must be an easier way to get the value to
the variable. Or?
TIA, Norbert Meiss
DECLARE @strBOM_Formula ... more >>
Problem with UPDATE and IF
Posted by mario.kornmesser NO[at]SPAM gmx.de at 7/28/2006 6:36:27 AM
Hello,
I have problems to arrange a proper SQL-statement. We are using
SQL-Server 2000 and Win 2003 Server
It seems that the failure is located in the "WHERE-clause". Especially
the IF-statement produces some errors (Runtime)
Maybe someone can check the syntax for a SQL-newbie.
I've tried ... more >>
Foreign Key may cause multilple cycles
Posted by gdonald20 at 7/28/2006 3:52:01 AM
Hi
I have a background in access and am relatively new to SQL.
I have migrated a database from access 2000 to SQL 2000 and experienced a
problem in the relationships i didn't previously have.
I have four tables A B C D each of these tables has a one field primary key.
Also each table co... more >>
Bulk Insert from Excel
Posted by Manuel at 7/28/2006 3:48:01 AM
I´m new to this subject. As a matter of a fact, the first time I´m trying
this.
I need to run a BULK INSERT query where the datasource is an Excel file and
the destination is a table in SQL 2000 Server.
After looking at the Books on Line, I´ve tried first:
BULK INSERT Database.dbo.Table_t... more >>
Random Numbers
Posted by Bharathi Kumar at 7/28/2006 12:49:48 AM
Hi,
I have a requirement in my project:
ex: User is running a scenario for 350 days. within this period some
events may occur. Each event has some duration. for ex: within the 350
days an event may occur for 5 times and the duration of the event is
for 10 days.
Each time whe... more >>
Sort Numbers in Nvarchar As Numbers
Posted by Andrew Hayes at 7/28/2006 12:00:00 AM
I've read several posts and articles about this, but they all see to revolve
around replacements and substrings and other paraphernalia. In my case the
nvarchar field can contain any type of numbers/letters in any combination,
but strings that are numbers should be sorted as such.
For examp... more >>
Filter Problem
Posted by ricky at 7/28/2006 12:00:00 AM
Hi
This is somewhat a trivial question, but I have query with some Date Params
in the WHERE clause, to filter on a certain period, or up to a certain
period (for historical analysis).
e.g
SELECT
SUM(Payment) AS Payment,
SUM(Recovery) AS Recovery,
MONTH(TransDate) AS TransMonth,
YEAR(T... more >>
data from production to test
Posted by Robert Bravery at 7/28/2006 12:00:00 AM
HI all,
Whats the easest way of getting data from the production database into the
test database, overwriting the junk in the test database
Thanks
Robert
... more >>
sql ERROR
Posted by Microsoft at 7/28/2006 12:00:00 AM
Hi,
I'm getting [Must declare the variable '@CNT'.] error while executing the
below query. Please help.
CREATE PROCEDURE [SSA_CATEGORY_ADDENTRY]
@TABLENAME VARCHAR(250),
@NEWENTRY VARCHAR(250)
AS
DECLARE @TMP NVARCHAR(250)
DECLARE @SQL NVARCHAR(250)
DECLARE @CNT INT
... more >>
|