all groups > sql server programming > july 2005 > threads for friday july 1
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
Problem to understand a select question
Posted by Tony Johansson at 7/1/2005 11:01:28 PM
Hello!
Some background we have two tables one Person and one Car.
The relation is that one Person can own one or at most two cars.
How should the number 198898 and 114388 be understood.
What information does these two numbers give.
I have a select question that looks like this
SELECT COUNT... more >>
Beginner Q: Relationship and Updates/Deletes
Posted by matthias s. at 7/1/2005 10:59:31 PM
Hi there,
for testing purposes I've created two tables, Authors and Books (table defs
at the end of the message). I have a one to many relationship between them
(1 Author can have n Books).
My question is: how do I delete an Author from the table? Do I have to start
a transaction, remove th... more >>
SQL Mail
Posted by Ed at 7/1/2005 9:56:01 PM
Hi,
After I setup the SQL Mail, and make sure it works fine, do I still need
to start up the SQL Server and Agent as the same account that i log in to the
Windows Server?
Thanks
Ed... more >>
paramaeters in SP
Posted by Stuart Hawkins at 7/1/2005 9:12:03 PM
Hi,
I have a Select query I have put in a stored procedure. What I would really
like to do is pass it parameters that tell it not only the values to filter
by but the fields to filter on too (choice of three including combination of
more than one).
Cannot figure it out! Any help welcome.... more >>
'SET IDENTITY_INSERT ' + @TablesName + ' ON' doesn't work in store
Posted by erncelen at 7/1/2005 7:30:02 PM
Hi,
I have a big problem:
If I try to execute SET IDENTITY_INSERT as below,
DECLARE @SqlCheckIdentity varchar (255)
SET @SqlCheckIdentity = 'SET IDENTITY_INSERT ' + @TablesName + ' ON'
EXEC (@SqlCheckIdentity)
Or
DECLARE @SqlCheckIdentity varchar (255)
SET @SqlCheckIdentity = 'SET I... more >>
Locks
Posted by Mike Labosh at 7/1/2005 5:40:47 PM
In EM, under Management -> Current Activity -> Locks / Object, I have a
table that shows 4,621 Page locks (which I think is ok, because they are all
me, and I'm currently waiting for a bit fat batch to complete. But on the
list, in the Mode column, they are all listed as Mode = IX.
Now, be... more >>
select name from sysobjects where ......
Posted by Henrik Skak Pedersen at 7/1/2005 2:56:51 PM
Hi,
Is there any difference in the result of these two queries?
select name from sysobjects where OBJECTPROPERTY(id, N'IsUserTable') = 1
order by name
select name from sysobjects where sysstat & 0xf = 3 order by name
Thanks
Henrik.
... more >>
Snapshot of data
Posted by C-W at 7/1/2005 2:54:30 PM
I was wondering if something along these lines is possible in SQL Server...
We have a table which contains a particular record. This table also has
lots of related tables. I would like to take a snapshot of a particular
record and all it's sub table entries. The user can then make changes ... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Design Suggestions for "marking" databases?
Posted by Tore at 7/1/2005 2:34:13 PM
I have an application that will be working with multiple databases (same
design different data). At the moment, I list the available SQL Servers, as
well as the existing databases when a user selects one of the servers. The
user can select one of the existing databases or create a new databa... more >>
full text indexing on binary fields
Posted by Brian Henry at 7/1/2005 2:24:50 PM
i want to store PDF files in a database, but yet still have them full text
searchable by the database... I have the adobe PDF IFilter interface
installed and registered on the SQL Server box which is to allow for full
text searching on PDF files in a database... Now, my question is how do i do... more >>
is there a table function for first occurence of a string?
Posted by Rich at 7/1/2005 1:41:03 PM
If a table contains 120 columns and contains data that is about a specific
subject matter - is there a way to search for the first occurence of a string
like "bipap" or "bi pap"? The thing is that you don't know what column would
contain this kind of text. I guess I could search each column ... more >>
Update Query Question
Posted by RitaG at 7/1/2005 1:36:15 PM
Hi.
I have a SQL 2000 table (Table1) whose 1 column (column1) I need to update.
I have to match Table1.Column1 to the column of another table
(Table2.Column1) and if a match is found I'll update Table1.Column1 with
Table2.Column2.
I have the code for that. What I need is to set Table1.Col... more >>
Execution Plane Analysis
Posted by DMP at 7/1/2005 1:10:30 PM
Hi,
Can Any one give me the reference of an article or web site from where I can
get the proper idea about Execution Plane Report ?
... more >>
flatten rows into a variable
Posted by MrMarteng at 7/1/2005 12:49:15 PM
Hi!
Does anyone know how to flatten rows into a variable using sql in a
stored procedure?
Such as getting a rowset like this :
SELECT ID FROM SOMETABLE
ID
----------
1
2
3
4
5
6
7
And somehow get a variable containing 1234567
Regards Marteng
... more >>
LIMIT Command
Posted by Wayne Gibson at 7/1/2005 12:17:37 PM
Hi,
I'm looking at using MS SQLServer 2005 and having some problems with the
LIMIT command that I used in MYSQL.
It doesn't appear to exist in MS SQLServer 2005, anybody know what the
command is in MS SQLServer..
Thanks
Wayne
... more >>
DATEDIFF ignoring weekends
Posted by Mark Rae at 7/1/2005 12:01:45 PM
Hi,
Is there an easy / built-in way of calculating the number of hours between
two dates, but ignoring weekends?
E.g.
To calculate the number of hours between midnight this morning and midnight
on Monday morning, I might use:
SELECT DATEDIFF(hh, '1 Jul 2005 00:00:00', '4 Jul 2005 00:... more >>
New Question - Joining Ranges - URGENT
Posted by Kathy at 7/1/2005 11:11:13 AM
Hi All
For those of you that have not perhaps seen this - I need to join and lookup
on a range of values
Does anyone have a better / quicker cleverer way of doing this
ok here is the scenario
We have a lookup table with IP addresses and Countries
These IP addresses are converted to an I... more >>
a little join help
Posted by Kurt Schroeder at 7/1/2005 11:01:06 AM
can anyone help me to join these two queries. they each work, but i'd like
just one query.
select count(u.usrSecID) as isthere
from usr u join sec s on s.secID = u.usrSecID
and s.secUserID = 'Kurt'
will gives 3
select count(u2.usrSecID) as isthere
from usr u2 join sec s2 on s2.secID = u2.u... more >>
Undo Functionality
Posted by Mike Labosh at 7/1/2005 10:59:11 AM
One of our developers wants to implement undo stuff in the data tier. His
idea was to make a trigger on a table that loops over the columns in
[inserted] and [deleted] to compare the values, find out what changed to
what and then save it in a vertical undo table.
the undo table might look ... more >>
Date Formatting
Posted by tshad at 7/1/2005 10:40:43 AM
This is always annoying. I am always trying to remember the best ways to
display my date and cannot remember the formats or how to set up a custom
format in Sql.
At the moment, I am using DateDisplay = convert(varchar,e.DateSent,0) to
get:
Jun 22 2005 4:20AM
I want to change this sli... more >>
Data type issue in vb.net wrt sql server 2000
Posted by Rajesh at 7/1/2005 10:09:03 AM
I had created a user defined data type in sql server 2000 as follows
Length Prec Scale
AMTTYPE 9 15 2
Can any one help me
what is the equivalent data type in vb.net
I know the double and float its not have the same Prec and Scale .
Therefore I need to format the value ... more >>
Need help with a query
Posted by Glen K at 7/1/2005 9:45:11 AM
Say I have a table that contains pricing information for some products as
well as a count of the number of retailers selling at that price:
product_id
price
freq
Is there an easy way to get the lowest price for a product AND it's
corresponding frequency?
For example, if the table had th... more >>
CASE Statement
Posted by Wayne Gibson at 7/1/2005 9:38:52 AM
Hi,
Was wondering if somebody could tell me if it is possible to use a CASE
statement within in the WHERE clause.
I'm looking to create a store procedure that can a number of parameters.
Then depending on the parameters that were passed, define the correct WHERE
clause.
Many thanks..
... more >>
Calling stored proc within a stored proc - both have parameters
Posted by TroyS at 7/1/2005 9:08:57 AM
I have the following:
CREATE proc_1
@fromdate datetime
@todate datetime
AS
.....
.....
.....
INSERT #temp_table EXECUTE dbo.proc_2 (note, proc_2 has a 2 date parameters
to supply as well; i'm trying to figure out how to pass the 2 date
parameters; see below)
......
I'm getting... more >>
A floating point exception occurred in the user process.
Posted by Daniel Paull at 7/1/2005 8:25:03 AM
I periodically receive the following error message:
A floating point exception occurred in the user process. Current transaction
is canceled
I'm running SQL Server 2000 Standard Edition, sp4.
I am running an Online Browser Based Game with SQL as my backend, i have 2
such games the first... more >>
Stuck on a Query
Posted by Wayne Wengert at 7/1/2005 8:21:27 AM
I have 3 tables involved
TblA
NameID int PK
EmailAddr varchar(65)
.....
TblB
ContactID int PK
NameID
....
TblC
EventID varChar(10) PK
Category1 int ' FK pointing to a TblB.ContactID
Category2 int ' FK pointing to a TblB.ContactID
Category3 int ... more >>
How to split a column
Posted by Sidelo at 7/1/2005 7:01:06 AM
I need MSSQL to split a column to different columns
The table had two columns:
ID Message
1 Lastname: Siderius
Firstname: Lourens
Zipcode: 3083ER
2 Lastname: Test
Firstname: Test
Zipcode: Test
Then I use:
SELECT ID,
... more >>
Calendar table
Posted by Bill Nguyen at 7/1/2005 6:44:19 AM
I would like to create a calendar table starting with a base date such as
01/01/2005.
The table shouldd have the following columns for each row:
column Example
Date 1/1/2005
day 1
month 1
month name january
year 2005
weekday 1
weekday name Monday
weeeko... more >>
Transaction in SP
Posted by Ed at 7/1/2005 6:17:01 AM
Hi,
Is it necessary to put Begin Tran right before another calling SP?
e.g.
Begin Tran
Exec SPName
If @@Error <>0
Rollback Tran
Else
Commit Tran
or
I should do all the transactions inside SPName?
Thanks
Ed... more >>
Stored Procedure for update : update selected fields depending on indicators
Posted by sven.maes NO[at]SPAM gmail.com at 7/1/2005 6:16:38 AM
Hello,
is it possible to create a stored procedure with parameters,
so that you can say for example :
update table
if @indicator1 = 1 then set field1 = @field1
if @indicator2 = 1 then set field2 = @field2
.....
where keyfield = @keyfield ?
thank you,
kind regards ,
sve... more >>
Date part only without using Convert(char.....)
Posted by NH at 7/1/2005 4:44:02 AM
select convert(char,getdate(),101) will return the date without the time part.
Is there a way doing the same without converting it to a char? I need the
date part only but it must be a datetime data type.... more >>
Mirgration Q.
Posted by Ed at 7/1/2005 4:28:02 AM
Hi,
I have a database migration question. If I have a brand new database, I
believe I can easily use dettach/attach or backup/restore to move database
from Development to Production Server. If I already have an existing
database, and a developer just added let's say 5 more tables on the
... more >>
Database setup for a suite of applications
Posted by Craig HB at 7/1/2005 4:19:02 AM
We are developing a suite of web applications for restaurants, which include
an inventory app, cash-up app, staff timesheets app etc. The applications are
built with ASP.NET and the database is SQL Server 2000.
All these applications use application-specific tables (like the Timesheets
tabl... more >>
SELECT TOP problem
Posted by B.J. at 7/1/2005 4:16:11 AM
Hi,
I want to do select top n rows but n is variable :
SELECT TOP @MyVar ID FROM Table;
Because I get @MyVar from
SELECT @MyVar=COUNT(*) FROM Table WHERE ProfileID=@ProfileID;
which is not constant. But this does not work. Any suggestions, please.
Thank you.... more >>
Auto incrementing numbers
Posted by mark at 7/1/2005 3:39:50 AM
Hi
I have two tables (header and child) with a relationship between them.
Each time I insert a row into the child table, I want to have one of
the columns auto increment. I can't use an identity column (at least I
don't think I can) because the start and increment values can be
configured by ... more >>
Undeclare a local variable?
Posted by Andy Bretl at 7/1/2005 12:00:00 AM
Hi All,
I have a quick question regarding the use of local variables.
Actually it is more a cosmetic problem than a real one but I just wondered
if it is possible to:
UNDECLARE / REDECLARE a local variable?
ALTER doesn't work and DEALLOCATE is for cursors only...
Any ideas are kindly appre... more >>
HowTo: Summarise Verticle Data Horizontally
Posted by Richard Myers at 7/1/2005 12:00:00 AM
Hello,
Im hoping someone can help me with the following problem:
I have a table consisting of three fields (CustomerId, City, QAType) where
QAType is a discriminator with (n) possible values.
I want to run a select query that takes all the rows in the table and groups
them according to City... more >>
Why and How to Solve it?
Posted by Bpk. Adi Wira Kusuma at 7/1/2005 12:00:00 AM
I've tried execute "rebuildm.exe". But its proses is never stop, so look as
be hung. Because of it, I restart computer by standard method (not turn
reset at PC). Then I try to start SQL Server, But can't run.
Why does Sql Server not connect, and How to Solve it?
btw, how to execute "rebuild... more >>
|