all groups > sql server (alternate) > july 2007
Filter by week: 1 2 3 4 5
output parameters from row with max id
Posted by mcolson at 7/31/2007 9:45:39 PM
I am trying to select multiple values from the row with the max id,
and output them within my stored procedure. How would I combine the
following two rows so that I only need to use "from mytable where
IDnum = (select (max(IDnum)) from mytable))" once. I have at least 8
other outputs I will be... more >>
FK Assignment on Surrogate Key Table Throws Error
Posted by pbd22 at 7/31/2007 2:12:39 PM
Hello.
I am getting the following error:
"""There are no primary or candidate keys in the referenced table
'UserPrecedence' that match the referencing column list in the foreign
key 'FK_USERS__UserPrecedence'."""
When running the following script:
alter table Users
add constraint FK... more >>
transactions
Posted by steven at 7/30/2007 8:17:35 AM
I have a small database that I have been testing.
I get an error about a transaction deadlock.
The code is in stored procedures and I added transactions to the sp's
but the error happened again.
I wrapped the whole sp in just one transaction and I don't have any
index on the tables.
... more >>
Why XML Output is Truncated
Posted by Mo at 7/30/2007 7:51:41 AM
Hi,
I am trying to generate an XML output form the database. I am
executing
select * from Request_vw for xml auto
The output data is being truncated. is there a limit on the output
result of an XML query?
Thanks
... more >>
MS SQL IF ELSE condition checking
Posted by Yas at 7/27/2007 2:47:35 PM
Hello,
I have Table1 with column Email, which has mail addresses in the
format 'useremailid@'. Few of these Email values are NULL where no
mail address was specified.
In my View1 I'm using SUBSTRING like... Left(Email,CHARINDEX('@',
Email)-1) AS EMAIL_NAME (to cut out the @ sign) FROM Table... more >>
Set variable to value in column
Posted by mcolson at 7/26/2007 8:08:43 PM
Is it possible to set a variable in a stored procedure equal to a
value from a column when that column's respective ID is equal to
max(id)-1
ID A B
1 24 24
2 53 29
3 76 47
4 32 32
What I am trying to do is update A in the last column t... more >>
Add last two values
Posted by mcolson at 7/26/2007 7:16:49 PM
I am trying to create a stored procedure that will add the last two
entries from a column. If I had a column named box, I would want to
add the two values in box, for which my ID column is Max and Max-1.
Is there anyone who can help me with this?
Matt
... more >>
Which general SQL NG is more active??
Posted by tlyczko at 7/26/2007 4:08:24 PM
Is comp.databases.ms-sqlserver more active than
microsoft.public.sqlserver.server, or is it the other way around??
Which NG is better for general and 'learning SQL 2005' types of
questions??
Thank you, Tom
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Can I manage MSDE with SSMS??
Posted by tlyczko at 7/26/2007 3:35:27 PM
Hello,
We have an XP workstation containing a very important MSDE-based
application. Its MSDE database isn't likely to change for quite a
while.
The app contains an internal backup method (File, Backup, Backup) and
an auxiliary app/script for shrinking the database and logs. I would
like t... more >>
Deleting all data
Posted by Tmuld at 7/26/2007 12:01:36 PM
Is there a way to delete all data from a database - all tables and all
tables excluding system tables?
sqlserver 2000?
Thanks,
Tmuld
... more >>
general question
Posted by MikeJ at 7/26/2007 10:59:17 AM
hi...i would like to know best practice when assigning a value to a variable
example below
set
or
select
declare @var1 varchar(25)
set @var1='abc'
select @var1='abc'
to me
set is implicit
select implies conditions
i see both used all over the place here at my new company....
... more >>
MS SQL return Min count homeMDB
Posted by Yas at 7/26/2007 6:26:52 AM
Hello All,
I have a table with a column called homeMDB which contains data
attribute value of users homeMDB from Active directory.
There are about 20 distinct mail stores all on 1 server used by 2000
users. I would like to return which mail store has the lease number of
user accounts.
I th... more >>
SQL HELP PLEASE!! Cursor only returns part of the data
Posted by Simon Barnett at 7/26/2007 12:06:53 AM
Hi,
I would much appreciate some help with a work project that is due very soon.
I have used a cursor to return the required result from a db table in order
for me to use in an ASP/VBScript webpage. This is the first time I have
used a cursor and am having problems.
The problem is that... more >>
Error: The number of failing rows exceeded the maximum specified, Help !
Posted by David Greenberg at 7/25/2007 3:26:36 PM
Hello
I am running a DTS (Sql 2000) and transfering data from an SqlServer
database to an Ingres database.
I am transfering 153k rows.
Execution fails with the error message:
"The number of failing rows exceeded the maximum specified"
The number of rows shouldn't be a problem because in ano... more >>
Pass Table as a parameter to a function
Posted by ArunDhaJ at 7/25/2007 1:52:00 PM
Hi Friends,
Is it possible to pass a table as a parameter to a funtion.
whos function declaration would look some thing like this....
ALTER FUNCTION TempFunction (@TempTable TABLE, @nPId INT)
my problem is: i have to access a temporary table created in an SP in
a function
ALTER PROCE... more >>
Database Design
Posted by Paul at 7/25/2007 7:57:22 AM
Hi all,
I have posted a question in the Database design and theory ng, but I
expect a lot of you will have suggestions to help me (and that ng
doesn't seem very active).
The post is here:
http://groups.google.co.uk/group/comp.databases.theory/browse_frm/thread/5db717bb37ca5b0f?hl=en
An... more >>
reduce the File Size less then Original Size in SQL 2000
Posted by ShailendraPune NO[at]SPAM gmail.com at 7/25/2007 12:18:46 AM
I have one db test with one .mdf and .ldf file.
..mdf file size is 100mb and for some reson i removed all the tables
from that .mdf file and transfer it into new secondary file so all the
tables moved into secondary file now i want to reduce the first .mdf
file from 100 mb to 50mb is that possi... more >>
Limiting log growth during DTS Package
Posted by davisutt at 7/24/2007 1:49:09 PM
SQL Server 2000 SP4. I built a large DTS package that grabs a number
of tables from an Oracle DB, does some scrubbing and date verification
and loads to a SQL Server DB. Most of the tables are full refresh and
a few are incremental.
Main DW: DwSQL
Staging Area: DwLoadAreaSQL
The DW is a... more >>
A simple query that returns the most current address
Posted by Rex at 7/23/2007 7:26:34 PM
Hi,
I have an Address table which contains more than one addresses for a
particular member. I want to write a query that would only display
most current address. All addresses have a unique ID (addID).
Example:
memberID addID address1
-------- ------ --------------------------------------... more >>
Update Guid column on any update to table row
Posted by michael at 7/23/2007 1:27:13 PM
I have a column Last_Updated (uniqueidentifier) on a table. I'd like
this column to get a new guid (NEWID()) each time any column in the
row is updated.
Is there an automatic way to do this outside of triggers?
Here's an example of what I'm looking for:
CREATE TABLE GuidTest (ID INT PRIMA... more >>
How to Test Database Connectivity From a Workstation?
Posted by at 7/23/2007 12:41:10 PM
Hey guys,
I have a client that is using a SQL database driven software. SQL and
the databases are housed on a separate server, and the software is
installed on the workstation. We use a connection string to connect
the database.
Well, they are completely down with messages, "object referen... more >>
Same field different values
Posted by gelangov NO[at]SPAM hotmail.com at 7/23/2007 8:00:23 AM
create table table1
(field1 varchar (8),
field2 varchar (4))
field1 and field2 together is unique.
Example data:
Field1 Field2
1 A
1 B
1 C
2 A
2 C
3 A
3 B
3 D
4 A
4 B
1. The query one should find all the Field1 that has Field2 value of
ONLY (A) and (B)
... more >>
Need help with finding duplicate records please
Posted by theintrepidfox at 7/23/2007 6:15:19 AM
Dear Group
Please accept my apologies for this trivial question. I can't get it
to work.
What I'm trying to achieve is to find duplicate contact records. E.g.
There might be two records relating to the same individual. Being
enetered as Phil Baker and Philip Baker. For that purpose I do a
... more >>
MS SQL Express Advanced vs MS SQL full version vs MySQL
Posted by wipeout64 NO[at]SPAM hotmail.com at 7/22/2007 8:31:37 PM
I'm planning to transport a desktop application to the web. A spin-off of
this application has already been put on the web by another programmer. He
used ColdFusion with MS SQL, Access, VC, and Java. It is faster than the
desktop application (written in VFP).
1. Can I get the same results usi... more >>
contents of image fields
Posted by Koral at 7/22/2007 12:00:00 AM
Hi,
I have a SELECT FROM TABLE query and in that table there is a field of type
image. Result of this select goes throug internet do its destination. But in
fact I need only to know if in this field is or not an image. Is there any
funciotn which gives me information about contents of image... more >>
Get one row from each group of rows
Posted by deluca.vicente NO[at]SPAM gmail.com at 7/21/2007 9:19:30 PM
Hi,
I'm trying to build a query that get only one row from a group of
rows, but I need the values from that row and not the results of one
function group.
I need one row for each idRef, with column2=2 and the bigger column1
id |idRef | column1 | column2
1 1 0 ... more >>
Problem with nested function call (UDFs)
Posted by Carsten at 7/20/2007 9:39:44 AM
Hello Folks,
I encountered a problem with SQL server 2000 and UDFs.
I have a scalar UDF and a table UDF where I would like the scalar UDF
to provide the argument for the table UDF like in:
SELECT
*
FROM
transaction_t
WHERE
trxn_gu_id in (
select get_trxns_for_quarter(get_current... more >>
DOS Batch File Running osql - opening/closing connections
Posted by Stephen2 at 7/20/2007 5:14:06 AM
I've written a small dos batch script that runs a simple query through
osql and then calls an exe which sends an email if the returned value
> 0.
The query checks if a value in a column has not been updated for 5
mins and raises a warning through an email and it will need to run
throughout th... more >>
error 0: cannot load the dll, xpstar.dll
Posted by kucuktosbiii at 7/19/2007 10:39:22 PM
hi
i use sql 2000 server and windows 2003 standart server.
i have problem, when i open the database in sql server,
i see this error message
"error 0: cannot load the dll, xpstar.dll .. reason 126"
what can i do?
thanks
... more >>
substring matching
Posted by anoosh at 7/19/2007 8:57:29 PM
hi all
I want to write a sotred procedure which has a parameter,called
@name.The SQL statement must return all rows where this parameter is a
subatring of a special column called FirstName.This procdeure do the
same ,but return all rows where @name is the exact matching.what
should I do?
/... more >>
Howto: Delete every second record if duplicates
Posted by Radu at 7/19/2007 8:28:34 PM
Hi.
I have a "union" table which results of a union of two tables.
Occasionally I could have duplicates, when the same PIN has been added
to both tables, albeit at different Datees/Times, such as:
PIN Name Added Date
100411 A 7/11/2007 10:12:58 AM
100411 A 7/17/2007 10:54:23 AM
100413 B 7... more >>
Import from MSSQL2000 (8) to 7?
Posted by Erwin Moller at 7/19/2007 2:24:31 PM
Hi Group,
I developed a intranet site using MSSQL7/win2000 some time ago.
The target environment used MSSQL2000/8.
We were (almost painlessly) able to import the db-scheme and data from 7
to 8. (Bravo MSSQL)
Now I need to do some upgrading on the application and I would like to
have a co... more >>
Ongoing purging of active records causes deadlocks
Posted by at 7/19/2007 1:13:35 PM
Hi,
We have a Java application that runs against a variety of backends
including Oracle and MSSql 2000 and 2005. Our application has a
handful of active tables that are constantly being inserted into, and
some of which are being selected from on a regular basis.
We have a purge job to remo... more >>
Default value being a concatenation of other columns
Posted by Drew at 7/19/2007 1:01:30 PM
Hello all,
Does anybody know if it is possible to set the default value of a
field to equal the concatenation of 2 other fields?
I.E.
Field 1 = 123
Field 2 = 345
Field 3 = (Field1 + Field2) = 123345
This is easy enough to do using a stored procedure, but I'm trying to
use the import tool... more >>
Help with combining data from multiple rows into one column in a view
Posted by gaholmes NO[at]SPAM comcast.net at 7/19/2007 10:37:40 AM
Hi, I am stumped and was hoping someone could help me out. Any help is
appreciated.
I have a view that looks sort of like this (but with a lot more
entries of course)
UniqueIdentifyier Column1 Column2
1 9999 100
2 9999 200
3 9999 300
Wha... more >>
Use decimal or varbinary data type?
Posted by anilkmakhija NO[at]SPAM gmail.com at 7/19/2007 8:11:56 AM
I need to store 256 bit hash (SHA-2 alogrithmn) in one of the table's
primary key. I would prefer to use numeric data type rather varchar
etc.
* Decimal datatype range is -10^38 +1 to 10^38 -1. I can split my 256
bit hash into two decimal(38, 0) type columns as composite key
* I can store the... more >>
DSN-less connection
Posted by RLN at 7/19/2007 6:00:41 AM
I am looking to try and connect to SQL Server via a DSN-less
connection in a VB application.
Setting up ODBC data sources is a headache for each user workstation.
There has to be an easier way.
Is there a straight forward way to do that or do you know a good
reference source that would have inf... more >>
Sql Server Full Text Index
Posted by Piero 'Giops' Giorgi at 7/18/2007 4:07:42 PM
Hi!
I'm trying to set up a full text catalog for my criminal database, but
I'm running into some difficulties.
Example (Just to start)... WHY Do I keep getting this message???
Thanks!!!
TITLE: Microsoft SQL Server Management Studio
------------------------------
Cannot execute changes... more >>
How do I see the result of calling a stored procedure in VB6 ?
Posted by David Greenberg at 7/18/2007 2:59:20 PM
Hello
I'm calling a stored procedure in VB6 using the "execute" command of
rdoquery.
Does anyone know how to check whether or not the execute command was
succesfull or not. Not on the level of whether any rows were updated or
selected but whether any Sql errors occured. VB picks up on any er... more >>
db_owners unable to see login list
Posted by SkyGringo at 7/18/2007 2:13:40 PM
Hi. We are using SQL Server 2005 64-bit on Windows Server 2003 R2 x64
Enterprise Edition. I have a really weird problem where I have people
out there who are placed in the db_owner, db_accessadmin, and
db_securityadmin roles in their database, and yet they are unable to
add new users to their ... more >>
How write this sentence with T-SQL
Posted by simonshang NO[at]SPAM gmail.com at 7/18/2007 10:56:05 AM
Hi, all friends. I'm using SQL-SERVER 2000.I have a table like this:
NIF Name
----------------------------------------
A-1234 Company1
B-123-B1 Company2
C-4568 Company4
D-453-DF Company5
I want delete the symbol "-" in the row "NIF". eg. A-... more >>
Trigger After Delete - I need a Trigger Before Delete
Posted by candide_sh NO[at]SPAM yahoo.de at 7/18/2007 1:23:48 AM
hello,
I googled around some time but I found no solution for this issue
(SS2000).
I have a table tblB which has to be filled whenever in table tblA
records are inserted, updated or deleted.
So I created one trigger which works fine for inserts and updates and
fills my tblB. tblB is filled w... more >>
Query every entry not in each hour
Posted by mcdonaghandy NO[at]SPAM gmail.com at 7/17/2007 5:22:09 PM
Hello,
I have been having a tough time writing the follow requirement for a
query.
On a table that the primary key is a tagId and an hourly timestamp, I
would like to find out for every hour which tags did not get entered
into the database. Essentially I am looking for patterns of entries
... more >>
Logical Name
Posted by Sharif Islam at 7/17/2007 3:16:12 PM
Hi,
I want to change the logical name of the database. My database name and
.MDF has the same name, but the logical name is different. Will
changing it impact anything?
--sharif... more >>
Combining many records into 1
Posted by rdraider at 7/17/2007 2:24:30 PM
Using SQL 2000, how can you combine multiple records into 1?
The source data is varchar(255), the destination will be text. I need help
with the select statement.
example tables:
CREATE TABLE [NoteHeader] (
[NoteID] [int],
[CustomerID] [int] ,
[Desc1] [varchar] (255),
[Date] [datetim... more >>
problem with login list
Posted by SkyGringo at 7/17/2007 2:15:26 PM
Hi,
I'm using the 64-bit version of SQL Server 2005, SP2, on Windows
Server 2003 R2 X64 Enterprise Edition. I've got a bunch of users out
there who are the db_owner, db_accessadmin and db_securityadmin of
their different respective databases. I would expect that they would
be able to add us... more >>
Firehose mode
Posted by David Greenberg at 7/17/2007 12:26:57 PM
Hi
I'm in Enterprise Manager and have made a change to a row.
When I try to update I get a message that says:
Transaction cannot start, Firehose mode"
Can anyone explain what this is and what it means ?
Thanks
David Greenberg
... more >>
Trigger After Delete - I would need a Trigger Before Delete
Posted by candide_sh NO[at]SPAM yahoo.de at 7/17/2007 8:04:59 AM
hello,
I googled around some time but I found no solution for this issue
(SS2000).
I have a table tblB which has to be filled whenever in another table
tblA records are inserted, updated or deleted.
So I created one trigger which works fine for inserts and updates and
fills my tblB. tblB is ... more >>
database information report
Posted by mail2suneelgupta NO[at]SPAM gmail.com at 7/17/2007 4:18:40 AM
Hello,
I am trying to use the SQl Server database reporting tools to create a
report on the database to find areas for optimization including table
formats, column formats, and sizes. Can anybody please help me with
this. If any body has used any other tool by which I can create above
mentioned... more >>
Same query - different execution plans??
Posted by sqlgirl at 7/16/2007 3:03:46 PM
Hi,
We are trying to solve a real puzzle. We have a stored procedure that
exhibits *drastically* different execution times depending on how its
executed.
When run from QA, it can take as little as 3 seconds. When it is
called from an Excel vba application, it can take up to 180 seconds.
Al... more >>
|