all groups > sql server programming > july 2004 > threads for tuesday july 27
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 Server Client in Workstation
Posted by Prabhat at 7/27/2004 11:08:18 PM
Hi All,
How can we fine if the SQL Server Client is Installed in the System or Not.
(Using VB and/or Delphi)
As My EXE Require SQL Server Client to Work so I have to Check that If the
Client is Installed or not?
Please Suggest How Can I find If SQL Server 2000 Client IS Installed or NOT
... more >>
Help!!!
Posted by Bazuka at 7/27/2004 10:55:02 PM
I called for befor, but i only got one erelevant answer. pls try to solve and help
Hey all, i want to build a product (a watch) code dynamicly, ill explain:
a watch has a few characteristics:
1. WatchType (wrist watch,wall clock, alarm clock etc.)
2. manufacturer (casio, seiko, timex)
3. Br... more >>
select column names
Posted by Malik at 7/27/2004 10:33:03 PM
I have a table with single record, all the fields type are bits. I want to select column names for which the bit value is 1.
what to do?
thanx... more >>
Rows to Columns
Posted by malik at 7/27/2004 9:57:03 PM
Dear hi
I have a single row and i have to select columns as rows. what to do?
thanx... more >>
question about a query
Posted by angus at 7/27/2004 9:39:48 PM
Original
--------
select * from test_table
-------------------------
| id | name |
-------------------------
| 1 | a1 |
| 2 | a1 |
| 3 | b2 |
| 4 | b2 |
| 5 | b2 |
| 6 | c3 |
| 7 |... more >>
SQL Server Data Log not in order? Help please
Posted by LingZ at 7/27/2004 5:39:17 PM
I wrote a test, using for loop, insert 100 record to a SQL server table. I used SQL statement and ADO API to execute that SQL statement. Even though these 100 records were inserted in order, the actual database table data was not in order. They were pretty random.
The table has the following fiel... more >>
question about inserted table
Posted by Kenny at 7/27/2004 5:33:30 PM
in the trigger,
is it true that inserted table always contain one row?
... more >>
include column names with query result...
Posted by Ron at 7/27/2004 5:03:06 PM
Is there a way to include the column names from a table with the results of a query in SQL Server?
I am using bcp to export the results of a query to a text file. I need the column names for the comma delimited format. Any help is appreciated.
Thanks,
Ron ... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Full Text Indexing
Posted by Thomas Scheiderich at 7/27/2004 5:02:56 PM
I cannot seem to get this to work.
I have the following table:
CREATE TABLE [dbo].[QADocs] (
[fullFileName] [varchar] (100) NULL ,
[fileNameLong] [varchar] (100) NULL ,
[fileNameShort] [varchar] (100) NULL ,
[fileExtension] [varchar] (10) NULL ,
[version] [varchar] (20) NULL ,
[doc... more >>
Using TOP to page through query results
Posted by Will Harmon at 7/27/2004 4:56:07 PM
Need to page through a recordset on a Web browser. Am required to use
PHP. Having a problem using TOP to pull pages from
other than the ends of a recordset. Anybody able to provide an
example of paging thrugh a recordset using TOP?
Here is what we have been trying.
SQLStr="SELECT TOP 10 ... more >>
Dynamic "USE" statement
Posted by Scott Meddows at 7/27/2004 4:52:23 PM
Is this possible in SQL Server?
DECLARE @myDBName varchar(20)
set @myDBName = 'Operations'
use @myDBName
I receive this error
Server: Msg 170, Level 15, State 1, Line 3
Line 3: Incorrect syntax near '@myDBName'.
I would like to perform mantience on ALL my databases and this seems like t... more >>
Multiple Cascade Paths
Posted by Luke Amery at 7/27/2004 4:39:58 PM
Hi all,
I have an issue with foreign key constraints and multiple cascade paths as
the title of my post would suggest.
Here is a simple example:
CREATE TABLE a
(
keyofa int not null primary key
)
CREATE TABLE b
(
keyofb int not null primary key,
fkinatob int not null f... more >>
Book Reccomendations
Posted by George at 7/27/2004 3:54:27 PM
Hi,
Look for a good SQL 2000 Programming Book, any reccomendations?
Thanks
... more >>
Need stored proc parameter default value
Posted by Steve at 7/27/2004 3:48:02 PM
Hi,
I'm trying to find a way to programmatically determine if a stored procedure parameter has a default value, and if so, what it is (the former task being more important than the latter). The system SPs "sp_help" and "sp_sproc_columns" tell me quite a bit about the parameters, but not if they ... more >>
Insert Help
Posted by Lontae Jones at 7/27/2004 2:50:04 PM
I have a table called Mixer and with (Mixno int, Mixname varchar(50), Mixop int)
I have a sp that updates this table daily. I would like to export the old values in Mixno, Mixname, and Mixop into a new table called Mixold. Before any updates are applied.
Is it something like this
Insert into... more >>
Date Ranges
Posted by Debbie at 7/27/2004 2:10:14 PM
I have been playing around with pulling data by date ranges. I noticed
that if I try to pull data like the following queries, it pulls every
request between those monthes and days but completely disregards the
year. By removing all of the converts I can solve the problem but I
would like to kn... more >>
Finding Position in the Record
Posted by Mark Vergara at 7/27/2004 2:01:36 PM
Hi!
Is there any way of finding of what position in a
particular record ?
For example I have 3 records
1 Record 1..
2 Record 2..
3 Record 3..
I would like to know the position of record number 2
Please help me on this..Any comments and answer on this
is highly appreciated, Thanks...... more >>
how does Enterprise Manager edits tables?
Posted by Costi Stan at 7/27/2004 1:47:49 PM
There is a special way in which EnterpriseManager edits the tables and
afterwards lets you save your changes or undo everything.
Can you replicate this behavior with BeginAlter, DoAlter and CancelAlter?
Or clone the table and in the end update or cancel chenges?!
... more >>
Timeout accesssing very large table sequentially.
Posted by DB at 7/27/2004 1:35:11 PM
I have a table I want to access sequentially. (Very
large meaning 210,000,000 rows.) I have 2 indexes on
this table to access it sequentially based on 2 different
fields. I then have views created which order by these
indexed fields.
My problem occurs when I try to access the table usi... more >>
LIKE in CASE
Posted by IT Dep at 7/27/2004 1:32:05 PM
Hi
I am trying to write a section of a query to add '020' to the begining of
dbo.ASCIICharOnly(TELEPHONE_2) if it starts with '7' or '8'. For referance
the dbo.ASCIICharOnly(TELEPHONE_2) removes any charachers that are not
numbers from TELEPHONE_2, I haven't posted the function at the end of ... more >>
sysdepends reporting wrong output
Posted by SPhan at 7/27/2004 1:17:01 PM
Hi All,
Is there an issue with using the sysdepends? It reports lesser stored
procedures than it should. All we have done is restored a backup and have
opted to force over existing DB.
Thanks for your help!!
... more >>
Bug or limitation in the functionality of sp_OAMethod
Posted by James Hall at 7/27/2004 1:13:42 PM
It appears that passing a "space" (ASCII 32) character(s)
using a CHAR data type through a parameter in the
execution of sp_OAMethod actually results in an empty
string being passed to the COM object instead.
This appears to be occurring because the string that is
passed as a parameter ha... more >>
making a code out of few tables fields--->Help
Posted by Bazuka at 7/27/2004 12:29:07 PM
Hey all, i want to build a product (a watch) code dynamicly, ill explain:
a watch has a few characteristics:
1. WatchType (wrist watch,wall clock, alarm clock etc.)
2. manufacturer (casio, seiko, timex)
3. Brand (casio- babyG, Gshock. Seiko-kinetik, etc.)
4. Model (BabyG -bg18278v, kiinetik... more >>
How to compare database structures?
Posted by Evgeny Gopengauz at 7/27/2004 12:02:21 PM
Let us suppose that I have two similar databases and need to create an
sql-script upgrating one database structure to another (migration).
For example, these databases are from different versions of some software,
first is from early version, next is from current, and second one contains
severa... more >>
database design problem
Posted by Agnes at 7/27/2004 11:41:27 AM
I got two po tables, (master and detail)
in myMasterPO , there are one unquie key (hidden ), ponumber(user can read
and modify it)
in myDetailPO , (there are also one hidden unquie key).and ponumber
my question is , User may need to amend ponumbe in myMasterPO, and I need to
update that pon... more >>
Owner of the database after restore
Posted by Abraham at 7/27/2004 11:40:11 AM
I restored a database SynComp_TEST from a backup using a login testbinu,
which have dbcreator fixed server role. ( SynComp_TEST not exists earlier)
I got below message ..
Processed 1672 pages for database 'SynComp_TEST', file 'Metadata_001' on
file1.
Processed 104 pages for database 'SynCom... more >>
Where Clause Con't
Posted by Mike at 7/27/2004 11:25:17 AM
Okay, I have scripts for an address table and inserts for
data. I need a select statement where the AddrType code
can be either 'PRIM' or 'COMM', where if they have both,
I'd like to select the 'COMM' address over the 'PRIM'
address.
Thanks for all your help on this everyone.
CREATE TAB... more >>
CHECKDB error
Posted by Kenny at 7/27/2004 10:59:38 AM
Hi, when I run CHECKDB for a database, I got the following error.
I would think if I do DBCC CHECKDB ('databasename', REPAIR_ALLOW_DATA_LOSS )
it probably will fix the problem, But I don't know how much data I lose
after I run this above command.
Is there a way to find out?
Server: Msg... more >>
Service Agent Not Starting
Posted by Devapriya De Silva at 7/27/2004 10:47:42 AM
Guys,
I am running W2K3 server with SQL server 2000.
When I try to start SQL Server Agent I get the following error.
"An error 1068 - (The dependency service or group failed to start.) occurred
while performing this service operation on the SQLServerAgent service."
When I checked dependenci... more >>
Service Agent Not starting
Posted by Devapriya De Silva at 7/27/2004 10:47:08 AM
Guys,
I am running W2K3 server with SQL server 2000.
When I try to start SQL Server Agent I get the following error.
"An error 1068 - (The dependency service or group failed to start.) occurred
while performing this service operation on the SQLServerAgent service."
When I checked dependenci... more >>
Synchronized Applications
Posted by Mike Monagle at 7/27/2004 9:59:33 AM
My group has been given the task of developing applications that remain in
constant synchronization with other instances of themselves running at
remote locations (very remote locations on a WAN, e.g., some in Florida,
some in Washington state). For example, Process A and Process B know what
Pr... more >>
Urgent-simple query
Posted by ab at 7/27/2004 9:16:48 AM
Hello Experts,
Can I have another column 'occ2' within the same query as given below which gives counts grouped by the same columns but selected on another date, eg. between 2004-05-19 and 2004-05-20?I need it in the same resultset.
Thanks!
Present query:
SELECT servicegroup_name,server_na... more >>
Swapping a table's records?
Posted by Jim Bancroft at 7/27/2004 9:10:32 AM
Hi everyone,
I have a two tables-- a master table with active and discontinued
product IDs, and a smaller table, with only the active product IDs. The
productID field is a primary key, so there are no duplicates in either
table.
Recently, someone messed up/inverted some code and... more >>
Automatic Search
Posted by Viktor Popov at 7/27/2004 8:59:26 AM
Hi,
..I have 3 tables:
Users
-------
userid(PK) username pass addr
Offer
----------
offerid(PK) userid(FK to Users) estateid(FK to Estates) price
rooms
Estate
-----------
estateid(PK) city phone addr date ...
Search
---------------
searchid(PK) ... more >>
Returning System-Sproc contents within a UDF
Posted by Scott McNair at 7/27/2004 8:52:56 AM
As it says in the topic. I'd like to be able to pass a variable to
XP_CMDSHELL and then query against the results, e.g.
SELECT * FROM fnCmdShell('DIR "C:\Program Files\Administrator\Desktop"')
WHERE output like '.exe'
Regards,
Scott... more >>
Matching Day of Week with a Stored Date
Posted by Sh0t2bts at 7/27/2004 8:46:41 AM
I have the following tables stored on my SQL 7 database:-
Table1
Name Ext_No FTE Mon Tue Wed Thur Fri
Sat Sun
Fred 4200 1 30600 30600 30600 30600 0
30600 0
Mark 4201 0.5 15300 15300 15300 ... more >>
Date Format
Posted by Rammohan at 7/27/2004 8:36:28 AM
Hai
I want the date in the following format.
day dd mon hh:mm:ss yyyy.(ex: Tue 27 Jul 00:12:34 2004)
Can u help me.
Regards
-- Rammohan... more >>
Insert Into using Linked Server
Posted by DJohnson at 7/27/2004 8:17:43 AM
Hi All...
I find myself in need of some help working out a query involving copying
data from a table in a linked server to a table on a local server.
According to BOL it is best to use the OpenQuery command to execute remote
queries but I am having trouble with the proper syntax.
Any h... more >>
Using a variable as a table name in a UDF
Posted by Scott McNair at 7/27/2004 8:00:39 AM
I'm trying to create a UDF that would return the recordcount of a table
that you passed to it. So for example fnGetCount('AUTHORS') would
return the count of the AUTHORS table. This is the closest I've gotten:
CREATE FUNCTION fnGetCount (
@tblname varchar(50)
)
RETURNS numeric
AS
... more >>
Problem with Full Outer Join
Posted by puneet.bansal NO[at]SPAM wipro.com at 7/27/2004 7:44:25 AM
I am using a full outer join on two queries running on views. But the
full outer join is not giving me all non-matching rows from the second
table. I can't figure out why. Does anybody have an idea under what
condition such thing may happen. I do not have any where clause in my
query -
... more >>
Where Clause
Posted by Mike at 7/27/2004 7:43:05 AM
Is there any way to filter the following statement on
the "Count" colunm?
I try Where "Count" = 1
and I get an error, Invalid column name.
select T1."CUSTOMER" "c1" , case when T2."ADDRTYPE_CODE"
= 'COMM' then 1 else 2 end "Count"
from "dbo"."ADDRESS" T2, "dbo"."MEMBERSHIP" T3,
("... more >>
multiple times execution of procedure
Posted by mahesh at 7/27/2004 7:09:54 AM
hi,
When i execute a procedure p1(with some parameters....)
i.e exec p1 .....
it inserts 50 records on a table and takes 1 second (50
rps)
but if i repeat this procedure 80 times to insert 4000
records (in a batch)
exec exec p1 .....
exec p1 .....
exec p1 .....
exec p1 .....
exec p1 .... more >>
CPU usage Script
Posted by Mike at 7/27/2004 7:06:07 AM
I would like to create a job within SQL Server to
calculate the percentage (%) of CPU usage by each SPID
from master.sysprocesses table every minute. I would like
to write this data to a table (CPU_Usage) every minute.
Several of the SPID's have several connections so I would
like to s... more >>
Combining 2 Select with Join statements into one result
Posted by cmo63126 NO[at]SPAM yahoo.com at 7/27/2004 6:43:18 AM
Originally posted @ microsoft.public.sqlserver. Moving post to a more
relevant group...sorry.... more >>
Foreign Key Indexes
Posted by Eddie Pazz at 7/27/2004 5:09:58 AM
Does SQL 2000 generate foreign keys automatically? The BOL states that it is
so for Primary and Unique key constraints. However, I use PowerDesigner 9
and they claim that SQL does for FK's as well. Is this true?
... more >>
SELECT TOP 1 with MSDE
Posted by John Kiernan at 7/27/2004 5:09:34 AM
To ye SQL gurus -
I have a SQL statement that works just fine in SQL Server 2000:
SELECT TOP 1 key_
FROM event
ORDER BY key_ DESC
But it bombs in MSDE. Any idea why?
Thanks in advance!
-- John Kiernan
... more >>
Formatted output from stored procedures in MSSQL2K
Posted by liranlotker NO[at]SPAM hotmail.com at 7/27/2004 1:33:47 AM
Hi all!
I need to create a CSV file from the results of a stored procedure. I
tried using OSQL to get a text output but it comes unformatted and
unreadable. I understand that there is a way to dump the results into
a temporary table but in my case it is not really feasible as the
results are ... more >>
SQL Server 2005 and query analyzer
Posted by Brian Henry at 7/27/2004 1:25:33 AM
does anyone know what replaced query analyzer in sql server 2005? It seems
to be missing... I use to use that a ton to do test queries, and now it's no
longer anywhere I can find it.. thanks
... more >>
|