all groups > sql server programming > july 2005 > threads for wednesday july 27
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
Select on 2 tables where value may be equal or null
Posted by Dave Elliott at 7/27/2005 7:41:38 PM
I have a situation where I need to select the values out of 2 tables
that are joined multiple times.
I have a table "Family" that has 4 members "Father", "Mother",
"Child_1" and "Child_2" who are of type "Person".
Family
=================
ID as uniqueidentifier not null
Father as uniquei... more >>
Removing IDENTITY from a tabe column
Posted by Hari at 7/27/2005 7:28:03 PM
Hi Guys,
I have created a table containg a column with IDENTITY keyword. I have data
in the table. Now i need to alter this table without IDENTITY for that
column. Please help me get a sql script to do this one.
The creation scirpt for the table is :
if exists (select * from dbo.sysobje... more >>
XSLT and SQL
Posted by VTadmin at 7/27/2005 7:04:03 PM
your help is appreciated in advance ...
I'd like to query a Table in SQL Server 2000 from an XSLT. What functions
are available using what language that can be embedded in an XSLT document.
Thanks... more >>
Just Venting
Posted by Mike Labosh at 7/27/2005 7:01:13 PM
So I have the three giant store procedures that I wrote last fall, and they
are in production. Now the business rules have changed so I have to tweak
them a bit. Now that I come back to them, they are ENTIRLY DIFFERENT so
now I have to waste a couple days analyzing how and why.
Giving en... more >>
Please Help!!
Posted by Scott at 7/27/2005 5:59:04 PM
Hi All,
if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[Table1]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Table1]
GO
CREATE TABLE [dbo].[Table1] (
[Col1] [int] NULL ,
[Col2] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRI... more >>
Stored procedure information sql server 2000
Posted by jose.lopes.cruz NO[at]SPAM gmail.com at 7/27/2005 3:45:58 PM
How can I get all parameter information given a stored procedure name?
Something like:
SELECT paramname, len, type, directio, ...
from x inner join y
where spname = 'mySpName'
Thanks!
Jose Cruz
... more >>
Stored Proc to get table names
Posted by HP at 7/27/2005 2:31:03 PM
Is there a system stored procedure to get the names of the tables in a
database?
thanks!... more >>
David Portas on Any one? Query Help Please
Posted by dotnettester at 7/27/2005 2:10:03 PM
Thanks for your response.
I got that query working,
SELECT P.productname, COUNT(S.productname)
FROM Products AS P
LEFT JOIN Sales AS S
ON P.productname = S.productname
GROUP BY P.productname ;
but what if there was another column CustomerId, which exists in both tables
and I want... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
select calls to a text file in c#
Posted by bfefferman NO[at]SPAM gmail.com at 7/27/2005 1:42:08 PM
Hi,
I have a table in sql 2005 and I would really like to export the
results of select calls into a plain text file with formatting based
around the columns.
Is there some code (in C#) that will do this?
Thanks.
... more >>
Recommended method to avoid duplicate folio numbers
Posted by Saga at 7/27/2005 1:34:36 PM
Hi all!
Using VB6, SP5, SQL Server 2000.
A third party ordering application is in use that uses
SQL Server 2000 as its back end.
I was assigned the task of developing a much smaller
application that would take orders from the clients.
Each order has a confirmation number that must be u... more >>
monitor large update
Posted by daveg.01 NO[at]SPAM gmail.com at 7/27/2005 1:23:26 PM
I have a large table 34 million records and I need to update a field.
I am doing this in batches of 1 million records (by joining a temp
table to the primary key).
I am trying to monitor the update using
SELECT COUNT(*)
FROM myTable with(nolock)
where newKey is null
What is weird is t... more >>
variable in the from clause
Posted by Bill Reed at 7/27/2005 1:15:03 PM
Is there a way to get sql to accept a variable in the from clause?
I needed to find all the tables in my application containing the field
tag_no which was pretty easy. Hard part is getting counts on the table list.
The tags are of two types, distinguished by an I or an M in column 6. My
probl... more >>
Query Help, Please
Posted by dotnettester at 7/27/2005 1:11:08 PM
I have productstable and a sales table. the only relation between them is
through productname. Each Sales Row will contain a productname. I know a
productid would have been a better candidate for relationship but for some
important reasons thats how it was kept.
Any way, I want to grab sales... more >>
Failed to get the call stack! error
Posted by João Costa at 7/27/2005 12:21:07 PM
I'm working with a team on a migration of a database from Sybase to SQL
Server 2000.
Currently I'm in the process of debugging a sequence of stored procedure
calls wich are relatively long and nested.
In the process of returning from the stored procedures, after the job done
in the lowest... more >>
Locking SQL Logins
Posted by Eric D. at 7/27/2005 12:19:02 PM
Hi,
I want to deny server access to an SQL login account. I realize that this
function is only available for WIN NT/2000 domain users, but I was wondering
if there was a way to simply disallow access to server for SQL logins.
I want to be able to suspend access to users, without having to ... more >>
Delete and return data
Posted by John J. Hughes II at 7/27/2005 10:08:54 AM
Is there anyway for a stored procedure to delete a record but also return
the data from the record? My first guess would be to copy all the returned
fields to temp variables but this seems awkward. The call will be in a
transation so if I fail to receive the data the transaction will be roll... more >>
Visio and SQL server
Posted by Patrick at 7/27/2005 10:08:44 AM
Hi Freinds,
SQL 2000 and Vision 2003 Pro
I have a data model in visio and want to export to SQL database .
I create the deault driver. but when I go through export database, it is
givining me wrong datamodel to export, it is not picking my tables in visio
that I create to export.
What sh... more >>
Block a truncate command
Posted by JasonDWilson at 7/27/2005 10:04:01 AM
Is there any way to block a truncate command on a table via a trigger or
something else in MS SQL Server 2000?
Thanks,
--
Jason... more >>
Recyle an identity column number when max is reached
Posted by JasonDWilson at 7/27/2005 10:03:02 AM
Is there any way to configure and Identity column to recycle when it reaches
the max value for the data type it is defined as?
--
Jason... more >>
catchin errors occured in sql server with DELPHI
Posted by pooyan_pdm at 7/27/2005 9:49:04 AM
hi
i want to know how can I catch an error occured in sql server with DELPHI
when an error occurs in sql server the number of error and description of the
error is sent to any programming language.
for example I want to change the message in my application when the error
occures?
but I don'... more >>
Performance question: Separate database or additional table?
Posted by Bob at 7/27/2005 9:45:02 AM
We have a database that has about 50 tables, each with approximately 800K
rows. These tables are imports of data from another system that are updated
daily. All the tables have the same column, Id, for a primary key. The tables
are accessed via views that serve mainly to assign meaningful name... more >>
Evil SQL Statment
Posted by nsmith NO[at]SPAM mysteryshops.com at 7/27/2005 9:23:48 AM
Ok heres the scenario:
2 Tables
Properties
PropID - Int - Identity
Class - Int
Address - varchar
Etc..
Property_Classes
ID - Int - Identity
PropID - Int
Class - Int
The properties table has one entry per property. The Property classes
table can hav... more >>
IS Or type check on bit field
Posted by Brian Henry at 7/27/2005 9:17:41 AM
I have a table that has a bit field called PHI, the user will specift true
(1) or false (0) in the application, but I want to if it is true return all
1 and 0 marked fields and if false only the 0 bit marked fields. How would I
write a query to include both if true and only false ones if false... more >>
Best Way To Copy Data From One Table to another in the different database
Posted by GP at 7/27/2005 9:05:22 AM
We have a transactional system and upon update of certain fields, We
want to copy some data from one database to another database when
certain criteria is met. I want the process to be asynchronous such
that the source process does not wait for the data copy to complete.
Also, the information ab... more >>
SQL query problem.
Posted by David at 7/27/2005 8:58:08 AM
Hi all,
I have two tables:
workgroups (wg_id, wg_name)
workgroups_keywords (wgk_wg_id, wgk_keyword)
Each workgroup has an associated list of one or more keywords.
What I wanted do to at first was given a particular list of keywords bring
back a list of workgroups that have at least o... more >>
Error 0x800c0005 when calling Microsoft.XMLHTTP from inside SQLServer 2K stored procedure...
Posted by SammyBar at 7/27/2005 8:57:28 AM
Hi all,
We have a sp that sends http requests. It uses Microsoft XMLHTTP component
that is part of XML pack that is standard with SQL Server 2000 SP3. For an
unknown reason the XMLHTTP component started to fail raising the error:
OLE Automation Error Information
HRESULT: 0x800c0005
I... more >>
object auditing.
Posted by jose g. de jesus jr mcp, mcdba at 7/27/2005 8:24:03 AM
I would like to know when my table schema was last changed or modified.
unfortunately the company was not running a c2 audit nor sql profiler trace.
Is there a way for me to know when was the object last schema change.... more >>
Generate SQLscript for db?
Posted by Test Test at 7/27/2005 8:13:58 AM
Due to the large size db, I need to generate a SQL script and keep it in
VSS. The script should contain all create objctes statemnts. Using
'Generate SQL Script' in the Enterprise Manager by right clicking the db
is not helping. What I am missing here?
Thanks!
*** Sent via Developers... more >>
Backup Failed to complete command SP_EXECUTESQL;1
Posted by marc quirion at 7/27/2005 7:30:49 AM
hi,
in my event log I have the alarm Backup failed to complete command
sp_executesql;1
The point is that I didn't find any scheduled backup jobs and I didn't find
any *.bak file relative to the DB mentioned in the alarm. (I can see the DB
file name in the text window at the bottom of t... more >>
debug a SELECT query and using variable as column name
Posted by Oren101 at 7/27/2005 6:56:03 AM
i have 2 questions:
1. is there any way to watch the a SELECT as it running? i mean to c how it
acts for each value that it meets and how it ignores each value that not
contains in the 'where' clause
2. im trying to run a select query with variable on a COLUMN name for
example :
declare... more >>
Select Top @Variable * from table
Posted by Debbie at 7/27/2005 6:53:53 AM
I'm wondering if its possible to have a stored procedure that uses a
variable as the "Top" number.
ex. Select Top @Integer * from table
*** Sent via Developersdex http://www.developersdex.com ***... more >>
raiserror in trigger
Posted by IT at 7/27/2005 6:45:04 AM
I am looking for a solution to return control from a fired trigger to a store
procedure. In case of error the trigger has ROLLBACK TRAN and RAISERROR and
entire batch is terminated.
The store proc has insert within transaction:
Begin Tran
Insert Into customers(Lastname) values ('SMITH'... more >>
SP produces erroneous results? What am I doing wrong here?
Posted by Roy at 7/27/2005 6:21:57 AM
The title is fairly self-explanatory, but basically, here's the SP in
question. Let's say a user on the front-end enters in the @sdate and
@Shipper parameter, leaving the others blank. Let's say an @sdate of
'01-16-2005' and a @Shipper of 'BLAH.' The results that come back show a
varying number ... more >>
Retrieving data from a plain file
Posted by Enric at 7/27/2005 4:50:01 AM
Dear all,
I'd need to retrieve data from a text file located in a folder from a SELECT
statement. How could I do such thing? Is it possible obtain all the data and
then show them on the screen or better, import them to a SQL table??
Best regards,
Enric... more >>
Loop...
Posted by Tim::.. at 7/27/2005 3:59:01 AM
Can someone please tell me if it is possible to create variables dynamically
or with the use of a loop and if so how...
I have the following SQL statement and would like to cut down the number of
variables by using some kind of loop to generate the variables and update
statement!
Thanks.... more >>
update number accuracy
Posted by Einav at 7/27/2005 3:46:11 AM
Hi!
I have a table set with fields of numbers with 8 digits precision. I want to
change the accuracy of those fields to only 4 digits precision so that I will
be able to group all the rows that have the same value in these fields. How
can I do this?
thanks,
Einav... more >>
RAISERROR in Access project dont display message
Posted by Alexs at 7/27/2005 3:15:01 AM
CREATE PROCEDURE sp_test
AS
RAISERROR ( ' Hello!', 16, 1)
GO
----
SQL query 'EXEC sp_test' from Access database (mdb file) returns 'Hello!' in
popup window (ODBC Call).
The same from Access project - nothing. Please help!
MSDE2000sp3, Access2003, Win2003 (all updates installed)
... more >>
ASP Programming Question (build a calendar and connect with SQL Se
Posted by seowhua at 7/27/2005 2:12:05 AM
Hi anyone,
I wish to build an ASP calendar table and when I click on the calendar
specific date, it will automatically add the date into the SQL Server table.
The table must be in Year, month and date
--
regards seowhua... more >>
Ghost inside a loop
Posted by Enric at 7/27/2005 2:07:01 AM
Dear all,
There's a ghost inside the loop below posted.
It's a very strange behaviour although it could be due to I am out of order.
Never the field n_id own 4800 as value and besides of that, the rowcount is
lost if you compare the value of that field with the value showed to the left
... more >>
Difficult Insert where clause.
Posted by Stephen at 7/27/2005 12:45:02 AM
Sorry for anyone who has seen this query and dataset before but this is a
seperate question/issue which I am working on.
I am struggling trying to get my insert statement not to insert record 5
because the ToURN has been used before in a previous record(1).
Basically I am trying to write... more >>
Nested sets in SQL - inventor?
Posted by Appeo Allkam at 7/27/2005 12:00:00 AM
Who invented the nested sets algorithm for SQL? Was it Kamfonas or Celko?
The algorithms are so similar that clearly Celko must have copied from
Kamfonas, or Kamfonas from Celko .. or both from someone else.
(If you don't know what I'm on about, it's this:
http://www.dbpd.com/vault/98... more >>
Using SP with parameter = '' or NULL ?
Posted by Vladimir Sim at 7/27/2005 12:00:00 AM
Hi,
Why is it that SP passing in parameter of '' end up with LEN() giving 1
in the SP when it is empty('') string ?
For example, my sample SP
Create store procedure Test(@para1 char(10), @para2 char(10))
as begin
if len(@para1) > 0 <<===== why this if condition is true when I v... more >>
Debug sp in Query Analyzer
Posted by Atenza at 7/27/2005 12:00:00 AM
Hi all,
Is it possible to debug sp in client workstation by using sql query
analyzer? how?
It's only work to me when debug sp in the SQL server by using sql query
analyzer
Thanks in advance!!
Martin
... more >>
SQL 2005 recursive XML scalar function error
Posted by Joe at 7/27/2005 12:00:00 AM
First off. I am impressed with the new XML functionality and SQL 2005 in
general. It's truly what I have been waiting for.
As a partner we received the SQL 2005 CTP and I immediately started to
address an issue I had with SQL 2000 using SQLXML and that is nested
elements..
So what I did wa... more >>
sp_getapplock
Posted by Leila at 7/27/2005 12:00:00 AM
Hi,
What does this SP do? What is locked using this kind of locking?
Thanks,
Leila
... more >>
sp_getapplock
Posted by Leila at 7/27/2005 12:00:00 AM
Hi,
What does this SP do? What is locked using this kind of locking?
Thanks,
Leila
... more >>
SQL server runs a subquery even when it's not necessary.
Posted by Peter Strøiman at 7/27/2005 12:00:00 AM
Hi.
This is a problem I have with SQL Server 2005 CTP, but I assume it must be
applicable to SQL Server 2000 as well as it is quite ordinary SQL.
I have a query that has a subquery in it's where clause. The thing is that
the subquery is only necesary under certain conditions. I have a bit
... more >>
|