all groups > sql server programming > november 2003 > threads for friday november 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
Download file by HTTP in DTS
Posted by \ at 11/7/2003 10:29:13 PM
Hi,
How to:
Download a file by a HTTP-link (like
"http://www.website.com/download.file.txt") - and put it somewhere on a
disk - within a DTS package? I could do it if it was an FTP-site, but in
this case it's not :(
Thanx!
Jakob
... more >>
Query - interesting.
Posted by Prashanth at 11/7/2003 9:42:13 PM
create table tblTest
(
nId int Primary key identity(1,1) not null,
sName varchar(50),
nMarks numeric(5, 2)
)
Declare @name varchar(50)
Declare @marks numeric(5, 2)
Declare @count int
set @count = 0
while(@count < 100)
Begin
set @count = @count + 1
insert tblTest val... more >>
To all you SQLServer guru 's out there
Posted by GVE at 11/7/2003 9:30:56 PM
Hi,
Could you help me with this function. I am new to SQLServer programming
This fynction is supposed to do the following.
if Sect >= 10000 return the string 'Name'.
The function does not work. What am I doing wrong
Regards
Guno
CREATE FUNCTION dbo.Units(@Sect char)
RETURNS varchar... more >>
SQLDMO and hetrogeneous views
Posted by Mark Neilson at 11/7/2003 9:00:43 PM
Whenever using SQLDMO to create a query using OPENROWSET in to an access
database, I am always returned that ANSI_NULLS and ANSI_WARNINGS must be
turned on. I have trdied everything I can think of to ensure taht these
database settings are on yet I still get the same error message (7405).
Any... more >>
Why do I get : 'Latin1_General_CI_AS' Collation ?
Posted by tristant at 11/7/2003 7:43:05 PM
Hi SQL Gurus,
I have two development server, one is SQL Server 2000 Std Edition on Win2k
and the other is SQL Server 2000 Personal Edition on Win 98.
I test on SQL Srv on Win2k, works fine.
But when I Create the database on Win 98 and Import the database tables from
Win2k and run the applicat... more >>
Join question
Posted by ALF at 11/7/2003 6:26:07 PM
Hi All,
Im currently having difficulty with a simple enough setup.
Basically I have 2 tables, staff and sales. Staff has 2 fields, ID and Name, Sales has ID, StaffID and amount.
I want to retrieve a list of all staff and the number of sales they had. This is fine, but some staff have never made a sa... more >>
Can you pass the Table Name as a parameter in a SProc?
Posted by Elmo at 11/7/2003 6:12:11 PM
My business's SQL Server is already setup and running, so I can't design it
the way I'd like - -
multiple products have different tables - - many of them have the same field
names....
What I'd like to do is create 1 procedure for these tables, passing in the
TableName itself as a parameter
I... more >>
Another SQL question
Posted by joselito.dominguez NO[at]SPAM cardionet.com at 11/7/2003 5:03:47 PM
What is the best way to approach this?
I have a table that looks like this.
Name Report Date
Joe Public 10/01/03
Joe Public 10/02/03
Joe Public 10/03/03
Joe Public 10/04/03
John Smith 10/01/03
John Smith 10/02/03
John Smith 1... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
need hard drive space!!
Posted by joe at 11/7/2003 4:23:40 PM
Hi, how do I cleanup transaction log and data backup for a database? I need
hard drive space!!!! please help!!
... more >>
Nested Variable Query
Posted by TJ at 11/7/2003 4:23:04 PM
Hey Guys - Let me know what you think ...
The following works fine ...
DECLARE @CMList varchar(200)
SELECT @CMList='Legal, Medical'
SELECT @CMList 'Industries'
but is there a way to make work in a single select statement like ...
SELECT (SELECT @CMList='Legal, Medical')
This works... more >>
Return msdb..sp_help_job records into a table
Posted by Des Norton at 11/7/2003 3:50:57 PM
Hi NG
Using QueryAnalyser, the following command returns me a result set in the
results pane:
exec msdb..sp_help_job @job_name='MyJobName', @job_aspect='steps'
Is there a method whereby I can get this result set into a staging table, so
that I can extract and manipulate the info that I ... more >>
Create hetrogeneous view from VB Code
Posted by Mark Neilson at 11/7/2003 3:38:27 PM
I am trying to create a view that contains OPENROWSET using VBA. The
datasource is a jet 4.0 database
Trying ADOX using the Views.Append method, I get the error message that the
"object or provider is not capable of providing the requested operation"
I have tried using MSDSQL as well as na... more >>
One SQL Statement?
Posted by Louis Yactayo at 11/7/2003 3:21:15 PM
I have a database similiar to this:
Table: Calls
Columns: SalesRep, CallDate, CallNumber, OrgNum
Table: Orgs
Columns OrgNum, OrgName
I would like to write one SQL statement that would return the top 5 calls for each sales person for a given period of time.
e.g.
Mike Call1 ....
Mike Call2 ...
Mi... more >>
Return Value from sp to calling sp
Posted by Keith at 11/7/2003 3:04:15 PM
I need to call a stored procedure from a stored procedure
and have the value returned from the called procedure to
the calling procedure.
Any ideas?
Thanks,
Keith
... more >>
Copying/Cloning an instance of a Cursor
Posted by adam_stretch NO[at]SPAM skyservice.com at 11/7/2003 2:06:53 PM
Hello,
I was wondering if it is possible to create a copy of a cursor instead
of making a second call to the database (which is very slow). I need
to create a cursor and then create a second instance of the same
cursor to compare it against itself.
ie:
DECLARE cursor1 CURSOR FOR
SELECT * ... more >>
SQL statement - need help
Posted by Chris P. at 11/7/2003 1:56:18 PM
Hi,
I am trying to write an SQL statement to retrieve a list
of all tables from all local databases and get the results
in a format like: DBNAME, TABLENAME.
For the beginning, I wrote the following script which does
not generate any SQL syntax errors, but no result is
coming up.
Can... more >>
SQL question
Posted by Lito Dominguez at 11/7/2003 1:50:25 PM
I need some idea on how to generate this output using
transact-sql.
The data will be like this:
Name Report Date
John Doe 11/01/03
John Doe 11/02/03
John Doe 11/03/03
John Public 11/01/03
John Public 11/02/03
John Public 11/04... more >>
Should I have to enforce referential integrity if I use Instead of Insert Trigge
Posted by Venkat Venkataramanan at 11/7/2003 1:48:01 PM
Hello:
I have two tables:
CREATE TABLE ELEM (
Elem_ID_N int IDENTITY,
Elem_Data_Ty_ID_N tinyint NOT NULL,
Elem_Name_C varchar(20) NOT NULL,
Elem_Ty_C varchar(10) NOT NULL
DEFAULT 'Atomic',
Desc_C varchar(... more >>
indentity colunm, number skip
Posted by cindy at 11/7/2003 1:40:31 PM
Hi,
I have a quesion. When I create a indentity colunm named
as [ID] in one new table, I think the number should be
consecutive, like "1, 2, 3, ....". However some users
reported that the number jumped, like "1, 2, 3, 5, 6 ...",
4 is skipped.
I asked one of my friends good at SQL, and he ... more >>
what doe this message means??
Posted by Vitamin at 11/7/2003 12:47:26 PM
I am want to create a stored procedure called "sp_admin_member_searching" in
query analysis
and i run it in the query analysis, too
however, it return this message to me....
Cannot add rows to sysdepends for the current stored procedure because it
depends on the missing object 'dbo.sp_admin_m... more >>
Trigger/Email
Posted by Paul at 11/7/2003 11:28:14 AM
I have a "home grown" help desk system. Data is currently successfully
added to SQL 2000 DB from client web pages. I've been struggling with
trying to get the following query to work right. I want the trigger to fire
after the "status" column is changed on the table. Currently, after
updatin... more >>
parallelism question
Posted by joe at 11/7/2003 11:27:52 AM
Hi,
do you think it's a good idea to set max degree of parallelism to 1 ?
I think most of my queries improve by using this option. But do you think
that it could impact the DB maintainance plans and schedule tasks/jobs to
run slower? I think the chance is very high , right?
we have huge d... more >>
Why is this Instead of Update trigger not working?
Posted by Venkat at 11/7/2003 11:26:12 AM
Hello:
I have a table:
CREATE TABLE ELEM (
Elem_ID_N int IDENTITY,
Elem_Data_Ty_ID_N tinyint NOT NULL,
Elem_Name_C varchar(20) NOT NULL,
Elem_Ty_C varchar(10) NOT NULL
DEFAULT 'Atomic',
Desc_C varchar(100... more >>
How can I find whether CURSOR exists or not
Posted by Rayan Yellina at 11/7/2003 11:19:16 AM
Is there any way that I can check whether the CURSOR is
declared or opened.
this is for checking the table....
IF( (OBJECT_ID('dbo.authors') IS NOT NULL) AND
(OBJECTPROPERTY(OBJECT_ID('dbo.authors'),'IsTable')=1) )
Is there anything to check for CURSOR?
Thank You,
Rayan... more >>
IDENTITY_SCOPE(): Fact or fuiction?
Posted by at 11/7/2003 11:06:49 AM
I am encountering a problem where an insert trigger is resetting the
@@identity value, becuase the trigger itself performs an insert into another
table. Performing a search in newsgroups, I've seen rumors of a new function
in SQL Server 2000 called IDENTITY_SCOPE(). However, this is not documente... more >>
Stored Procedure with asp
Posted by Vitamin at 11/7/2003 10:53:56 AM
I have written a stored procedure which will paging the recordset, and
return a range of record that i need, and i write a asp code to call it
however, no any return after the set objRs = objCmd.Execute
when i try to Response.write (objRs.recordcount)
it said the recordset is close....
how ca... more >>
Foreign Key constraint prob.
Posted by highbytes at 11/7/2003 10:27:07 AM
Hello All,
When I drop a table and recreate it programmically in a
script, I attempt to restore a foreign key relationship to
this table from another table I get this error.
ALTER TABLE statement conflicted with COLUMN FOREIGN KEY
constraint
'FK_Column. The conflict occurred in
datab... more >>
MAXDOP option
Posted by joe at 11/7/2003 10:07:53 AM
I have a question,
sometimes if I use OPTION(MAXDOP 1) , then it's actually faster than
parallelism(default)
I don't understand why that happens. I thought if query use more than one
cpu (parallelism), it should be faster.
... more >>
Order By with Case: Date Problem
Posted by Mij at 11/7/2003 10:07:31 AM
Hello,
I have the following order by statement:
ORDER BY CASE @order
WHEN 'P' THEN P.Prop_Name
ELSE R.InspReq_Date
END
The date seems to be causing an error, I keep getting:
Syntax error converting datetime from character string. I am not sure
why. Any ideas?
Thanks much.
... more >>
ALTER TABLE statement conflicted with COLUMN FOREIGN KEY constraint
Posted by Charlie Arocho at 11/7/2003 9:39:12 AM
When I drop a table and recreate it programmically in a
script, I attempt to restore a foreign key relationship to
another table I get this error. I can add the foreign key
using the GUI after the table recreation but am not
allowed to do it in a script. Has anyone had this problem
and f... more >>
Intermittently Failing Trigger
Posted by Trigger at 11/7/2003 9:28:10 AM
if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[Reverse Invoice]') and OBJECTPROPERTY
(id, N'IsTrigger') = 1)
drop trigger [dbo].[Reverse Invoice]
GO
if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[AuditorComp]') and OBJECTPROPERTY(id,
N'IsTrig... more >>
Parsing Text Column into table
Posted by JAB at 11/7/2003 9:10:57 AM
I need help on this. This is a problem I just inherited from someone else.
There is one table which has a text field/column. This column in the table A
have multiple records stored as one field. example:
rec1: This is a test
rec2: This is a test2
rec3: This is a test3
In this table, al... more >>
RUNNING JOBS, POWER FAILURE
Posted by Tania at 11/7/2003 8:29:02 AM
1)
A job is scheduled to run at midnight.
What happens to a job if the SQL SERVER instance is down
at midnight ?
Will it try and run the job when it starts up ?
2)
What happens when a job is running and a power failure
occurs ?
Will sql server try and run the job when it starts up
agai... more >>
Data or information
Posted by Kyle Ambrose at 11/7/2003 8:24:51 AM
I have a very basic Q. What is the
difference between INFORMATION and DATA?
In simple terms please....
thank you.
-kyle... more >>
How to move index from one file group to another
Posted by Chris Li at 11/7/2003 7:58:17 AM
Hi,
I have a huge database (2 terybytes) and inside it, I have table sized
800 g and the its cluster index is 6 g. When this table was created, the
index was placed in the same file group as the table. Now I want to move
the index to its own file group. Is there a way to do it without droping... more >>
Hide Column Names in Results
Posted by MReynolds at 11/7/2003 7:41:10 AM
Hi..
How do you write a SQL query such that all that is displayed in the results are the results themselves - NOT the column names? I'm running a stored procedure from an ISQL prompt and I think that the secret lies in the query itself so that all I get back is the data itself without the column ... more >>
DATEPART function
Posted by Oleg G. at 11/7/2003 7:19:07 AM
I was using the DATEPART function and found out that you
cannot rely on it when working with ms ( milliseconds ).
It doesn't return the leading zeroes because it integer.
Also, it produces different results for different numbers
by rounding or reducing them. So, to recap this, you
cannot gar... more >>
Varchar vs. text variable in Stored procedure
Posted by kongsballa at 11/7/2003 7:18:41 AM
Hi!
I have a SP that is shceduled to run now and then. The main purpose of
the SP is to read some log tables and dynamically create an email with
html format and in the end send it to recipients.
I build the html on-the-fly, but the datatype varchar(8000) is not big
enough to hold the bodyt... more >>
A SQL statement?
Posted by Shell at 11/7/2003 7:18:38 AM
I have a table with students scores on several different
subjects:
Name Subject Score
---- ------- -----
dave math 75
dave physics 80
dave ... 70
mary math 90
mary physics 85
mary ... 70
I need to create a new table in the form:
Name ... more >>
Constraint Violation
Posted by Jim Heavey at 11/7/2003 6:32:44 AM
I wrote a VB program to call a stored procedure. I wrote the stored
procedure with the intent that it would handle all errors, so I would
never hit the "catch" portion of the try/catch block.
I found that when I attempted to insert a row which was a duplicate,
that instead of falling into the... more >>
command button and macro
Posted by bill at 11/7/2003 6:01:07 AM
I have an adp project
I want to be able to put a command button on one of the forms.
I want the user to be able to hit the command button and it will ask them for
the state. I then Want the form to only select the states I specify in the parameter
I used this in access mdbs no prob with a macro and ... more >>
timestamp of record insert
Posted by Jeremy at 11/7/2003 5:21:34 AM
Does anyone know how to identify the date and time of when
a records was inserted into a table?
Thanks... more >>
@@cursor_rows
Posted by Satishvj at 11/7/2003 4:32:58 AM
I have declared a cursor. The query used in this cursor returns 2
records if it is run separately. But when I open the cursor and check
for @@cursor_rows i get the output as -1.
How to get the no. of records returned by cursor???
Please help me out regarding this.
--
Posted v... more >>
linked databases : good idea ?
Posted by Craig HB at 11/7/2003 3:29:13 AM
I am going to be converting an Access application to SQL Server. The
Access front-end is linked to a number of Access back-ends. The design
works really well and something that we would like to keep in SQL
Server.
I know that I can link to another database on the same server using
linked view... more >>
28.5 as integer should be 29
Posted by Ben Taylor at 11/7/2003 12:51:18 AM
Does anyone else have an explanation for this weird
phenomenon?
When you try to update a SQL Server integer column to
28.5, it goes to 28. If you try to update it to 28.500001,
it goes to 29. This occurs whether you do it via a
straight query or over ADO.
Why?
... more >>
Check Constraint with Collate
Posted by Tester at 11/7/2003 12:16:06 AM
I need to ensure data being entered in one column of a table is checked to
ensure the first character is upper case alpha character and if not the data
either should not be entered (constraint) or rolled backed (trigger). SQL
2000 in set to case insensitive and the collation for both the server a... more >>
|