all groups > sql server programming > september 2003 > threads for friday september 19
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
Assigning Query results to a Variable
Posted by Gordo at 9/19/2003 10:58:49 PM
Hello,
I would like to Execute this Select Statement...
SELECT MAX(VisitorID) FROM Visitors.
Is there any way to store the result directly into a VB variable??
lngVisitorID = ???
Thanks!!!
... more >>
UPdate query
Posted by LIN at 9/19/2003 10:39:12 PM
I make a "UPDATE" query like this:
UPDATE table SET sort = sort - 1 WHERE sort > '10'
The problem is, I need to get a recordset back with the ids of the affected
rows. Can this be done?
Cheers,
LIN
... more >>
"ROWNUM" in SQLServer???
Posted by Clive Yau at 9/19/2003 6:00:25 PM
Dear all,
Is there anything like "ROWNUM", "ROWID", in SqlServer similer to that in
Oracle?
Thanks.
Clive
19 Sep 2003
... more >>
Inserted And Deleted
Posted by Kenneth at 9/19/2003 4:21:48 PM
Im I sharing these two tables or do I have them for myself on my connection.
I wonder if I Insert a record in a table at the same time as another user
do, will I have my own Inserted table?
//Kenneth
... more >>
tough data conversion problem!!!!
Posted by Mike at 9/19/2003 4:16:18 PM
Hi, Guys,
We don't have a solution for the following float data type conversion
issue:
Since we can not directly transfer SYBASE data to SQL server in our
system,
it should be translated into some kind of intermediate data type. In our
case this is C's float.
Then it get insert... more >>
How to get word count in a table
Posted by TomTom at 9/19/2003 4:11:22 PM
Hi,
I'm trying to get a word count from a table in an SQL DB. Is there a
built-in function that's useful for this purpose? If not, could somebody
suggest me how I can do it?
Thanks!
Tom
... more >>
How to create new server login and db user?
Posted by mariah at 9/19/2003 3:59:15 PM
I create a new server login in Enterprise Manager and
added that login to be a user of his default database. I
tried to connect as this user to a server and his default
database within a C# program. HOwever the
SqlConnection.Open always created a "xxx user login
failed" SqlException. did ... more >>
SQL server Stored proc & Memory allocation
Posted by Helen at 9/19/2003 3:57:44 PM
Hi,
I have written a stored procedure that takes data from one table and splits
it across a number of tables, creating each table dynamically each time the
sproc is run.
I have used the following CURSOR to do this.
DECLARE dosspage CURSOR FAST_FORWARD
FOR SELECT distinct page_id FROM d... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Debug
Posted by André Almeida Maldonado at 9/19/2003 3:43:46 PM
How Can I debug a Trigger?
Let me show the problem... I have an application that manipulates a SQL
Server database. When I update the table Accounts the server fires a
trigger... But the trigger don't do what I want... I look for errors in code
but I can't find... It's a simple code and I know... more >>
DTS and Stored Procedures...
Posted by Steve Thompson at 9/19/2003 3:19:24 PM
Hello all,
A. Is it possible to run a DTS package from a stored procedure?
B. Is it possible to run a stored procedure from a DTS package?
TIA,
Steve
... more >>
hOW TO: CREATE SCRIPT FOR INDEXED VIEWS WITH SQLDMO
Posted by Giò at 9/19/2003 3:16:36 PM
Hi ,
I would want to generate one scritp for Indeces of the views (but separately
from the view), using SQLDMO.
The object dmoIndex.script generate scripts without set the necessary
property in the database.
So when I import the script from the code (using
dmoDatabase.executeImmediate) incurs... more >>
Need urgent help on DB locking
Posted by Jason Liew at 9/19/2003 3:11:11 PM
May i know how can i lock a record to prevent other resources to read it
using store procedure ?
--
Best Regards,
Jason Liew Hock Wai
^_^ Don't Worry Be Happy ^_^
... more >>
Calling function makes huge delay?
Posted by Milos at 9/19/2003 2:15:13 PM
The problem is amount of time used to return function value:
We have view :
--
DROP VIEW VOSSR
GO
CREATE VIEW VOSSR AS
SELECT OS.*
FROM OSSR OS
LEFT OUTER JOIN KONT KO ON KO.LETO = dbo.MCL_MAXLETO_KONTO(OS.FIRM,OS.KONT)
GO
--
Calling function dbo.MCL_MAXLETO_KONTO(OS.FIRM,OS.KONT) co... more >>
Index materialized views - improve performance?
Posted by Rohan Hattangdi at 9/19/2003 2:00:06 PM
Does anyone know how much performance is affected if views are materialized
for data that sees a lot of insert/update activity?
We have a client who is complaining of slow speeds and the main query that
is being used from the page where they are facing the problem contains joins
with multiple ... more >>
One Statement Update - Join, no cursor ?
Posted by SuperDrax NO[at]SPAM hotmail.com at 9/19/2003 1:54:35 PM
HI All
I have a process that I am trying to accomplish with one statement. I
cannot think of any way to do it other than using a cursor.
I was wondering if anyone could point me in the right direction.
I want to update the Domain in Table A with the Domain in Table B
where A.Account = B.... more >>
linked server or else?
Posted by Derda at 9/19/2003 1:53:14 PM
Hi,
I've got 2 different server on different city.Each of them have different
databases but have some relations.When the first server database's a table
updated or inserted I have to insert some different data to the second
server database.
Do I have to use linked server or replication?
Ther... more >>
Can SP accpet Select Prarmeters??
Posted by Ricky at 9/19/2003 1:45:06 PM
Can stored procedure accept parameters as the result of
select query ??
Something like
Lets say a stored proc accepts 3 parameters,
Exec Stored-proc (Select distinct datetime,value,status
from Table)
or any other way to accomplish this. How to run SP based
on column results from a ta... more >>
Parse Sql Query Help
Posted by Newsgroup (NNTP) at 9/19/2003 1:44:29 PM
I need to replace every instance of a word in our pagecontent table
with new terminology. I need help a script that can be used to mass
replace every occurrence of a word in PageContent. Doing a update
(UPDATE pagecontent SET contentshort = 'Deliverable' WHERE
contentshort Like '%Project%') wi... more >>
SP - Error
Posted by Tyro at 9/19/2003 1:26:17 PM
Please Help.
When I run the Stored Procedure from Query Analyser I get
the following error
Changed language setting to us_english.
[Microsoft][ODBC SQL Server Driver][Shared Memory]
ConnectionCheckForData (CheckforData()).
[Microsoft][ODBC SQL Server Driver][Shared Memory]General
netwo... more >>
SQL Server error message list
Posted by Justin Dutoit at 9/19/2003 1:25:18 PM
Hey. Is there some master list of errors for SQL server online, that I can
browse? I might like to define some custom Exceptions in VB, and I might use
the error message to decide which exception to raise in my code. But you
would need to know all the error messages and when they occur. Thanks fo... more >>
MSDE setup problem
Posted by kathy at 9/19/2003 1:16:30 PM
I try to install MSDE 2000 by using SQLSP3->MSDE-
>setup.exe. But get the popup show "Setup failed to
config the server. Refer to the server error logs and
setup error logs for more information".
Where is the server error logs and setup error logs? What
is the problems?... more >>
Columns on Rows?
Posted by Anthony Zessin at 9/19/2003 1:11:11 PM
Plastic is on the bar, have a drink on me. I have a table that came from
Excel and I am trying to normalize it. There is one could with an ID and
between 2 and 29 columns of varchar data. These columns are NULL for the
remainder of columns. here are a few rows:
1 abc def NULL N... more >>
wirting code for distinct
Posted by Carlo at 9/19/2003 12:45:54 PM
hi
i wrote this code
SELECT g.*,i.*
FROM instrument AS i INNER JOIN generic_instr AS g ON i.is_generic=g.id
WHERE g.type = @type AND i.id NOT IN (SELECT DISTINCT instr FROM cha_instr)
this returns me 3 rows , all the same, i need wirte a distinct to get just
one
(i suppose i write some... more >>
how to find job status?
Posted by LJ at 9/19/2003 12:42:27 PM
I'm writing a proc which starts a job using
sp_start_job. I don't want my proc to end until the job
is done so I was going to follow the call to sp_start_job
with a while loop which checks on the status for the
job. Does anyone know how I find the job status? Any
suggestions for a bette... more >>
Watch this critical patch for MS Internet Explorer
Posted by Aaron Bertrand - MVP at 9/19/2003 12:17:52 PM
<<<DO NOT DOWNLOAD THE MESSAGES IN THIS THREAD>>>
Just making it a child instead of a parent.
... more >>
Howcome this SELECT does not work?
Posted by SparvHok at 9/19/2003 12:06:18 PM
Hi there,
Another SQL ques:
SELECT
knr
FROM
(SELECT knr, count(knr) FROM kk WHERE kid in (13,17) AND kstatusid =
4 GROUP BY knr HAVING count(knr) > 1)
It doesnt work, anybody knows why? Is possible to do what I am trying to
do? Im trying to extract ONLY the knr column (in order... more >>
Query Crosstabish Question
Posted by Devron Blatchford at 9/19/2003 12:02:12 PM
Hi there,
I would like to write a crosstab like query is SQL. This is what I am trying
to do.
I have a table :
PK FK Type Qty
---------------------------------
1 1 Length 2.4
2 1 Pieces 10
3 1 ... more >>
Insert / Exec Q
Posted by Ricky at 9/19/2003 12:00:03 PM
I am writing an insert trigger on a table (say tableA)
which will contain hourly values. On insert, which could
be a single value insert or something like insert @tableA
select * from TableB (don't worry about syntax here, just
an e.g.) I want to execute the trigger. Structure of
tableA is
... more >>
Database Design WishList
Posted by Daniel Acuff at 9/19/2003 11:48:42 AM
Can I get some idea of how to make this work based on the comments I have
added to the code below. Thank you. This is a Wish List app using a random
value placed into a client cookie and 2 back-end sql database tables.
Dim strUNID
strUNID = Request.Cookies("CookieDough")("UNID")
If "" & s... more >>
Performance Problems
Posted by chris at 9/19/2003 11:24:01 AM
We have a VB6 application w/ SQL2000 SP3 Active/Active
Cluster Win2003 OS. 1700 users.
Last Tuesday a group of users began complaining about
performance. Switching from screen to screen was painfully
slow ( I witnessed personally).
We ran a db trace just against these hosts and notic... more >>
Row Counter in Stored Procedure Output
Posted by M Smith at 9/19/2003 11:05:07 AM
I'm running SQL Server 2000. I have a stroed procedure that looks simialr
to this. "Select ID, LastName from Employees" The output looks like
this....
ID LastName
1002 Smith
1008 Johnson
1010 Williams
etc.....
My question is, Is there a way to modify the Stored Procedure... more >>
Insert from recordset
Posted by Jim de Graff at 9/19/2003 11:00:45 AM
I have a WMI query which selects records from event logs on various
unattended computers. I want to insert them into a SQL table. Each machine
has its own table, and the fields in the table are in the same order as the
fields in the recordset returned by the WMI query. Do I have to insert the
re... more >>
Default Values
Posted by James Napolitano at 9/19/2003 10:59:05 AM
I am having trouble assigning a default value to a column
using transact sql statements. in my stored procedure i
have:
create table employees
(employeeid int primary key,
lastname char(20) not null,
firstname char(20) not null,
companycode char(3) not null d... more >>
ActiveX and SQLDMO
Posted by Jeremy at 9/19/2003 10:55:18 AM
I was wondering if anyone had an ActiveX script that
iterated through all the databases on a particular server
and scripted all of the objects. I want to put an ActiveX
script in a DTS package to do this. I have not been able
to write the effective code. Thanks.
... more >>
Tablename from within my trigger
Posted by Ricky at 9/19/2003 10:45:23 AM
Is there any system variable or something that would tell
me the table name in which I am creating an insert trigger
within my trigger. I need the table name to pass it to
another table to get some parameters stored associated
with this table like ReportName for which this table is
etc.
... more >>
Comma insted of decimal point
Posted by awi at 9/19/2003 10:31:13 AM
Hi everybody.
decimal points are commas in some countries (Ex: Finland)
How would we handle
create table t(a int, b decimal(6,2))
insert into t values(1,2,3) [that should means (1, 2.3)]
that works
insert into t values(1,replace('3,2',',','.'))
but it is not a solution.
Any other thing... more >>
ORDERING, V and W
Posted by SparvHok at 9/19/2003 10:29:54 AM
Hi there,
I have a very simple sql string, that I try to order by lastname. But
the resultset does not diffrentiate between V and W. It seems that SQL
Server handles them as the same char!?
How do I change that, so that the database orders them as two separate
characters?
rgds
... more >>
WMI inside a sql server
Posted by Jeff at 9/19/2003 10:09:28 AM
Does anyone know where I could get some information on
working WMI inside a sql server stored procedure?... more >>
Variable vs Temp Tables - which to use?
Posted by Harag at 9/19/2003 9:56:02 AM
Hi
I've been told to use Variable tables in my stored procs because they
are faster than temp tables and are stored in the memory rather than
in the tempDB.
Q) Whats the Pros & cons for using them?
Q) Is there a limit to how much it can hold in memory?
Thanks.
Al... more >>
n Of Each Group using GROUP BY
Posted by Travis at 9/19/2003 9:28:34 AM
I have found a couple examples using Google on this, but none of them seem
to work for what I need, or my newbness is just taking over. They all use
TOP n salary or sales, I just need to select n number of rows from a table
using GROUP BY, Here is my test stuff:
CREATE TABLE [Table1] (
[pro... more >>
Create index and log file
Posted by fabriZio at 9/19/2003 9:26:49 AM
Creating 8-10 indexes on a 200.000 rows table with 80 columns (40
varchar(50) and some int) can grow my log file?
Thx for replies :)
--
==
fabriZio
... more >>
Trigger and MS DTC
Posted by corinne at 9/19/2003 8:40:09 AM
Hi everyone,
I have got a trigger on a table on server 1
Server 2 is my Mail server, which is defnied as a linked server in server 1.
Both servers are SQL 2000 SP3a
MS DTC is on on both servers
Objectif:
The trigger on server 1 is sending an email via server 2
DECLARE @R varchar(800)
... more >>
run vb exe via xp_cmdshell in server
Posted by Andy Smith at 9/19/2003 6:48:14 AM
hi everyone
I tried to run a VB6 exe program in server using sql 2000
agent job. It ran the program
but never stop it. so, the program still running in the
server. when tried to did the end process, error
fires "Access denied" file in use.
Any solution to this please?
How i could run an ex... more >>
DB Algorithm, howto?
Posted by Manat K. at 9/19/2003 5:25:27 AM
Hi,
I have an online contest to do. With this contest,
there are 700 potential prize winners. Every entrant has
his own contestandtID, and how the contestantID works is
that a int is stored in a table, and when a user enters
his info, it takes this int and assigns that number as
his c... more >>
Problem
Posted by skc at 9/19/2003 4:20:25 AM
I am running SQL Server Evaluation on a P4, 235MB machine
with a 80GB HDD.
I have noticed today that the machine is running extremely
slowly!
Furthermore, I put another machine in the workgroup on a
hub and tried to access the SQL engine from the 2nd
machine...I kept getting the follow... more >>
SP Debugging problem
Posted by Amit at 9/19/2003 3:22:50 AM
Hi all,
We have SQL Server installed on a separated. I work from
the SQL client installed on my machine. Using my query
analyzer, I have created a stored procedure and wished to
debug it. The moment i selected the debug option i got
thuis error displayed in the results pane:
ODBC: Msg... more >>
Query/View/Stored Proc structure - please help!?
Posted by HiltonLange NO[at]SPAM Hotmail.com at 9/19/2003 2:39:16 AM
Hi.
I'm really stuck with this problem, I just can't seem to get my head
around how I should approach this in SQL.
A program I've written has evolved into quite a large system, and I'm
trying to clean up some areas of it which are giving me problems.
It's a manpower system, and I'm specifi... more >>
Blocking Processes
Posted by Kit at 9/19/2003 2:30:18 AM
Hi, I've got some problem with blocking processes:
Symptoms:
A blocking process (spid 58) locked one of many resources
that a blocked process (spid 59) was waiting for. But spid
58 did not wait for any resources and was sleeping
indefinitely locking the resouce. The blocking could only
b... more >>
testing, plz ignore
Posted by kit at 9/19/2003 12:52:44 AM
Process ID Context ID User Database
Status Open Transactions Command Application
Wait Time Wait Type Wait Resource CPU
Physical IO Memory Usage Login Time
Last Batch Host Network Library Network
Address Blocked By Blocking
58 0 hpsa BDCS
sleeping 1 AWAITING
COMMA... more >>
|