all groups > sql server programming > april 2004 > threads for thursday april 8
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
call url from stored procedure!
Posted by preeth at 4/8/2004 9:58:43 PM
Hi,
can anybody please tell wheather it is possible to invoke
an URL from a Job/Trigger/stored procedure.
thanks in advance,
preeth... more >>
newbie needs help creating SP
Posted by Danny Ni at 4/8/2004 9:18:23 PM
Hi,
I tried to create a SP:
CREATE PROCEDURE spAddGroup
@Description char(50)
AS
set nocount on
select * from groups where description = @Description
if @@rowcount > 0
select -1
else
begin
insert Groups values(@Description)
select @@identity
end
GO
It's woking. But it return... more >>
Replacement of SUBQUERY needed
Posted by Mustufa Baig at 4/8/2004 8:54:24 PM
I'm having a performance problem because of the following situation:
I have a table named 'dbo.Overall_Employee_Chg' and is described as below:
ID, Emp_ID, What_Changed, Change_Date, Active, Comitted
This table keeps Employee change history. Every time a change happenes to an
Employee, one... more >>
Question about linking tables in Query Designer
Posted by Learner at 4/8/2004 8:01:43 PM
Suppose I have tblOrders and tblOrdDetails and both contain a common key
called OrdID.
Question: In query designer or for that matter in the diagram editor,
does it make a difference if I drag the OrdID field from tblOrders to
tblOrdDetails
OR
Drag the OrdID field from tblOrdDetails t... more >>
deleting a column via SQL/SP/T-SQL
Posted by Learner at 4/8/2004 8:01:39 PM
Hi,
By the subject of the post you would have figured out that I am not
clear about the difference between a simple SQL statement and T-SQL :(
Can someone explain what the difference is (if any)?
Now the question:
How can I via SQL delete a field or fields from a table e.g. I have a... more >>
Can I rename a database?
Posted by Learner at 4/8/2004 8:01:33 PM
Is it possible to rename a database?... more >>
get the column with the maximum employeeid
Posted by Matt at 4/8/2004 7:20:42 PM
Here's the working SQL statement to get the column with the maximum
employeeid. I wonder if we can optimize this statement, or this is the most
simplified one?
SELECT *
FROM Employee
WHERE (EmployeeID =
(SELECT MAX(EmployeeID)
... more >>
Data/index locking in SQL server
Posted by ad31415 NO[at]SPAM yahoo.com at 4/8/2004 5:11:16 PM
I found that SQL Server (I'm working with 2000), when doing SELECTs
like:
SELECT * FROM Table WHERE key='xxx'
first puts a lock (shared) on the index (I'm assuming here there is an
index on the "key" column), then on the table.
On the other hand, UPDATEs are treated differently if they to... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
how to do an append query from one table to another table
Posted by Tony C. at 4/8/2004 4:21:07 PM
Hi,
I have some rows in a temp table that I want to append to the end of
another table with the same structure.
CREATE TABLE ticketitems(
tick_item_no int primary key
tick_item_desc char(16)
tick_item_price money
tick_item_qty int
tick_item_size nvarchar(50)
fk_ticket_no int
tick_M... more >>
64-bit integer
Posted by mitra fatolahi at 4/8/2004 3:48:48 PM
Hi All,
I don't know what 64-bit integer is but if there is such
a thing can someone tell me in which data type could we
store a 64-bit integer?
Thanks,
--Mitra... more >>
% in a where clause
Posted by Sean H at 4/8/2004 3:23:32 PM
What does % do in the where clause below.
select *
from t1 a, t1 b, t1 c
where a.id % 3 = 1
and b.id % 3 = 2
and c.id % 3 = 0
and a.id+1 = b.id
and a.id+2 = c.id
Thank you
... more >>
Get Primary Key column
Posted by Steve at 4/8/2004 3:11:34 PM
Hi all
Is there a way in SQL to reference the Primary Key column without using the
name of the column?
Something like: Select * From Table1 Where myPrimaryKey = '1'
Kind Regards,
Steve.
... more >>
EM doesn't Refresh the database properly
Posted by Willianto at 4/8/2004 2:56:54 PM
Hi all,
I have a little yet annoying problem about Enterprise Manager. Whenever
I drop a table with QA, the table still appear on EM. When I tried to
open it, EM give an error message that I should refresh the database.
But, although I had Refresh the database, the deleted table was still
the... more >>
Changing default database collation
Posted by Lasse Edsvik at 4/8/2004 2:48:24 PM
Hello
I was wondering if you guys know how to change the default database
collation in sql 2000?
/Lasse
... more >>
Please help!
Posted by Marcia Gorby at 4/8/2004 2:47:42 PM
I'm using a CASE statement to do a division. The division
is 8 divided by 30 or 8/30. But all I get is 0 instead
of .2666666. Can somebody help?
I've tried casting it as Money, Decimal, and Float. I'm
still getting 0 instead of the .266666.
Here is part of the select statement.
... more >>
How to write this query in SQLSERVER without using CORELATED query
Posted by Nags at 4/8/2004 2:46:31 PM
This query is valid in Oracle
select *
from lkp_static_data
where (list_name, code) in
(select list_name, code
from lkp_static_data
where list_name = 'PROGRAM')
How do I write this in SQL Server. I do not want to use correlated query as
it is very expensive for us.
-Nags
... more >>
complicated daily average query
Posted by Jordan Bowness at 4/8/2004 2:45:48 PM
Here's a problem I'm revisiting after some time.
Dealing with inventory. I have a starting number, and over the course
of say 15 days, that starting number is added to and removed from. I'm
looking for the daily average.
This is a sample for the period Jan 1-Jan 15
Starting Inventory on... more >>
LIKE question
Posted by Ian Oldbury at 4/8/2004 2:24:06 PM
Hi all,
Is there a performance difference in using
SELECT field1, field2, field3 FROM <TABLE> WHERE field4 = 'name'
as opposed to
SELECT field1, field2, field3 FROM <TABLE> WHERE field4 LIKE 'name'
The reason i'm asking is because i need to provide user searching with
wildcards, howe... more >>
How to loop without using cursor
Posted by me at 4/8/2004 1:53:16 PM
Hi,
I'm trying to update the keys of a certain table.
CREATE TABLE ticketitems(
tick_item_no int primary key
tick_item_desc char(16)
tick_item_price money
tick_item_qty int
tick_item_size nvarchar(50)
fk_ticket_no int
tick_MainItem nvarchar(50)
tick_void_flag int
)
The current ... more >>
Querying a table of time constraints, with 2 records for each day
Posted by scoop at 4/8/2004 1:38:24 PM
I have a table that holds blocks of times. Each "day" has
two records, a record with one block of time marked off
for the beginning of the day and a record with a block of
time blocked off for the end of the day.
Example
Rec_id Day_of_week start_time end_time
1 Monday ... more >>
SELECT DISTINCT Query returning duplicate results
Posted by Brad M. at 4/8/2004 1:19:52 PM
I've posted this question earlier to microsoft.public.sqlserver.replication,
but I haven't got a response as of yet and I'm beginning to think that this
may have been a question better asked in the programming group since I
believe it deals with syntax.
SELECT DISTINCT MH.agent_id,
... more >>
Need help in a SQL....
Posted by Mustufa Baig at 4/8/2004 12:27:35 PM
I'm having a performance problem because of the following situation:
I have a table named 'dbo.Overall_Employee_Chg' and is described as below:
ID, Emp_ID, What_Changed, Change_Date, Active, Comitted
This table keeps Employee change history. Every time a change happenes to an
Employee, one... more >>
xp_startmail: won't run as non sa user
Posted by dougj at 4/8/2004 12:11:02 PM
I'm running an application that has a trigger including xp_startmail. It runs under an sa account but doesn't when run with a normal user it seems. Anybody have basic suggestions
Thank
... more >>
Is this possible?
Posted by Simon at 4/8/2004 11:21:28 AM
The following are known: a minimum value (e.g., 10), a maximum value (e.g.
50), and an increment (e.g. 10).
How can we use SQL to get a view with one column listing all the incremental
values? In this case,
Column_Name
10
20
30
40
50
Don't want to involve any table.It seems I may use... more >>
SQL Server install path
Posted by Vadym Stetsyak at 4/8/2004 10:45:57 AM
How to determine subj?
--
Vadym Stetsyak
... more >>
V<>W collation?
Posted by Lasse Edsvik at 4/8/2004 10:44:21 AM
Hello
I have a slight problem, i usually use:
Finnish Swedish CI AI KS WS
and when i run SELECT * FROM Foo WHERE Something LIKE 'W%%'
i get those that starts with V too....... which collation should i change
too?
TIA
/Lasse
... more >>
How do I add a new column?
Posted by Trint Smith at 4/8/2004 10:44:11 AM
I need to keep the table in tact, but I need to add a new column. Any
help is appreciated.
Thanks,
Trint
..Net programmer
trintsmith@hotmail.com
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!... more >>
Tables size
Posted by Michael at 4/8/2004 10:38:19 AM
Is there an existing SP to show all tables & their sizes?
Thanks.
... more >>
How to transactionally update schema?
Posted by Matthew Belk at 4/8/2004 9:36:47 AM
I am trying to build a database schema updater (in C#) that can be used to
upgrade the various databases associated with my company's productized and
custom applications.
I've come up with what I think is an effective way of storing, specifying,
and executing the required T-SQL scripts to chan... more >>
Books On Line
Posted by Peter Nunez at 4/8/2004 9:31:05 AM
How do I get to the books on line library
... more >>
Multiple CREATE PROC statements in one script?
Posted by Derek at 4/8/2004 8:43:12 AM
I just wanted to know if the below statement should work.
When I try and save it in Enterprise Manager it complains
about the second CREATE PROCEDURE
GetActiveClientCodes 'Invalid Object Name -
GetActiveClientCodes'.
CREATE PROCEDURE GetClientCodes (@Active varchar (10)) AS
IF @Active = ... more >>
Server Collation
Posted by Konstantinos at 4/8/2004 7:31:16 AM
Hello Experts,
If I want to change the collation of my Server I'm bound
to rebuild my master? If so do you know the .exe that I
have to run to rebuild?
Thanks in advance.... more >>
Syntax for OPENQUERY - Urgent
Posted by hngo01 NO[at]SPAM hotmail.com at 4/8/2004 7:25:02 AM
Hi all, I need help on syntax on openquery
Below is not working. I need to pass in OpenQuery an
Integer? How do I do that? Thanks a lot
declare @myvar int
set @myvar = 134
SELECT *
FROM OPENQUERY("TESTLINK", 'SELECT * FROM CHA_ORDX_MJ
where ORDX_MJ >=''''' + @myvar + '''')'
... more >>
Removing Self References??
Posted by TIND at 4/8/2004 4:51:02 AM
Hello World
Find below the table sample which i use to define Groups in a Management System
GroupId Group Name Parent Grou
1 Group1
2 Sub Group 1 of Group 1
3 Sub Group 2 of Group 1 2
So the Structure will be in a t... more >>
Sql to MSDE
Posted by George r at 4/8/2004 4:41:07 AM
Hello , i need some help
I have create an c# Database Application using .net visual studio and sql server
Now i need to transfer it to another computer using msde
What i should do
Thank you... more >>
send parameters to procedure
Posted by MR.T at 4/8/2004 3:58:04 AM
Hello.
I have procedure that gets 3 parameters(Ignore the first).
2 of them are in date format (dd/mm/yyyy hh:mi:ss)
When I send the parameter I get error because the space
between the year and the time (yyyy hh.) and because of
the mark ':' between the hh:mi:ss
How can I send it ?
The way ... more >>
Temporary Tables
Posted by Stephen Cairns at 4/8/2004 3:26:10 AM
Does anyone know how to re-write this query so I can create a temporary table to insert information as oppose to inserting info into the Sclassnoprice table and deleting its contents each time. It is taking up to much space on the server by doing this and i've been told to create temporary tables b... more >>
SQL Newbie Questions
Posted by Steve McQ at 4/8/2004 3:26:09 AM
I am having trouble with the SQL Server theory are these assumptions correct:
1. SQL Server needs add-ons to actually create its own databases (VB.NET, Access 2000/XP
2. MSDE is just the engine and is unusable without client tools or other add-ons (I know it has restrictions)!!
3. Why would I n... more >>
SP Question: Can I pass an input parameter for table name?
Posted by Russell Mangel at 4/8/2004 3:19:47 AM
I am trying to create a stored procedure in Query Analyzer.
I am trying to pass an input parameter, for a table name.
I need to get the rowcount for each of 97 tables in an SQL 7.0 database.
My attempts have failed, can you make my SP work correctly?
CREATE PROCEDURE MiniCimDB_InsertRow
@... more >>
How do i handle large (12GB) table?
Posted by mathiasfritsch NO[at]SPAM gmx.de at 4/8/2004 3:15:31 AM
We have a generally small DB with a Table that stores 60.000 entries
in a column of type IMAGE. The Table is 12GB. The PK of the big Table
is referenced by other Tables.
Does anyone have experience in handling big DB? Do you separate the DB
into 2 .mdf? Any Best Practies available?
thank you,... more >>
Temp Table in stored procedure
Posted by Konstantinos Michas at 4/8/2004 2:43:58 AM
Hello Experts,
In a stored procedure, I create a temporary table do some
inserts then select from the table and finally on the
bottom of my sp I drop the table.
In my Server and my DB, the stored procedure does not
have any problem, but if I have this sp in another Server
(and DB) and ... more >>
update with join
Posted by Matthew Speed at 4/8/2004 2:41:23 AM
Sorry for the easy question but I can't seem to figure this out:
how do I update a column in tableA to a value in tableB by doing a
join? I thought the syntax was
update A join B on A.column = B.column set A.target = B.source where
....
but it doesn't like that.
TIA... more >>
List of active SQL statements
Posted by Martin Kraus at 4/8/2004 2:24:49 AM
Hi.
How can I see the list of running SQL statements in SQL
Server?
When I run
select *
from master.dbo.sysprocesses
where STMT_END=-1
there is binary(20) column sql_handle. What to do with
it? I have found in sysobjects and syscolumns table-
valued function fn_get_sql, however it d... more >>
|