all groups > sql server programming > october 2005 > threads for friday october 14
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
what does this mean...
Posted by ari at 10/14/2005 11:09:03 PM
hey all,
i was running an update sql batch file in query analyzer and got the
following warning:
Warning: Null value is eliminated by an aggregate or other SET operation.
is this saying that this happened or has to happen?
thanks,
ari... more >>
advice
Posted by ari at 10/14/2005 11:05:02 PM
hey all,
does sql batch files allow you to have transactions? i'm trying to update 3
tables in a sql batch file and was wondering if this was a good idea or
should i just use stored procedure?
thanks,
ari... more >>
how to question
Posted by ari at 10/14/2005 9:14:02 PM
hey all,
Name, Inv(y/n), Desc
---------------------
Cust1, null, Desc1
Cust1, null, Desc2
Cust1, Y, Desc1
Cust2, null, Desc1
Cust2, Y, Desc2
How would i select distinct customer names and get all the fields in my
result at the same time?
i know about select distinct name from... more >>
how to do running totals?
Posted by Keith G Hicks at 10/14/2005 8:58:17 PM
I know this is probably best left to the client side but I was wondering how
to do this on the SQL side too.
If the data is as follows:
CheckDate CheckNum PmtAmount
10-1-05 DEP 15.00
10-1-05 1 -5.00
10-2-... more >>
Limit of rows in table?
Posted by ReTF at 10/14/2005 5:17:51 PM
Hi all,
What is table row size limit in MSSQL?
Thanks
... more >>
Debugging triggers, how?
Posted by Bob at 10/14/2005 5:13:09 PM
I could find that its possible to debug stored procedures in SQl server
2000, but did not find any place in BOL where it was explained if it was
even possible to debug (step through and verify values obtained as well as
detect programming errors other than syntax errors) triggers. Is it
pos... more >>
Error on this query- worked until recently
Posted by Pancho at 10/14/2005 5:03:03 PM
This is the T-SQL I scraped out of a Crystal Report that worked until 4pm
today:
When I run the following:
SELECT "Account"."OpenDt", "CustRelation"."RelationCode",
"CustRelation"."FullName", "Userfield"."UDFCuthr5", "Userfield"."UDFCufiv1",
"Userfield"."UDFCufiv2", "Account"."AcctId", "C... more >>
Concat columns
Posted by Chris at 10/14/2005 4:16:20 PM
I have to do some paging stuff. I am doing the follow in a proc.
Select top 10 * from customer
where @SearchKey <= LastName+FirstName+CustomerNumber
Question is what index to I build on the database to be able to search
this effectively?
Thank you.
Chris... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
TRANSACTION LOG RESTORE
Posted by Kevin at 10/14/2005 2:10:03 PM
I use following step to test transaction Log restoration.
1. I created a database "TESTDB"
2. I added a table called "testTable"
3. then I added device,
EXEC sp_addumpdevice 'disk', 'TESTDB', 'c:\Program Files\Microsoft
SQL Server\MSSQL\BACKUP\TESTDB.BAK'
4. BACK... more >>
Simple table management.
Posted by Jason at 10/14/2005 2:07:11 PM
I would appreciate some assistance on database design.
I don't need SQL syntax help. I have mostly done custom
"databases" if you will and would like to think
like SQL for this next project.
A simplistic DataBase scheme for example:
Table : Persons
-
Columns : ID Primary Key
... more >>
IGNORE_DUP_KEY
Posted by Gary at 10/14/2005 2:00:49 PM
Is there any way to programmatically detect whether an index has the "WITH
IGNORE_DUP_KEY" clause set? I can find whether or not it's unique or
clustered, but can't find anything on this.
Thanks for any advice.
-Gary
... more >>
select column from a string
Posted by Abraham Andres Luna at 10/14/2005 1:56:06 PM
thank you for your previous answers,
i tried working with the exec function but that isnt going to work for what
i want to do
i've created a trigger:
CREATE TRIGGER trigCCI
ON COCUS FOR INSERT
AS
DECLARE @NewValues varchar(8000)
SET @NewValues = ''
DECLARE curCols INSENSITIVE CURSOR... more >>
Join Question
Posted by jack at 10/14/2005 1:11:47 PM
I am trying to join two tables and one table could have multiple records.
Is there a way to limit to one record on the JOIN statement?
Thanks
... more >>
Simple question ??
Posted by serge calderara at 10/14/2005 1:10:11 PM
dear all,
I am new in SQL server 2000 and I would like to get information on how
things are usually done when handling dynamic content.
On huge web sites, like news, or other they are numerous of information
which are dynamic.
How this huge text content is store in databes?Does sql server... more >>
top item from grouping of data
Posted by Brian Henry at 10/14/2005 11:52:25 AM
here's a question that ive been thinking about... I have the following table
CREATE TABLE [dbo].[JournalEvents] (
[EventID] [int] IDENTITY (1, 1) NOT NULL , -- primary key
[JournalEntryID] [int] NOT NULL , -- foreign key
[EventDate] [datetime] NOT NULL ,
[EventActionID] [int] NOT NULL ,... more >>
Help improving this script
Posted by jenks at 10/14/2005 11:44:04 AM
Hello and thank you for taking the time to read this.
Can anyone provide any recomendations for improving this script. It is
fairly straight forward, and it works. I am looking for tips the experts
would use.
Also there are two things I would like to do that this script currently does
no... more >>
counting records
Posted by Przemo at 10/14/2005 11:13:04 AM
Hi,
I need to count records in a table to make server-side paging. COUNT(ID) is
rather expensive operation. Can I relay on a query returning number of rows
for a table based on rowcnt field in sysindexes table? I mean if this query
will return up-to-date number of rows.
thanks
Przemo... more >>
Case Statement Help Please
Posted by Patrice at 10/14/2005 11:07:01 AM
Hello,
I have tried the following syntax:
UPDATE WHJOINTDATA.DBO.STAGE_PHX_FACT_POLICY_RF
SET WIND =
CASE
WHEN (WHJOINTDATA.DBO.STAGE_PHX_FACT_POLICY_RF.OCCUPANCY = 'POULTRY')
THEN WHJOINTDATA.DBO.STAGE_PHX_FACT_POLICY_RF.WIND =
WHJOINTDATA.DBO.WH_VIEW_ENDORSEMENT.SHORT_CODE_2
WHER... more >>
Ceate Database Question
Posted by mike at 10/14/2005 10:39:49 AM
Hi,
I am trying to write an installtion sql script that creates a database.
However, I am running into problems because the potential of sql servers
having different setups (log and db files on different partitions...). How
do I handle this?
Thanks
... more >>
Join Sequence Priority
Posted by A.M-SG at 10/14/2005 10:38:57 AM
Hi,
I have a select statement like this:
SELECT *
FROM
T1
INNER JOIN T2 ON T1.ID=T2.ID
LEFT OUTER JOIN T3 ON T2.ID=T3.ID
The problem is I need the query processor LEFT JOIN T2 and T3, then, INNER
JOIN the result with T1.
I tried to use bracket like this:
... more >>
Connection strings.
Posted by Wade at 10/14/2005 10:36:16 AM
Hi all,
Okay, a few questions. What is the difference between the following, and
which should I use?
1) Server=DBSERVER;Database=DATABASE;uid=UID;pwd=PWD
and ...
2) Provider=SQLOLEDB; Data Source=DBSERVER;Initial Catalog=DATABASE; User
Id=UID; Password='PWD'
Turns out that ... more >>
Referring to another DB in a stored procedure.
Posted by blinky44 at 10/14/2005 10:18:52 AM
Hey,
I have a stored procedure in a SQL Server DB that I need to access a
table in a differant DB on the same server. Can someone help me with
the syntax for this? I am lost.
EX - I am in DB "XYZ" using stored procedure "QQQ" and in this stored
procedure I want to reference a table "accou... more >>
Multiple Records to a string
Posted by Michael Persaud at 10/14/2005 10:16:39 AM
Hello All,
I am trying to create a view that would look up a table and retrieve the
records to one column e.g.
CLID CID CatID
1 227 3
2 227 5
3 228 2
4 229 1
5 230 1
what i need... more >>
MS SQL Server 2000 - Search a table with 250,000+ records in less then a second
Posted by scgwebmaster NO[at]SPAM yahoo.com at 10/14/2005 10:02:02 AM
I have one table with 300,000 records and 30 columns.
For example columns are ID, COMPANY, PhONE, NOTES ...
-----------------------------------------------------
ID - nvarchar length-9
COMPANY - nvarchar length-30
NOTES - nvarchar length-250
----------------------------------------------------... more >>
assigning values to fields
Posted by rodchar at 10/14/2005 9:23:03 AM
hey all,
let's say i have the following records:
Name, Inv#, Desc
---------------------
Cust1, null, Desc1
Cust1, null, Desc2
Cust1, 1, Desc1
Cust1, 2, Desc1
Cust1, 2, Desc2
How would you make those null values 3's or the MAX(Inv#) for Cust1?
thanks,
rodchar
... more >>
Get all User Databases
Posted by john wright at 10/14/2005 9:17:47 AM
When I execute the sp_databases proc all I get are the databases that the
logged in user has rights to. I want a stored procedure that will return
just the names of all the non-system databases that I can populate a
dropdown list with. I really don't want to add the user to every database
... more >>
MS SQL Server 2000 - Search a table with 300,000+ records in less then a second or two
Posted by nywebmaster at 10/14/2005 9:12:46 AM
I have one table with 300,000 records and 30 columns.
For example columns are ID, COMPANY, PhONE, NOTES ...
-------------------------------------------------
ID - nvarchar length-9
COMPANY - nvarchar length-30
NOTES - nvarchar length-250
---------------------------------------------------
S... more >>
create report incrementing date on left and results based on that date in subsequent columns
Posted by hazz at 10/14/2005 8:59:13 AM
I would like to create a report in SQL Analyzer. Is there a For Next
construct or equivalent?
declare @now datetime
set @now = '2005-09-19 17:57:00.00'
for i = 1 to 60 -- pseudocode
select @now
select count(Create_DT) from customer where EmailSent_DT > @now and
EmailSent_IN ... more >>
basic question for sp
Posted by Jen at 10/14/2005 8:55:10 AM
Hi,
I need to write a sp. In the sp first I do a select statement (select cycle
from table where ... ) it only returns a single value. and the rest of the sp
will do different select based the value. how can assign the result to a
varable? Thanks... more >>
Newbie Help
Posted by d4 at 10/14/2005 8:46:29 AM
Please help, I have the following:
Machine Software
------- --------
PC Maker PC Software
--- ------ --- --------
a1 gateway a1 xxx
a2 dell a... more >>
Are there any MS SQL operations that are not transactional ?
Posted by Marek at 10/14/2005 8:21:57 AM
I pretty new to MS SQL.
Long ago I heard that some MS SQL data definition operations are not
transactional.
Executed in the transaction's boundaries their results persists even if
transaction rolls back.
Could anyone ellaborat on that subject ?
Thank you.
... more >>
Unique Selections In Back End
Posted by Neil at 10/14/2005 8:11:41 AM
I am using SQL 7 with an MS Access 2000 MDB front end, using bound forms
with ODBC linked tables. In one form, the user needs to be able to check a
box to select one or more records. This is accomplished with a local table
containing two fields: the primary key value of the SQL table and a boo... more >>
Alphabetical Order - Eliminating the "THE"
Posted by rwilson290 NO[at]SPAM hotmail.com at 10/14/2005 8:02:05 AM
Hi,
This may seem like a simple problem, and I'm somewhat embarrassed that
I've been developing for 7 years and haven't been asked to deal with
this - but when you are ordering a list alphabetically, HOW do you
factor out the preceeding "The" in your list items when you do your
ordering. For e... more >>
fastest way to open a query?
Posted by ozgecolak NO[at]SPAM gmail.com at 10/14/2005 7:23:04 AM
Hi.I am writing a program in c++ with ado which has to write 2-3 times
per second in a same field.That`s because i need speed.i have to use
sql unfortunately because our webmaster will take data from here.if i
had chance to choose i would choose berkeley db.Anyway here is a piece
of my code.how ... more >>
max row size of a table
Posted by jaylou at 10/14/2005 7:16:05 AM
Hi all,
I have a web application that needs to have a few very large searchable
fields. I created the table with 2 varchar(8000). I have data in the table
and there are a few rows that have 8000 characters in the rows. I tried to
add 2 int columns to the table and I got the error below.
I... more >>
DATABASEPROPERTYEX code?
Posted by Carl Henthorn at 10/14/2005 7:04:02 AM
where does DATABASEPROPERTYEX() get its information from? I cant seem to use
sp_helptext to see the code. error "DATABASEPROPERTYEX does not exist in this
database". I checked every db on the server, where does it exist at?
I am tryign to wrte code that checks for recovery level without using ... more >>
Insert Statement questions
Posted by blinky44 at 10/14/2005 6:55:56 AM
OK, so this is probably going to be a dumb question but I am somewhat
of a beginner so please bare with me. Here is what I have:
Insert into activplant_data_exchg (record_ID, start_time, value,
status_id, trans_time, status_desc_id, meas_pt, meas_pt_desc,
sap_equip)
values (@k+20, @SampleDat... more >>
sql query
Posted by vanitha at 10/14/2005 5:30:06 AM
Hi,
my table data is
id1 registered
1 25
2 25
3 25
1 26
2 26
3 26
1 27
2 27
1 28
I want to retrieve the registers where it has the id1's 1, 2 and 3
result shd be
25 and 26
pls help me to solve this
thanks
vanitha
... more >>
How to zip from a job
Posted by Mark at 10/14/2005 4:59:47 AM
Hi - from a job, which backs up a sql database to a local file - is it
possible to invoke the windows zip to compact the newly created backup
file?
(I know you can use WinZip from the command line, and build the shell
commands into the Job - but that's only in WinZip 9 - does Windows Zip
whic... more >>
Isolation level in nested transactions
Posted by Amid at 10/14/2005 3:58:05 AM
I'm using the following code to create nested transactions with different
isolation levels:
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED";
cmd.ExecuteNonQuery();
cmd.CommandText = "UPDATE Table1 SET Text = '11' WHERE ID=1";
cmd.Execu... more >>
Select first record from a join
Posted by Graves at 10/14/2005 2:12:02 AM
Hello
I have a stupid newbee question, but i cannot get this query running :.-(
I have a table with "exchange codes" (Key: FromDate and exchangeCode)
And i have a table from where i need to find the "exchange rate"
I join the tables like this
SELECT EXCHRATES.EXCHRATE,
... more >>
Does LIKE operator have major performance issue with variables?
Posted by HardKhor at 10/14/2005 2:01:01 AM
Hi all,
Below are two similar SQL statements that give the same results:
1. SELECT * FROM InvoiceDtl WHERE IvoNum LIKE ('Ivo-0510-00001')
2. DECLARE @IvoNum AS NVARCHAR (20)
SET @IvoNum = 'Ivo-0510-00001'
SELECT * FROM InvoiceDtl WHERE IvoNum LIKE (@IvoNum)
InvoiceDtl is a big tabl... more >>
Dynamic Query
Posted by vanitha at 10/14/2005 12:02:02 AM
Hi friends,
this my query
declare @i_errorDb varchar(200)
declare @i_tableName varchar(200)
Declare @SQL varchar(4000)
Declare @ParamList varchar(4000)
select @i_errorDb = 'test'
select @i_tableName = 'employee'
select @SQL = 'if exists (select * from @xi_errorDb.dbo.sysobjects w... more >>
How to get rows user defined range?
Posted by s at 10/14/2005 12:00:00 AM
Hello,
I need a keywork like LIMIT(in oracle) which let me to get rows, I defined.
For exaple I want to show records from 100. record to 200. record!
In oracle I could do like this
Select * from Customer limit 100, 100
I could do a complex query so it let me to get what I want, but I don't
t... more >>
Trailing zeroes in Transact SQL
Posted by Thor W Hammer at 10/14/2005 12:00:00 AM
How can we remove all the trailing zeros on a decimal number?
Cheers
... more >>
|