all groups > sql server programming > october 2007 > threads for friday october 19
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
A Microsot Bug in Dynamic Comlumns?
Posted by valentin tihomirov at 10/19/2007 6:37:36 PM
Hello,
-=PREHISTORY=-
Occasionally, I wanted to rewrite my UPDATE code to prevent SQL injection. I
generated the SQL query
UPDATE tt
SET
@p1_name = @p1_val
, @p2_name = @p2_val
, ...
along with the pairs of paramz:
new SqlPara... more >>
NOCOUNT not functioning
Posted by marc.l.caron NO[at]SPAM gmail.com at 10/19/2007 5:27:39 PM
Yes SET NOCOUNT is very simplistic but I seem to have a weird issue I
can't resolve with it.
The scenario.
I have a function dbo.StringArray_To_Table that takes an array of
strings and returns a table.
I select this new table into a cursor inside of a procedure.
The procedure uses the table ... more >>
doing a matrix in SQL
Posted by at 10/19/2007 5:20:26 PM
I'm sort of new to advanced type SQL stuff.
Here is my problem, I want to do a matrix and I am calling SQL
from a high level language, so I have some flexibility.
At any rate, I have a bunch of user in the assignto field of each
record.
Each record also has a status. Status can be 'new,'assig... more >>
TSQL Sorting Problem
Posted by brandon at 10/19/2007 5:19:25 PM
I am trying to pass @sort as a parameter to the stored procedure. It
doesn't seem to work. Whats wrong with this query syntax. Please
advise.
ALTER PROCEDURE dbo.GetLateRegistrationByEventId
@EventId int,
@sort varchar(36)
WITH RECOMPILE
AS
BEGIN
SELECT a.Club, a.FirstName, a.LastName, a.... more >>
set @sql needs to run a join of 2 tables inside
Posted by TG at 10/19/2007 3:10:32 PM
hi!
Im running the folowing code to loop through all the databases and
insert the results in a temp table.
In this case I need to run a join within a @sql string, but it does
not work.
Any ideas on how I can achieve this?
Here is my code:
if exists (select [id] from master..syso... more >>
Rounding numeric data type
Posted by Homerggg at 10/19/2007 1:56:00 PM
We face a problem where the result is not the same between SQL Server 2000
and SQL Server 2005 (we just update last month or so).
We trimmed down the problem to this simple query.
---------
CREATE TABLE T1
(
N1 NUMERIC(10,2)
)
INSERT INTO T1 (N1) VALUES(12.59)
DECLARE @numTemp ... more >>
Need help to figure this out
Posted by Jack at 10/19/2007 1:39:00 PM
I am having a problem which can be simulated in the following:
There is a table named client containing two rows and a table named company
which has client and company information.This table has seven rows of data.
A client can be associated with one or more company.
Now I need to build a p... more >>
the many part separated by dash
Posted by Ali at 10/19/2007 1:38:45 PM
Hi,
I have 2 tables. the relationship between them is one to many. now I
want to show the many Table values, as a value of the first Table
separated by a character just like a column value.
thank you very much,
Ali
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Multiple rows combined into onerow and onecolumn separated by a special character
Posted by thetaamommy NO[at]SPAM gmail.com at 10/19/2007 1:22:14 PM
Hi All :
CREATE TABLE TABLEA(Person Varchar(20), Country Varchar(20), Subject
Varchar(20), Type Char(1))
INSERT INTO TABLEA VALUES ('Einstein', 'Germany', 'Physics', 'P')
INSERT INTO TABLEA VALUES ('Kant', 'Germany', 'Philosophy', 'Q')
INSERT INTO TABLEA VALUES ('Kafka', 'Germany', 'Write... more >>
MIN() Across Multiple Columns?
Posted by Bruce at 10/19/2007 1:11:30 PM
Hello.
Is it possible to find the lowest price across multiple column on the same
record?
Table Products
Name Price Cost1 Cost2 Cost3
Wallet 99.00 68.75 60.25 65.00
Comb 12.00 5.50 6.85 7.00
Is it possible to get the lowest cost
select Name,Price,... more >>
how cancel action from inside a trigger?
Posted by Alex Castillo at 10/19/2007 11:20:36 AM
Hello...
Using MS SQL 2000...
Which statement should I use to cancel the attempt of Insert/Delete/Update?
I would like to disallow users/developers to delete records on some special
conditions using code on the Delete trigger of the table.
Thanks.
... more >>
Problem with cascading deletes on Many-to-Many tables
Posted by moondaddy at 10/19/2007 11:16:53 AM
Using sql 2005:
When ever I have a many-to-many (MM) table in-between 2 other tables, I want
cascading deletes going from both outer tables to the MM table. It doesn't
make since to have a MM table or a mapping table to have orphaned rows of
data.
I'm able to create the first cascading ... more >>
SQL 2005 - XML Data Type column performance optimization
Posted by Hetal at 10/19/2007 11:15:01 AM
Introduction
We are re-designing our existing database application. The application
currently contains functionality to manage dynamic data for different
clients. The data is very large(7 million records)
Existing solution
It has the capability to directly query columns to retrieve data.
... more >>
Increment ID in INSERT
Posted by David C at 10/19/2007 11:03:32 AM
I have an INSERT that I need to get a number that is one higher than the
previous inserted record and my SQL code does not work. See reference to
getting VendorID in SQL below. How can I resolve this as the VendorID is a
unique key but is not an IDENTITY. Thanks.
David
INSERT INTO mars... more >>
Export query results
Posted by doug at 10/19/2007 10:25:01 AM
I have a query returning the data I need, however, i want to export my
results to a delimited file. I am using a pipe as my delimiter. How do i
export my records without a header record? I do not need to see the column
names and how do I elimate the spaces between my data and the pipe?
... more >>
how do you declare and use arrays in sql server 2000 SP
Posted by tdr at 10/19/2007 10:23:00 AM
I have 3 fields that repeat 20 time.
I need to read several recorda and look at 60 field ( 20 each)
combine the data from the records until the member changes then write the
record.
it would be easier if I could use arrays in SQL , not sure how.
I dont see any examples and the way that I wr... more >>
CREATE TABLE date
Posted by BLAW at 10/19/2007 10:10:11 AM
How can I create a new sql table, with the first column being Month,
already formatted to insert the current month as a new entry each
month in the format of Nov-07? should it be of a date format or CHAR?
... more >>
2005 Partitioning - obtain file group name for minimum range value
Posted by John Bonin at 10/19/2007 9:38:01 AM
I am trying to get the file group name for the mimimum value in my range.
This query gets the minimum file group, but that is based on the min()
function,
and if I am using a round robin method of reusing static file groups 1- 100,
it
will always get file group 1.
I always want the file... more >>
Irregular behavior of @@fetch_status
Posted by SMAZ at 10/19/2007 9:09:00 AM
Hi all,
I am new to this forum and need help!
My web application is calling and retrieves data using stored procedure
according to the parameters passed into it.
The issue is that sp return data 1st time for the given parameter but not
for 2nd time.
I debugged noticed that @@Fetch_Status... more >>
how to add new artical in transactional replication
Posted by Farhan Iqbal at 10/19/2007 7:23:01 AM
hi,
I have implemented the Transactional Replication on SQL Server 2005. Its
working fine, I have created one new table on my publisher machine and I want
to replicate this new table as well. Can anyone please guide me the steps to
do this smoothly.
Thanks
... more >>
Calling stored procedure (with cursor) from c#
Posted by codefragment NO[at]SPAM googlemail.com at 10/19/2007 6:16:50 AM
Hi
As the subject says, I just want to call a stored procedure with a
few arguments. I can seem
to call it ok if it only takes 1 argument and returns a cursor but as
soon as I try to add parameters I get erros
My connection string loooks like this:
Provider=OraOLEDB.Oracle;Data Source=OR... more >>
Create date range with one select
Posted by Stephane at 10/19/2007 5:57:00 AM
Hi,
Is there a way to create a range of dates with one query?
i.e. I want to, let's say, select all days between oct 10 and oct 20. So I
would have oct 10, oct 11 and so on. For example, I would like to insert a
range of days into a table.
Any idea?
Thanks
Stephane... more >>
SQL idiom
Posted by francis.moore NO[at]SPAM gmail.com at 10/19/2007 4:28:18 AM
Hi,
What's the SQL idiom for returning a distinct value for a single
column but also displaying other columns from within the same table.
For example:
create table table1
(
col1 varchar(5) null,
col2 varchar(10) null
)
insert into table1 (col1, col2) values ('abcde', 'Monday')
inse... more >>
Merging 2 views into 1 view
Posted by Jean at 10/19/2007 1:33:43 AM
Hi,
I have 2 views. Firstly:
CREATE VIEW [dbo].[ExchangeRate]
AS
SELECT dbo.Currency.ISOCode, dbo.CurrencyExchangeRate.Rate
FROM dbo.Currency INNER JOIN
dbo.CurrencyExchangeRate ON dbo.Currency.CurrencyID =
dbo.CurrencyExchangeRate.CurrencyID^
GO
Then, I have the next on... more >>
Checking for AD rights in a Stored Procedure
Posted by Henrik Skak Pedersen at 10/19/2007 12:28:10 AM
We have a stored procedure which should return different rows depending on
which AD groups you are a member of. Do you have any idea of how to check for
AD rights in a stored procedure?
I would like to use something like WindowsPrincipal.IsInRole from th stored
procedure. Clr in the databas... more >>
Database naming conventions
Posted by Pablo Roca at 10/19/2007 12:00:00 AM
Hi,
Now with my move from FoxPro to SQL server I am thinking in standarize more
the database naming conventions. I searched and I don't find a common naming
conventions, neither an official snatdard (ANSI, or whatever). Everyone
applies his own naming conventions.
With SQL Server 2005 in... more >>
return value from linked server exec sp
Posted by Piotr Lipski at 10/19/2007 12:00:00 AM
Hi.
I am trying to write a code that will execute xp_fixeddrives on several
linked servers and store results locally.
I've configured linked servers and they seem to work fine. For example:
EXEC [retailsvr].[master]..[xp_fixeddrives]
returns:
drive MB free
C 16903
(1 row(s) affec... more >>
Run a VBscript before the DTS package
Posted by pvong at 10/19/2007 12:00:00 AM
I'm using SQL2000.
I have a DTS package set up as a Job. I want to run a vbscript before it
runs the DTS package. I have the order set up correctly, but I can not
launch the vbscript.
This is my setup for this step:
Type: Operating System Command (CmdExec)
Command: D:\ServerFiles\Croft... more >>
|