all groups > sql server (alternate) > february 2006
Filter by week: 1 2 3 4
Converting Traceid issue
Posted by michael via SQLMonster.com at 2/28/2006 8:41:59 PM
Hi,
I am trying to automate a SQL Trace via a stored procedure and a job. The job
executes the stored procedure to start the trace and every 15 minutes, the
job is supposed to stop the trace, clear it from memory, rename the trace
file, and start a new trace so I can select the average duratio... more >>
Optimizing a JOIN
Posted by rkershberg NO[at]SPAM gmail.com at 2/28/2006 6:15:41 PM
I have two tables.
One has approx 90,000 rows with a field .. let's call in BigInt (and it
is defined as a bigint data type).
I have a reference table, with approx 10,000,000 rows. In this
reference table, I have starting_bigint and ending_bigint fields. I
want to pull out all of the refe... more >>
Reasonable to assemble FullName W/ A UDF
Posted by wackyphill NO[at]SPAM yahoo.com at 2/28/2006 2:57:13 PM
I break somone's name in a table in fields as First, Last, Middle,
Suffix.
Is it reasonable to use a UDF to create the full name as a string if I
need it, by passing it the First, Last, Middle, & Suffix fields?
Is this really slow to do? It's just sometimes I want to do a GroupBy
Query and ... more >>
restore sql 7db to sql2000
Posted by sarahlin NO[at]SPAM yahoo.com at 2/28/2006 1:47:07 PM
Hi there, we tried to restore a sql 7 DB to sql2000, somehow some of
the varchar filed become nvarchar, why is this?
thanks,
-sarah
... more >>
Group By Query Help
Posted by wackyphill NO[at]SPAM yahoo.com at 2/28/2006 1:28:36 PM
Can you group by a value returned by a UDF? Example:
SELECT Col1, SUM(Col2), MyFunc(Col3, Col4) AS 'MyResult'
GROUP BY Col1, MyResult
I've had no luck. Can this be done?
... more >>
How to avoid cursors
Posted by sjoshi at 2/28/2006 10:36:18 AM
I have a long sql batch that does this:
1. Gets a list of all tables in user database that start with name CORE
declare @tablename varchar(30),
@command varchar(2000),
@cnt integer
declare GetCOREOids cursor for
select sysobjects.name
from sysobjects
where ( OBJECTPROPERTY(s... more >>
Create New Table advice
Posted by aplatfl at 2/28/2006 7:04:16 AM
I am creating a table that will store my companys annual punctuality
scale. What is the best way to name the columns? Here is some sample
rows with data.
--------------------------------------
DPT_CODE_1 | 300 | 121 | 120 | 61 | 60
DPT_CODE_2 | 360 | 241 | 240 | 121 | 120
Thanks for any ad... more >>
page life expectancy=0
Posted by Marek Wierzbicki at 2/28/2006 12:00:00 AM
In my MSSQL server 2000 sp4, in performanece monito, buffer memory, page
life expectancy is equal to 0.00000 (average for 10 sec, auto update). I
think sth is wrong configured, but what?
Marek
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
sqlservr.exe memory usage
Posted by Raziq Shekha at 2/27/2006 7:47:55 PM
Hello All,
On all of my SQL servers (2000 with SP3), when I go to task manager and
look at memory usage, sqlservr.exe is always at 1.7gigs. If I reduce
the maximum to let's say 1 gig it will go down to 1 gig. But if it is
even at 2gigs or 3 gigs it will be showing 1.7 gigs. Why? Is is ok... more >>
Simple SQL Distinct...!?
Posted by NO[at]SPAM sh at 2/27/2006 2:29:22 PM
This may be a really simple question, but I always have problems with
Distinct queries.
In this instance, I have a table of Delivery addresses, some will be exactly
the same EXCEPT for the DeliveryID field, but eitherway I need the
DeliveryID so that I can pass it onto the next form.
So,... more >>
Error using UPDATE statement
Posted by solidsna2 NO[at]SPAM gmail.com at 2/27/2006 12:22:26 PM
Hi,
I am relatively new to SQL. I am using SQL 2000. I am trying to
Update a field base in a criteria in a scond table.
UPDATE Tbl1
SET Tbl1.Row2 = '1'
WHERE Tbl1.Row1 =
(SELECT Tbl1.Row1
FROM Tbl2, Tbl... more >>
Script SQL 2005 database to individual files?
Posted by Ted O'Connor at 2/27/2006 9:46:15 AM
I am trying to script the DROP(IF EXISTS) and CREATE for all of my
tables, views, stored procs, and functions to individual SQL text files
(one per object). This was trivially done in SQL 2000 with Enterprise
Manager, but when I try in SQL 2005 through Management Studio my only
"script mode" op... more >>
Send 2 SQL statements using Integrated services
Posted by Traveller at 2/27/2006 9:13:40 AM
Hi All ,
I am hoping some can help or point me in the right direction. We have
recenlty installed SQL 2005 and are using integrated services using ole
db connections. We are connecting to an Informix database.
My questions is there a way I can pass through multiple sql statements
when I cre... more >>
Automating record selection parameters
Posted by Edgar at 2/27/2006 8:43:59 AM
Hi,
I need some advise on how to automate record selection on a stored
proc. Here is my situation. I have a stored proc that I used on
Crystal reports with two parameters - Acctcode and Subacct. When a
user enters ' *' on these parameter, it means to report on all
accounts otherwise, repor... more >>
tools for analysis relations
Posted by stemond79 NO[at]SPAM gmail.com at 2/27/2006 1:29:31 AM
Are there tools for SQL2k database that take a database return all
relations of tables.
thanks.
Stefano.
... more >>
International Settings for SQL 2000
Posted by quinto at 2/25/2006 2:27:13 PM
I will doing an installation of MS SQL 2000 that will be used by multi
language web sites.
The languages are Japanese, German and of course English.
Currently I'm planning to install MS SQL 2000 standard version but
after reading some articles I'm considering the Enterprise version.
Can som... more >>
advice
Posted by gjb at 2/25/2006 1:54:42 PM
Hi,
Apologies if this sounds dumb but I'm very new to this.
I'm just trying to create a simple login page (
http://aarkenuk.co.uk/barnesg/login.php) In my MySQL databases I have the
correct database selected, but it's the users I'm struggling with. You get
like a front end with my hosting s... more >>
unknown column 'state' in field list
Posted by Nospam at 2/25/2006 4:44:45 AM
I installed a script that is suppose to accept paypal, however on trying to
test a payment, I get this error msg:
Error
Database access error
and I get this error msg emailed to me:
Unknown column 'State' in 'field list'
Query: 'INSERT INTO `TransactionsMembership` (ID, Sum, State ) ... more >>
DELETE FROM - Somethings not right
Posted by nnelson at 2/24/2006 9:09:10 PM
I have a base customer table of 2 million records. We're doing some
testing and I added 33000 rows incorrectly. No biggie, we'll just
delete them, right? Nope....9 hours later, process is still running
using this query.
delete from customer where custid in (select custid from #tmp1)
k...... more >>
Question about Joining 2 tables??
Posted by Wing at 2/24/2006 4:51:55 PM
Hi everyone,
I have problem to join 2 tables together to show the selected results
into a datagrid.
table1 hosts all customer personal information.
table2 hosts all the trasaction records for each customer
table1 has fields such as "customerID", "CustomerName" and "TelNumber".
(customerI... more >>
Fields in my tables are disappearing!
Posted by Kevin Audleman at 2/24/2006 11:42:39 AM
I am using a hosted MSSQL 2000 database that powers the backend of my
website. Website visitors interact with it via ASP pages I have
developed. I also have an internal FileMaker 7 database that
periodically synchs with it via Filemaker's ODBC functionality.
Several times now, I have come in o... more >>
Subquery -> slowness
Posted by jim_geissman NO[at]SPAM countrywide.com at 2/24/2006 11:29:22 AM
I have some queries that involve subqueries to select the appropriate
record from a bunch of candidates. For example the following, which
selects the most recent transaction for a given customer:
CREATE TABLE #Customer (CustID int, OtherInfo int)
INSERT #Customer SELECT 1,7
INSERT #Customer ... more >>
log/log10 functions truncate my resultset
Posted by BernsteinVsTheDb at 2/24/2006 10:30:36 AM
Hello all,
I have a table that contains 100+ rows. I'm trying to run a query that
looks like this:
SELECT ..., log10(...) as Rank FROM Table
and the resultset contains only the first row of results.
SELECT ..., log10(...) as Rank FROM Table ORDER BY Rank
returns no results at all!
If yo... more >>
median query without using function
Posted by uspensky NO[at]SPAM gmail.com at 2/24/2006 9:09:19 AM
I have a table (cars) with 3 fields:
VIN, Class, sell_price
101, sports, 10000
102, sports, 11000
103, luxury, 9000
104, sports, 11000
105, sports, 11000
106, luxury, 5000
107, sports, 11000
108, sports, 11000
109, luxury, 9000
i need to write a query that WITHOUT USING A FUNCTION wil... more >>
Linked Server SQL to SQL
Posted by tim.pascoe NO[at]SPAM cciw.ca at 2/23/2006 12:29:35 PM
I am currently trying to set up a linked server between two SQL-Server
2000 servers. I have a number of linked servers to other machines,
which use local accounts and work fine. However, in this particular
case, I am forced to use my domain account to log into the remote
machine. My account has ... more >>
linked data bases
Posted by paul Borowski at 2/23/2006 12:21:56 PM
We recently copied(replicated) a data base for development. everything went
well until yesterday we had rows start to disappeared in the source data
base. I then found out that the rows disappearing from the source data base
were being deleted from the database copy and this was being replica... more >>
long SQL lines for osql
Posted by pb648174 at 2/23/2006 7:29:00 AM
We have a very long and complicated SQL script which we run to upgrade
a version of our software from old to new. It works great in Query
Analyzer, but when run through osql it takes errors on lines that are
very long and (I think) stops reading after a certain amount of
characters. I've searche... more >>
How to create SELECT?
Posted by staeri NO[at]SPAM gmail.com at 2/23/2006 2:42:35 AM
I have the two following tables:
tblProject:
ProjectID
5001
5002
6001
6002
7001
7002
tblProject_type:
ProjectTypeID ProjectIDFrom ProjectIDTo
A 5000 5999
A 7000 7999
I need to create a SELECT statement which shows all... more >>
copy a table
Posted by Marcin Zmyslowski at 2/23/2006 12:00:00 AM
Hello all!
How to copy a table in MS SQL Server 2000 without chaning a structure? I
mean, I have one table, which has autoincrement numeric field (ID). When
I copy this table by exporting this table into the same database folder
I loose the specification of the field ID. Now it is not autoincr... more >>
Script needed to edit open objects in Sybase
Posted by News East at 2/22/2006 6:10:34 PM
Currently I must manually complete the following commands to set a new value
for the "open objects" and "open indexes". I need a way script this process
in a batch file.
COMMANDS RAN: This is nothing to script, these commands obtain the current
values for open objects and open indexes.
... more >>
SQL command needed to edit table data
Posted by News East at 2/22/2006 6:09:31 PM
I have an existing SQL 7 server named HHARBR. HHARBR has a database named
SPR with a table named "reportname" in it, the table has the name HHARBR
embedded the table data.
I migrated the HHARBR database SPR to a second server called HHARBR2. When I
look into the table in HHARBR2 I still see... more >>
Joing Multiple Columns
Posted by Crumb at 2/22/2006 4:46:31 PM
Hi All,
Bit of a newbie question i'm afraid, so sorry if this is a really
stupid question,
I am not sure if I am trying to do this in the right place as I am sure
SQL Server has a far better way of doing this
What I am trying to do is join the contents of several columns and
present the ... more >>
Virtual Servers cannot connect to host PC Database
Posted by sunstarwu NO[at]SPAM yahoo.com at 2/22/2006 4:33:48 PM
Hi,
On my laptop I am running Virtual Server 2005 with 2 x Windows 2003
Servers. Both the VS can access the internet and shared files on the
host laptop. On the host laptop I have a SQL Server 2000 running.
I have written a Windows Service to detect Application Errors and fire
duplicates of... more >>
Tricky SQL question
Posted by Erich93063 at 2/22/2006 2:25:58 PM
Ok so I'm gonna attempt to explain my problem as easy as I can. I have
a database of contacts (they are actually vendors). I am writing a
procedure that will query the vendors and generate a tab delimited file
that will be used an accounting program (MYOB). In the vendors database
I am exporting... more >>
select statement returns null in stored proc
Posted by Beowulf at 2/22/2006 2:24:13 PM
If I run this statement in Query Analyzer, it properly returns 1
for my testing table. But if I put the statement into a stored
procedure, the stored procedure returns NULL. What am I doing
wrong? I suspect it may be related to how I defined the parameters
for the stored procedure. Perhaps my... more >>
Setting a value for a boolean
Posted by KR at 2/22/2006 11:12:58 AM
Hi,
I am trying to get a 0 or 1 depending on the sucess or failure of a
t-sql statement, and here is what I have:
Declare @boolDatabaseExists bit
Declare @chvnNewDatabaseName nvarchar(260)
SET @chvnNewDatabaseName = 'NewDatabase'
SET @boolDatabaseExists =
(
SELECT (1)
FROM maste... more >>
UPDATE Statement Involving Tables in Different Databases
Posted by Altemir at 2/22/2006 6:53:43 AM
I want to create an UPDATE statement that updates a value in a table in
database A based on the results of an inner join between tables each
residing in deifferent databases.
What is the correct syntax for doing this?
The following should give you an idea of what I'm trying to do:
UPDAT... more >>
Backup users
Posted by Kittikun at 2/22/2006 6:07:48 AM
I am currently using the BACKUP DATABASE method to backup my database.
Everything works fine, except for users. I created various users with
sp_addlogin to access this database and they are located in the xlogins
table. The problem is for example, if I backup, remove some users and
do a restore,... more >>
Merge Replication
Posted by Chris Rennert at 2/22/2006 2:55:53 AM
Hello all,
We were just getting started on a small project using SQL Server Express
on our PC's and we already had SQL Server 2k Enterprise on our main
Server. Problem is , we cannot do merge replications between the two.
From what i have read this is not possible, but it blows my mind,
... more >>
how to call a stored procedure in an insert command
Posted by satish at 2/21/2006 11:39:10 PM
hi,
i had a small doubt , i have a table xxx with two columns (a int,b int
) and i have inserted 5 rows my query is to add the two colums using a
stored procedure and the result has to be displayed in an separate
column --this has to be done only stored procedures ---i know how to
solve the pro... more >>
How to Determine the unique IDs of duplicated records
Posted by anonieko NO[at]SPAM hotmail.com at 2/21/2006 12:53:20 PM
> This is a common problem with some solution
>
>
/***********************************************************************************
*
* Problem:
* Determine the Duplicated Records in a table using single SELECT.
*
* We shall be using Northwind database, add some duplicate recor... more >>
Order By
Posted by pkruti NO[at]SPAM hotmail.com at 2/21/2006 8:52:34 AM
How would i add order by to the syntax below:
"Select * Into ETCLog_holding from etclog where box# BETWEEN " & Box1 &
" and " & Box2
i have tried adding it after Box2 but it doesnt work.
Any ideas?
... more >>
Lock database to update
Posted by Kittikun at 2/21/2006 7:18:33 AM
Hi,
I need to lock a database (prevent users from connecting) in order to
update it. I already know how to kick everyone out with their spid but
i can't figure how to prevent them from reconnecting.
Thanks !
... more >>
Script to reverse engineering schema
Posted by Thyagu at 2/21/2006 2:10:46 AM
Hi,
I'd like to reverse engineer the schema definitions in the SQL Server
on a daily basis and store them in a version control system.
Could anyone please let know if there are any tools to reverse engineer
the entire schema definitions in the SQL server. I'd like something
like the perl sc... more >>
DTS Rounding problem
Posted by GeorgeĀ® at 2/21/2006 12:00:00 AM
I have a problem...
Data transformation rounds or truncate decimals!
I have an ODBC source in witch is a table with float numbers (ODBC Driver
publish it as float).
If I build a query form access or from excel with Query Analizer, I see all
decimal places, but when I try to insert data using ... more >>
Trigger problem no rowlevel support, please help!
Posted by SUKRU at 2/20/2006 9:38:41 AM
Hello everybody.
Unfortunately I am pretty new to sql-server 2000
I need some help with a Trigger I created. I created a trigger witch
takes the id of the affected row and does a update on a other table
with that ID.
The trigger works fine with one affected row. But when there are more
then ... more >>
Loop / Cursor help
Posted by woodfoot at 2/20/2006 7:26:30 AM
Having a brain cramp here and don't know where to start. I have 2 tables:
vehicles and vehicle_useage. What I would like to do is this:
For each distinct vehicle in the vehicle table, I want to make entries
for each day of the month taken from a given date. This routine will be
scheduled... more >>
Connecting to SQL server
Posted by Ryan at 2/20/2006 6:41:17 AM
We have two applications (1 on two servers and 1 on another). Every so
often, we 'lose' the connection to the SQL database which in effect
takes these applications down. One app is a service (written in Delphi)
, the other is a web page (ASP).
>From what I can tell, both different methods use ... more >>
DB shrinks without request
Posted by egpo NO[at]SPAM egpo.net at 2/20/2006 5:57:08 AM
Hi,
I have a DB where I would like to maintain a fixed size and control it
by myslef.
I do not have the options: "Auto-Grow" and "Auto-Shrink" enabled.
>From time to time, without a notice, or any logging, the database files
gets shrinker and this causes a database full error.
As I wrote, ... more >>
Getting closest matching values
Posted by Hennie at 2/20/2006 1:50:19 AM
I apologise if this is a stupid question, but I would appreciated any
help on this subject.
I want to create a view (VIEW_1 in example below) where I take numeric
values from a field in one table (DEPTH_FROM in TABLE_1) and find the
closest matching values from another field in another table (... more >>
|