all groups > sql server programming > december 2006 > threads for tuesday december 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 31
180gb of tempdb
Posted by checcouno at 12/19/2006 11:57:00 PM
Yesterday i had a problem on my DB Server (SQL 2000). The tempdb grown is
size to 180gb and obviously my disc become full.
What can make the tempdb grown so much? In myDB i use only 3 temporary table
(#myTempTable) that i drop after use every time.
I use a lot of table variables and stored pro... more >>
Reporting
Posted by Yan at 12/19/2006 11:40:16 PM
Using sql server 2005.
We are in the stage of redesign to an existing web application. In this
process we intend to break the current application into many small
applications so when we talk about database we will have 20 databases
instead of 1, where every database may be phisicaly located... more >>
Simple sql query pls help
Posted by Katie at 12/19/2006 9:45:53 PM
Hi,
Im stuck on this simple sql query. I know there is an easy way but its
late and i cant seem to figure it out
for eg i have a table
ID Value
1 A
1 B
1 C
1 B
2 A
2 B
2 C
3 A
3 C
I want to find out all IDs which dont have value B (in this ... more >>
Returning customized message from the dynamic sql script question
Posted by Pedja at 12/19/2006 8:55:00 PM
Hi,
I'm trying to develop monitoring process for sql server 2000 (many servers).
It is stored procedure which runs each 60 seconds, it goes through all
databases (cursor), and it tries to write some value into dummy table within
each database. It suppose to return "success" if everything is... more >>
Invalid Column Error
Posted by zwieback89 at 12/19/2006 6:49:47 PM
Hi,
Can anybody point me why I get the error "Invalid Column Name - emp" error.
Thanks.
Table structures are:
Tree
create table tree
(emp Char(10) Not Null,
Boss Char(10));
Stack
CREATE TABLE Stack
(Stack_top INTEGER Not Null,
emp Char(10) Not Null,
Lft Integer NOT NULL UNI... more >>
Single column row vals to comma delim string?
Posted by Alex at 12/19/2006 4:54:39 PM
Hi all -
I need to do this in sql2000, so I can't use the sql2005 pivot operator.
Anyone know a way to take a result like this:
Select c1 from t1
c1
____
A
B
C
D
....
Z
....and turn in into this without using a cursor?
Select ???
NewCol
______
A, B, C, D..., Z
... more >>
Getting information from sysfiles - sysfilegroups
Posted by gv at 12/19/2006 4:45:38 PM
Hi all,
Fooled with this long enough. I'm mising something. I keep getting an error?
Server: Msg 137, Level 15, State 2, Line 31
Must declare the variable '@DBN'.
DECLARE @DBName SYSNAME
DECLARE @SQLCmd NVARCHAR(2000)
SET @dbname = ' '
SET @dbname = (SELECT MIN(name) FROM MASTER.dbo.S... more >>
Union and Not IN question
Posted by MarkusJNZ NO[at]SPAM gmail.com at 12/19/2006 4:38:48 PM
Hi, I have three tables
MarchEmployees
JuneEmployees
and AllEmployees
I want to find out which employees in AllEmployees do not appear in
MarchEmployees and JuneEmployees.
I thought I could just go
SELECT employeeID, employeeSSN, employeeAccount FROM AllEmployees WHERE
employeeID N... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Export query result to a comma delimited ascii file (with single quoted strings)
Posted by Alex Castillo at 12/19/2006 4:25:13 PM
Hi...
Using MS SQL 2K...
From Query Analyzer, I have a SELECT statement which produces the output I
need... but I need to output that rowset to a ascii file with the following
characteristics:
No headers (i.e. column names)
No footers (i.e. row count statistics)
Comma deli... more >>
using the result of a CASE statement in a calculation
Posted by WiLLerZ at 12/19/2006 3:46:00 PM
I have two tables - one to show billing details of jobs where each line
is like a line on an invoice (showing billed hours, rate and cost). My
other table is intended as an internal overview which shows a list of
jobs with the total billed hours and total cost for each. With the
help of this f... more >>
Adding a Column
Posted by Curious Joe at 12/19/2006 3:01:43 PM
I am dealing with multi-million row tables for some data. One of them
is an invoice file that has an Item Quantity as well as an Extended
Cost but doesn't have an Item Cost. I want to add a column that will
be the "Each" item cost.
Is there any reason (besides space considerations) to ever d... more >>
Views vs Cursors vs Export/Update
Posted by Curious Joe at 12/19/2006 2:54:56 PM
I have an application that allows the users to run various
queries/replaces/edits etc on large amounts of data. I am now
migrating some of the data to SQL due to its size (we are running into
the 2GB VFP limitation in file size).
One of the biggest questions I have is how to handle the data s... more >>
Invalid dates in datetime column
Posted by Richard at 12/19/2006 2:38:26 PM
I have bad values in a datetime column. dbcc ran with no errors. The first
things that come to mind are a hardware problems or memory corruption. Does
anyone have any ideas on how it could have happened?
SQL Server 2000 SP3
Clustered Windows 2000 enterprise sp1 active/passive
datetime co... more >>
IF statement within SELECT statement
Posted by WiLLerZ at 12/19/2006 2:33:12 PM
Is it possible to use an IF statement within a SELECT statement? I am
trying to do a query which works out the amount to be billed, and I am
having problems working out how to set the rate. The rate varies based
on other data in that record. I essentially want this sort of table:
Date |... more >>
BCP execute a stored proc?
Posted by Rick Charnes at 12/19/2006 2:04:36 PM
I notice that when OSQL runs into errors, it doesn't include the string
'Error' in its output that indicates the error. I need my scheduler to
see the string 'Error' in the output.
BCP, on the other hand, does include 'Error' in its output. Is there a
way to get BCP (or another utility?) ... more >>
Six Degrees.
Posted by jason7069 at 12/19/2006 1:56:53 PM
Hi,
I'm working on a little project that requires a bit of "6-degrees of
seperation" logic. Here is my table:
UserID FriendID
----------- -----------
1 2
1 3
1 4
2 5
3 6
4 7
5 8
6 9
7 10
... more >>
Security warning when running SQL Server query within an HTA
Posted by Highlander at 12/19/2006 1:28:44 PM
Hello all.
I'm using ADO to connect to a SQL Server database and run a T-SQL
query.
The script template I'm using can be found here:
http://groups.google.com/group/microsoft.public.scripting.vbscript/msg/687a21f574644956?dmode=source
When I run a VBScript, I get no popups. When I run an H... more >>
lost foreign key
Posted by Keith G Hicks at 12/19/2006 12:27:04 PM
In MS SQL 2k, is there anything that could cause a FK relationship to be
blown away other than manually removing it or its associated table(s)? I was
looking over a db diagram the other day and discovered that the
relationships I had set up with 3 tables (2 relationshps) were gone. I have
no ide... more >>
For/Next loop to process INSERT INTO statement
Posted by Doctorjones_md at 12/19/2006 11:48:52 AM
I reposted this because I was unable to achieve desired results from
previous recommendations.
Previous Post:
===================
I have the following code which does the following:
1. Deletes all rows having a value of "0" in column C
2. Uploads the data in Row 2 to my SQL Server
Wh... more >>
Count Distinct Dates?
Posted by Kevin3344 at 12/19/2006 11:36:12 AM
Hi all,
I would like to know the SQL for counting how many times a certain date
occurs in my table. Let's say I have the following data:
1/1/2006 1:00:00 PM
1/1/2006 2:00:00 PM
1/1/2006 3:00:00 PM
1/1/2006 4:00:00 PM
1/1/2006 5:00:00 PM
1/1/2006 6:00:00 PM
1/2/2006 1:00:00 PM
1/... more >>
Script
Posted by Vlacha at 12/19/2006 10:31:40 AM
My VB6 application is used by 2 companies. It works with SQL Server. I have
an access to the server of the first company via VPN. In case I make some
changes in the database (create new SPs, alter some tables etc.) I have no
problem with updating the database of the first company. With the sec... more >>
Combine two columns to one on insert
Posted by ghart NO[at]SPAM medex.com at 12/19/2006 9:02:11 AM
Hello,
I currently have something to the effect of:
insert into tbl_FinalPriceList (CatalogNumber, Desc1,Desc2, List)
Select CatalogNumber, Desc1, Desc2, List from tbl_GetPriceList
I would like to take Desc1 and Desc2 and combine them into one column
called FinalDesc. Something like:
... more >>
Using catalog views in global stored procedures
Posted by Ben Thul at 12/19/2006 8:52:00 AM
Hi all,
I'm trying to write a database maintenance stored procedure that will
be available to any database on a given server. I'm having problems
using sys.objects that I've boiled down to the following simple case:
CREATE PROCEDURE sp_test_proc AS
SELECT * from sys.objects
If I crea... more >>
Set Identity_Insert On with each insert, or just once?
Posted by amanda.waterman NO[at]SPAM gmail.com at 12/19/2006 7:50:37 AM
Hi,
I need some advice regarding using IDENTITY_INSERT. I need to insert
roughly 10,000 rows into a table using a utility, and at the same time,
it's possible that users may be inserting a few rows themselves using
the application that normally runs off this database at the same time
as the ... more >>
SQL Server Performance over internet connection
Posted by jhall NO[at]SPAM datalyzer.com at 12/19/2006 5:43:28 AM
I have cable modems on both ends of the connection.
I am using Access 2003 with ODBC linked tables to a MS-SQL Server 2000
db. The database is quite large with 2 million records in 130 tables.
But, the performance problems occur when returning as low as 100-250
records from one table with... more >>
Find consecutive sick days?
Posted by Stijn Verrept at 12/19/2006 3:39:55 AM
I have the following table:
create table #Planning (ID int not null, Sick bit not null, Date
SmallDateTime not null)
I have this sample data:
insert into #Planning (ID, Type, Date) values (1, 0, '2006-01-01')
insert into #Planning (ID, Type, Date) values (2, 0, '2006-01-02')
insert into ... more >>
How to delete duplicate records
Posted by murugan.pa NO[at]SPAM gmail.com at 12/19/2006 2:14:29 AM
Iam new to sqlserver i have a table with duplicate rows i need to
delete the duplicate records in the table.
Table rows
ID PrCode
1 S1256
1 S1256
2 S1257
2 S1257
3 S1258
3 S1258
3 S1258
4 S1259
5 S1260
5 S1260
After exeuting the query the table should have
ID PrCode... more >>
Nested Sets Model
Posted by zwieback89 via SQLMonster.com at 12/19/2006 12:29:44 AM
Hi,
I would like to convert my adjancey set model to a nested set model with a
left and right.
I understood this part.
Root Node is always with a a Left = 1, right = 2*(Select Count(*) from Table)
How do the leaf node get the left and right numbers.
I was reading an article of Joe Ce... more >>
View oy tables properties (like view in taskbar) in SQL 2005
Posted by checcouno at 12/19/2006 12:18:01 AM
I'd like to know if exists a view of mytables properties (like view in
taskbar in SQL Server 2000) like rows number, size. Not using single table
properties, ma a global view of all my tables.
Thanks!
... more >>
Stepped Sequential Query
Posted by ricky at 12/19/2006 12:00:00 AM
Hello
I have a few queries that I wish to consolidate in to one, however I am not
sure if it possible.
Is it possible to execute an SP within another SP and wait for it to finish
and then proceed with the next step?
Kind Regards
Ricky
... more >>
using select in smart way to improve preformance
Posted by Roy Goldhammer at 12/19/2006 12:00:00 AM
Hello there
i have two tables:
tblCustomers(CustID int identity(1,1) primary key clustered,
...
)
tblPayments(PaymentID int primary key clustered, CustID int not null,
PaymentDate datetime DEFAULT getdate()
TotalPay)
I need to get all Customer data and the last payment month and tota... more >>
using SendMessage on code
Posted by Roy Goldhammer at 12/19/2006 12:00:00 AM
Hello there
Ive learned that if one of my user is locking one of my tables. i can use
Enterprise Manager to send him a message.
I'm wondering if this option is also possible on query anlyzer or with code
... more >>
systypes table SQL Server 2005
Posted by lara at 12/19/2006 12:00:00 AM
Hi,
I used the status field on 'systypes' table for generating the table scripts
on sql server 2000. if the status value is zero, then we dont have to
specify, the size of the datatype for example, int big int etc. If status =
2, then we need to specify the column size. this is working fine... more >>
Expected hardware?
Posted by lord.fist at 12/19/2006 12:00:00 AM
Hi all!
I have uncommon question. I have SQL Server 2000 EE. I am working on
database that will contain contextual dictionary and that means storing
about a million words that are connected to about a thousand keywords.
My question now is this: What is expected hardware for this?
I have ... more >>
|