all groups > sql server programming > september 2005 > threads for monday september 5
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
SQL Transaction Problem and Foreign Keys
Posted by Davie at 9/5/2005 9:38:18 PM
I've got a transaction problem which involves foreign keys.
Table Product_Category
-----------------------
cat_id PK
name
Table Product
----------------
prod_id PK
cat_id FK
Basically i have two tables, i wish to add the category and product at the
same time in a transaction.
con... more >>
PLease help!
Posted by Scott at 9/5/2005 8:46:25 PM
Hi All,
I want a query that lists the records in this format.
Month LId Count of Counter
for each LId
The input for this query is going to be the LId and Date Range.
(for eg.. 08/01/05 to 09/01/05). The schema is attached below.
The Month is date interval that corre... more >>
sorry for the dumb question, but...
Posted by Paul Pedersen at 9/5/2005 5:30:31 PM
I know there has to be a simple explanation, but transferring my SQL skills
from FoxPro to MSSQL doesn't always go smoothly. For instance, this, an
equivalent of which seems to work fine in FoxPro:
use northwind
select customerid, datepart(year, orderdate) as ordyear, sum(freight) from
o... more >>
Stored Procedure Generator .NET?
Posted by jpuopolo NO[at]SPAM mvisiontechnology.com at 9/5/2005 4:52:43 PM
All:
Is there a recommended tool to generate C# or VB.NET (.NET 1.1) code to
call exisiting SQL Server (2000 or better) stored procedures?
I wrote one a few years ago for Oracle and figured one would exist for
SQL Server. I have found:
AutoSproc (MSND)
SPGen (Code Project)
SP/Invoke (Co... more >>
Query to combine values from three fields into one recordset
Posted by Raul at 9/5/2005 4:41:02 PM
I need to create a list (one column) of distinct values from three fields in
a table (LOT_ID, ID_BLENDED_WITH_1, ID_BLENDED_WITH_2). I have included DDL
and sample data just in case.
I want to be able to query LOT_PROD with something like:
SELECT DISTINCT ID_LOT, ID_BLENDED_WITH_1, ID_BLE... more >>
Newbie: Select Top N - what next?
Posted by MaD Matt at 9/5/2005 4:31:50 PM
I've Just started using MS SQL 2000 with MS Access 2000. I can select
the first 10 products like this :-
SELECT top 10 dbo_products.ProductName
FROM dbo_Product
ORDER BY dbo_Product.ProductName DESC;
But when the user wants the next 10, products 11-20 and then maybe
products 21-30. How do... more >>
How to design link tables?
Posted by Siegfried Heintze at 9/5/2005 2:43:45 PM
I have been having a similar discussion on the MS Access newsgroup for the
last week and I wanted to discuss the issues in the context of MS SQL in
addition to MS Access. I hope this form of cross posting is not offensive to
anyone.
Lets assume I have to relations: student and course and I wan... more >>
Date range!
Posted by Damon at 9/5/2005 2:07:01 PM
Hi,
I would like to only bring back results in my database where the app_date is
less than six years old. Any ideas on how I can do this?
Appreciate the help.
Damon
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Database Design
Posted by HiMex at 9/5/2005 12:54:24 PM
Hi
I=B4m a mexican SQL Server DBA and I would like telecommute, I can help
you on database designs my rates are just $10.00 per hour
thanks
... more >>
Testing for #Temp Tables
Posted by Stephen K. Miyasato at 9/5/2005 11:52:31 AM
How does one test for #temp tables in the database. I tried the following:
if exists (select * from dbo.sysobjects where id =
object_id(N'dbo].[#tempVS2]')
and OBJECTPROPERTY(id, N'IsUserTable') = 1)
--if OBJECT_ID('#tempVS2')is NOT NULL
DROP Table #tempVS2
GO
CREATE TABLE [#tempVS2] (... more >>
Help required to loop at table
Posted by corr at 9/5/2005 10:37:33 AM
Hi,
I have a file loaded into a table as follows
Table 1
C1 C2 C3 C4
1 Header
2 LREF A001
3 LN Mr Smith
4 LA Street1 Town
5 LREF A002
6 LN Mr Jones
7 LA Street2 Town
What I nee... more >>
Stored Procedure Definition Question
Posted by jsock1 NO[at]SPAM gmail.com at 9/5/2005 7:36:03 AM
Hi, wonder if anyone can help with the following:
I need to get the information regarding the parameters (both input and
output) accepted by a stored procedure and details of any resultsets
returned by it.
I can get the former by running sp_sproc_columns (or writing my own
query against the... more >>
access result of "dynamic sql query" via transact sql
Posted by steph at 9/5/2005 5:49:43 AM
He,
want i want to do ist creating a dynamic query, execute it and access
the result via transact-sql.
e.g. SELECT * FROM udf_buildquery 'param1' .. WHERE ..
The first thing i tried was to use dynamic sql in udf's, but i realised
very fast, that this wont work.
After that I tried to build ... more >>
Dynamic use of "inserted" and "deleted" in a trigger
Posted by Per Buus Sørensen at 9/5/2005 4:29:02 AM
Hello,
Is it posiple to user "inserted" and "deleted" in dynamic SQL in a trigger?
I get an "invalid object name" with these statement.
set @sqlcmd = 'insert mydatabase.dbo.mytable select * from inserted'
EXEC sp_executesql @sqlcmd
Any other suggestions?
Thanks!
Per
... more >>
performing completion actions job status
Posted by George at 9/5/2005 2:37:24 AM
Hi,
I have a job that has three steps which does the job but ends up with this
status and stop job does not help.
How can I find out the spid of the job? to kill it
Here are the actual steps
1)
exec servername.master.dbo.op_backupUSB 'pdl'
where the stored procedure is
CREATE procedu... more >>
Get tablename in trigger
Posted by Per Buus Sørensen at 9/5/2005 12:56:03 AM
Hello,
I have a general trigger program used for many tables, but how do I refer to
the tablename currently been modified in my script?
Thanks!
Per
... more >>
Recovery deleted row
Posted by Joe at 9/5/2005 12:41:01 AM
Dear all,
if i delete a row in a table accidently , how can i recover that rows
in case 1: just delete it a few second before
in case 2: delete it and add several rows after deleted rows... more >>
Keeping the 10 newest records... in each GROUP ?
Posted by \ at 9/5/2005 12:34:43 AM
Ok, I give up.
I need to GROUP BY state... keep the newest 10 records in each state...
then delete all other records.
(Why do the simplest *SOUNDING* queries... always stump me?)
CREATE TABLE MyTable
(
MyKey Int
IDENTITY(1,1) PRIMARY KEY,
... more >>
Table in Stored. Proc.
Posted by DNKMCA at 9/5/2005 12:00:00 AM
Hi,
Is it possible to pass the table name as parameter in Stored Proc.
If possible how to do this?
thanks in advance.
-DNK
... more >>
advance TSQL programming (with optimization) training
Posted by Aramid at 9/5/2005 12:00:00 AM
Hi Everyone,
Sorry for this post, but I am not sure where to post this:
I would like to know if anyone has any idea on a good training center
in the Asia-Pacific Region for Advanced TSQL programming (SQL 2000)
that primarily focuses on optimization. The target audience are
Senior Developer... more >>
sorting Sp
Posted by ichor at 9/5/2005 12:00:00 AM
hi i would like to sort the results of an SP. how do i do that w/o using the
order by clause in the SP?
because this SP is accessed by other users as well it already sorts on one
column. is there any way that i can do
select * from
(exec dbo.p)as a order by 1.
so that i dont alter the te... more >>
Aggregate function among columns
Posted by Han at 9/5/2005 12:00:00 AM
Dear
How can I use aggregate function or something like that among columns? e.g.,
columnA, columnB
set @varC=something
I would like to compare the three values and select max or min value.
Something like,
select max(columnA, columnB, @varC) from Table
DDL
-----------------------... more >>
|