all groups > sql server programming > may 2004 > threads for friday may 7
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
crystal report
Posted by toylet at 5/7/2004 10:19:10 PM
Is there a hot newsgroup that talks about using Crystal Report?
--
.~. Might, Courage, Vision. In Linux We Trust.
/ v \ http://www.linux-sxs.org
/( _ )\ Linux 2.4.26
^ ^ 10:16pm up 6 days 23:39 load average: 1.00 1.01 1.01... more >>
store procedure or ...
Posted by shawn at 5/7/2004 7:01:05 PM
Can I create a store procedure that I could fire up from a Visual Basic program?
If so, how do I create the procedure, which could update tableA.col1 and tableA.col2 from tableA based on the join key colkey in tableB with tableB.col1 and tableB.col2.
... more >>
Artificial Keys, and Concurrency
Posted by j.m.autry NO[at]SPAM earthlink.net at 5/7/2004 6:03:49 PM
Currently I maintain artificial keys on tables by reading the max,
incrementing it, and storing the next entry with associated data.
Unfortunately, someone else may read this same value a try to store it
also creating a constraint violation. Instead of using exclusive
locks on the table for re... more >>
concatenating results
Posted by Ed at 5/7/2004 5:53:59 PM
I have two tables, COMPANIES and COUNTRIES.
In COUNTRIES, I have these data:
CountryID | Description
1 | USA
2 | Canada
3 | Mexico
....
In COMPANIES, I have these data:
CompanyID | CountryID
1 | 1
1 | 2
1 | 3
2 | 2
3 | 1
3 | 10
Basically, a company can be located in multiple... more >>
Please help with populating my fields
Posted by Learner at 5/7/2004 5:27:09 PM
Hi,
I have a table whose DDL is given below:
CREATE TABLE [Orders] (
[OrdID] [int] ,
[OrderDate] [datetime] ,
[1OrderDateONLY] [datetime],
[1OrderDayName] [nvarchar] (15),
[1OrderMonth] [nvarchar] (25),
[1OrderDayOfMonth] [smallint] NULL ,
[1OrderWeekofYear] [smallint] NULL
)
GO
T... more >>
Need help regarding grouping/summing my data - from daily to Month and Year level
Posted by Learner at 5/7/2004 5:27:02 PM
Hi,
I have a table whose DDL is given below and which contains data for the
last couple of years....
CREATE TABLE [DailySales] (
[InvoiceDate] [datetime] ,
[ProdCode] [varchar] (20) ,
[ProdQty] [numeric](20, 8) ,
[TotalSale] [money]
)
GO
What I want to do is populate the... more >>
Simple Query
Posted by EverGimp at 5/7/2004 5:00:58 PM
Doing a query on tables and we want to order those by date desc.. So that
the last date is first. Except, we'd like the values which have null dates
to be at the very top.
A union would work, but I figured there was a really elegant way to do an
order by that would accomplish it.
... more >>
Reading File?
Posted by Joseph Lee at 5/7/2004 4:38:28 PM
Is there any way of reading values in an external file with T-sql to be
inserted into database.
I would like to keep it to just sql codings instead of using other
programming languages to do the process.
Why i am doing this is because whenever an insert is done i have a trigger
attached that ... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
FIRST
Posted by Gianmaria Iaculo at 5/7/2004 4:32:09 PM
Hi,
i'm tring to use the FIRST function from standard SQL in a SQL server 2000
View... but this give me an error.. any suggest?
Regards,
Gianmaria
... more >>
pass argument into a sp
Posted by Marc Baker at 5/7/2004 4:08:36 PM
Hi all,
Newbie here, so please take it easy on my.
I am trying to pass results from a select query to a stored procedure as an
argument, and am having trouble firguring this out. Need to imbed in a sql
script. Any help would be greately appreciated.
Basically:
SELECT ID FROM TABL... more >>
Time range query problem
Posted by Alex at 5/7/2004 3:39:14 PM
Hi NG's...
I have a problem with an SQL query I'm trying to write, though this is not
really an SQL problem - which is why this message is strangely cross-posted.
I have a set of data in a table which, among other columns, has a
"StartTime" and an "EndTime" column. The data relates to proces... more >>
Running classic ASP on IIS 6.0 with SQL 2K & Win2k3 SBS
Posted by Justin B. Michaels at 5/7/2004 3:31:37 PM
Hello,
I am trying to determine why a classic ASP application is suffering from
performance problems running on SQL 2000 and Win2k3 SBS. I developed the app
on Win2k where it performs flawlessly. After duplicating the database on the
new server (Win2k3 SBS) as well as ODBC DSN connections ... more >>
Extended Stored Procedure and bigint
Posted by tomta at 5/7/2004 3:26:06 PM
Hello, I've written an extended stored procedure for some custom processing
we need to do. The xp takes 2 arguments: strId varchar(23), numId bigint
output.
I noticed that the bigint argument shows up in my dll as a SRVNUMERICN data
type when I call srv_paraminfo(). It is not identified as ... more >>
Error on database restore using Enterprise Manager
Posted by hb at 5/7/2004 3:22:25 PM
Hi,
I have 3 databases located on 3 different servers:
Database #1: NewArchitecture
Location: Server1
File location:
D:\sqldb\NewArchitecture_Data.MDF
D:\sqldb\NewArchitecture_Log.LDF
Database #2: goodofficesnew
Location: Server2
File location:
E:\goodofficesnew\goodofficesnew_Dat... more >>
Sending email
Posted by simon at 5/7/2004 3:13:28 PM
I'm sending email from my database:
DECLARE @object int
DECLARE @hr int
DECLARE @besedilo nvarchar(4000)
set @body=(SELECT body from tableBody where id=1)
EXEC @hr = sp_OACreate 'CDO.Message', @object OUT
EXEC @hr = sp_OASetProperty @object, 'From','simon.zupan@stud-moderna.si'
EXEC @hr =... more >>
JDE Date Format to SQL Date
Posted by julio delgado at 5/7/2004 2:59:18 PM
Any tips on converting JDE (JD Edwards) Date to SQL Date.
Thanks
... more >>
SELECT with DATENAME
Posted by Marek Powichrowski at 5/7/2004 2:51:02 PM
Hi all,
I have the table with datetime column (data_alertu). I want to make select
to get data about alert count for week numbers.
SELECT DATENAME(week, data_alertu) AS Tydzieñ, COUNT(DATENAME(week,
data_alertu)) AS 'Ilo¶æ alertów'
FROM _Alerty
GROUP BY DATENAME(week, data_aler... more >>
select where clause with posability of nulls
Posted by Brian Henry at 5/7/2004 2:25:42 PM
Hello,
I have a table like this
CREATE TABLE [dbo].[Addresses] (
[AddressID] [int] IDENTITY (1, 1) NOT NULL PRIMARY ,
[ZipCode5] [char] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[Type] [char] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[Address1] [char] (50) COLLATE ... more >>
How to avoid the table scan in the
Posted by John at 5/7/2004 2:11:02 PM
I have a user defined funcation to get the every day in a date range. Is this possible to create an index on @myTable, since the table scan hurts the performance a lot
Thanks
CREATE FUNCTION [dbo].[udf_return_daterange
@date1 smalldatetim
, @date2 smalldatetim
RETURNS @myTable ta... more >>
Database table names queries.
Posted by Henk Roos at 5/7/2004 1:55:38 PM
Hi All,
what I want to know is how can I get the table names and field names from a
database without knowing what databases there are.
Thanks
Henk
... more >>
How to make an existing column as identity column (SQL Server 2000)
Posted by Venkat at 5/7/2004 1:51:28 PM
Hi All,
Can you please tell me how to make an existing column as identity column.
I tried the following but I get the error:
Server: Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'identity'.
create table test1 (
emp_id smallint not null,
emp_name varchar(15) not... more >>
SQL Training Recommendations?
Posted by jcochran.nospam NO[at]SPAM naplesgov.com at 5/7/2004 1:34:28 PM
I have an employee with a strong background in VB and Java, as well as
two decades of RPG, DB2, etc. database programming in System36 to
OS/400 environments that I need to get up to speed on SQL programming.
This wouldn't be the typical Admin training courses, and even the
Microsoft 2073 (Progra... more >>
xp_cmdshell
Posted by Chuck at 5/7/2004 1:25:11 PM
I need help with coping a file from one server to anoter server. I am trying
to use xp_cmdshell with no success. Here is a sample of what I am trying to
do.
xp_cmdshell 'copy f:\mssql7\warehouse\joblogs\hazen02_kill_processes_5-5-04
l:\temp'
The L: drive is on another server, do I need to u... more >>
Simple OSQL
Posted by Stephen J Bement at 5/7/2004 1:19:54 PM
How can I print the sql script of a proc or function to the console via
OSQL?
--
Semper Fi,
Red
Please post to newsgroup only
... more >>
enumerate local sql2000 instances when disconnected
Posted by John at 5/7/2004 1:18:32 PM
Please don't tell me it is not possible to enumerate local instances of
SQL Server 2000 when disconnected from the network using Win2000 or WinXP.
How does Enterprise Manager do it? I tried the following, neither of
them worked:
osql -L
SQLDMO.ListAvailableSQLServer
Thanks... more >>
Q: Derived table--should I use WHERE in there?
Posted by canimal NO[at]SPAM my-deja.com at 5/7/2004 1:09:34 PM
I have a stored procedure that will use a derived table. That derived table
will be JOINed against another table, and a WHERE clause applied to the
whole thing, so only a small fraction of the rows of the derived table will
be used.
It is quite possible for me to add a WHERE to the derived... more >>
Query Slow
Posted by Rodger at 5/7/2004 1:06:05 PM
Hi I have a query which returns 9000 rows in 6 minutes, the problem is with the select top 1 statement which hits the atstransacts table having 14 million rows, if the order by is removed from the select top 1 query the overall query returns rows in 5 sec. any suggestion to change the query or to i... more >>
updating data
Posted by hammer at 5/7/2004 1:06:05 PM
Hi all
I have a field in a table that contains names
The data contains for example..
'Mrs. jane doe
'Mr. John doe
What I want to do is update the database to remove 'Mr. ' or 'Mrs. ' from the name field
Can someone tell me what the sql would be
Thanks
Hammer... more >>
Another try
Posted by james at 5/7/2004 12:10:09 PM
Sorry for reporting this but I can see from the dates on postings that if a
question goes
un-answered for more than a few days, it never gets re-visited. so...
I have a reflexive table Employee i.e. I can have a CEO with many VP's, each
VP can have many Managers etc... So basically I have an n... more >>
between a and g inclusive
Posted by Bryan Harrington at 5/7/2004 11:59:14 AM
Hello.. is there a way to do a Select first_name, last_name where last_name
between 'a' and 'g' and include all the g's?
While it's logical to me that you would get everything between a and g, it
seems counter-intuitive, not to mention not so easy to explain to Sally
Secretary.
Thanks!
... more >>
Diacritic characters being "stripped"
Posted by Matt Penning at 5/7/2004 11:56:47 AM
Hi, I'm wondering if anyone knows why diacrcitic characters might be
"stripped" or normalized.
I'm using an nvarchar field (i.e. Unicode), and if I insert this
character: C with an upside down ^ over it - via a normal insert
statement in QueryAnalyzer, and then select it back out via
Quer... more >>
help with query syntax
Posted by mitra fatolahi at 5/7/2004 11:54:39 AM
Hi Everyone,
I have this table:
Create Table PerformanceIssue
(
PRID UniqueIdentifier NOT NULL,
PRCode Int NOT NULL,
PRDesc Varchar (100) NOT NULL
)
I like to query for a certain PRID:
SELECT PRID, PRCode, PRDesc
FROM PerformanceIssue
WHERE PRID = '6A4E7F8-05C3-42D1-A5B7-... more >>
tool/software
Posted by tb at 5/7/2004 11:51:05 AM
Hi
I am working as a project manager for a team of 6 developer
I am looking for a tool/software to help me track task assigned to developers and their statuses
Any help is highly appreciated
Thanks
Tom Brad
... more >>
Bcp problem
Posted by majestic at 5/7/2004 11:41:03 AM
What is the row terminator in bcp for line feed {LF}. It works fine with DTS when I used Row terminator as {LF}, but it is giving error when I used row terminator \n. Can you help me.... more >>
Adding Time
Posted by Heiner at 5/7/2004 11:07:55 AM
Hi, How can I add hours in sql?
I need to summarize a column with datetime values.
Some Idea?... more >>
_hypmv_0 - unknown dependency
Posted by unaur at 5/7/2004 11:00:23 AM
Hi I am trying to drop a table but its giving error
message
Cannot DROP TABLE 'dbo.Tablename' because it is being
referenced by object '_hypmv_0'
I cant even find the object name _hypmv_0 in the database.
Please help to solve this problem
Thank you... more >>
Performance problems with user functions & variable parameters
Posted by Tony Wilton at 5/7/2004 10:43:17 AM
I have created a user sql function that does aggrigate queries on a table
(against a clustered primary key).
When the function is called with the parameters 'hard coded' the function it
runs in under 3ms.
When the function is called with the parameters passed as variables the
function it runs... more >>
help in database updations.
Posted by SPG at 5/7/2004 10:33:33 AM
Hi all,
Let me first explain what I am trying to do. I have a web app, where from my
asp page, i call a stored procedure.
Now this page is used by N users concurrently. This SP updates a table,
updates a second table with first as ref,
and clear first table. in between there is a delay of... more >>
Auto Increment Columns
Posted by Nice Chap at 5/7/2004 10:33:00 AM
Auto Increment columns are cool, but is using them a good design ? One major
problem we run into with auto increment columns acting as keys is when we
export data and try to import them. Other than this are they any other
disadvantages? Also, do you think DTS can solve the problem of Autoincremen... more >>
lenght of varchar including spaces?
Posted by Jeff Langston at 5/7/2004 10:30:49 AM
How can I find the length of a varchar including spaces? The len function
does not count spaces!!!!
Thanks,
--
Jeff Langston
Director of Product Development
Cashless Systems, Inc.
MCP, MCAD
... more >>
Table with multi-record comments
Posted by Jami Bradley at 5/7/2004 10:21:53 AM
Hi all,
I am working on some data conversion, and I have been given a table that looks something like this:
-----------------------------------------------
-- DROP TABLE dCommentTest
CREATE TABLE dCommentTest
(
[KeyName] [nvarchar] (10) NOT NULL ,
[LineNum] [int] N... more >>
Day of the week
Posted by Mario Reiley at 5/7/2004 10:15:36 AM
Hi group ,
Please let me know which formule is usefull for calculate the day of week
based in a date.
my date is datetime.
day = convert(int,MyDate) % 7
is't working
... more >>
Getting Null Values When Merging Fields
Posted by Josh Gerszewski at 5/7/2004 10:12:47 AM
Hi Everyone,
I've been putting this off for awhile but I finally am switching my
compatibility level from 65 to 80 and I'm having this issue. I'm using the
following query to get all my employees but some of the "employees" are
Inventory, Server Room, etc and these are located in the EmpLast f... more >>
Raising User Defined Errors
Posted by Mike C. at 5/7/2004 10:05:36 AM
First question; Can you raise an error in a user defined function? If so,
will it need to be handled from the calling stored proc or will it terminate
the stored proc and notify the client without any intervention?
Secondly, what is the best practice for raising the same error via multiple
sto... more >>
SP output param and SCOPE_IDENTITY()
Posted by Matt L. at 5/7/2004 9:46:12 AM
Hi,
I'm trying to use the stored procedure below to insert into a table and
return the new identity after the insert.
The problem is the SP runs without error but I get no result returned
when I run it from an ASP page with "EXEC insert_photo 'test', 1,1,11".
The row is being inserted in... more >>
Date NOW
Posted by Brian Candy at 5/7/2004 9:19:10 AM
Hey... does anyone know if MSSQL has the equivelant of the VB NOW function,
to return the current date and time?
... more >>
@@Error <> 0 never goes to errorhandler (still).
Posted by cladre NO[at]SPAM hotmail.com at 5/7/2004 9:05:20 AM
Regarding an older posting that was never really resolved:
http://groups.google.ca/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=endp1IqoAHA.2236%40tkmsftngp05&rnum=1&prev=/groups%3Fq%3Dsql%2Berror%2B%253E%2B0%2B%2522never%2Bgoes%2Bto%2Berrorhandler%2522%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26s... more >>
Business rules in stored procs.
Posted by Mark at 5/7/2004 7:18:30 AM
I have got into an argument with one of my colleague about
having business rules in stored procedures. He is saying
that no business rules should be described by TSQL. The
rules belong in the middle tier.
Can someone provide some serious thoughts about the
subject?
Thanks,
Mark
... more >>
Web services programming in T-SQL
Posted by belindacur NO[at]SPAM yahoo.com at 5/7/2004 6:39:05 AM
I would like to create some web services using T-SQL can any of you
please clarify some resources or web sites to point me in this
direction.
Thanks
Belinda... more >>
Sp Tempory Tables
Posted by Peter Newman at 5/7/2004 6:26:03 AM
SQL200
Im looking at setting up a SP to handle checking of data for a client. I thought the best way would be to create a tempory table containing the data for the client and then depending on the task, retrieve the data required and update as needed
im tring a very simple version first to se i... more >>
current week select
Posted by Mikey at 5/7/2004 6:01:09 AM
Hi I had a query earlier that was answered now I need to
be able to select all orders that were placed in the
current week no matter which day it is run on
I tried the following which did not work
select * from orders where orddate =DATEDIFF(ww, orddate,
getdate())
does anyone know of... more >>
Urgent- Conditional Select statement
Posted by Pogas at 5/7/2004 5:41:05 AM
Please kindly help me with this select statemen
I have a table where the data types for S03_01 and S02_03 are integers
I want to select S02_03 and S03_01 and output them depending on thei
value
see code below
I might be doing something wrong here,as I am getting a conversion error
Any be... more >>
creating tables at runtime
Posted by Brina at 5/7/2004 5:36:42 AM
Hi
i have a problem at hand can anyone help me out?
i have a table which contains rows . i want to create
another table at runtime that has as its columns the row
of the prev table. the number of rows are determined at
runtime as such the columns are determined only at runtime.
fo... more >>
indexes and sysindexes
Posted by Repstat at 5/7/2004 5:26:03 AM
I am looking for a way to write a procedure to drop all indexes from a table, however many it may have, by creating a procedure that takes the table's name as a parameter, I have tried enumerating the sysindexes table but to no avail, as some of the rows in there don't relate to actual indexes. The ... more >>
From ACCESS to SQL Server query problem
Posted by max_nordio at 5/7/2004 2:56:04 AM
Hi
I doing an update of an MS access project to SQL Server 2000. No problem with the data, but I can't update all the queries because of a different sql syntax. I tried to use DTS but Access queries could only be converted in static tables
Does anybody know a tool or a way to make the conversion... more >>
Help:Error 7405 - Problem accessing linked server in trigger
Posted by Gan at 5/7/2004 1:41:12 AM
Dear all,
I am at my wits end.
I have written an insert trigger In SQL server 2K that is supposed to
fire when a record is inserted in a table in a third party
application. The trigger includes a simple select query that looks for
any record in a remote server, like the following:
CREAT... more >>
date problem
Posted by Mikey at 5/7/2004 1:28:52 AM
Hi I have a dates problem I have to select data from 1 -2
weeks old so thelast week will be week 1 and the week
before week 2
I had originally tried this
select * form orders
where orddate < getdate () -7 and orddate > getdate () -21
But this doesn't give me the weeks I need as if I ran ... more >>
Help with SQl servers job
Posted by Clayton at 5/7/2004 12:41:03 AM
Hi
I've to schedule a procedure run via SQL server's Management SQL serverAgent Job. The procedure have some PRINT statements. When I run the package, I want these PRINT statements output plus other outputs like how many rows affected, to be stored in a text file, so that I can go thru them when r... more >>
Job log file
Posted by Shilpa at 5/7/2004 12:31:05 AM
Hi
I've to schedule a procedure run via SQL server's Management SQL serverAgent Job. The procedure have some PRINT statements. When I run the package, I want these PRINT statements output plus other outputs like how many rows affected, to be stored in a text file, so that I can go thru them when r... more >>
|