all groups > sql server programming > november 2006 > threads for monday november 6
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
How to pass resultset as param to SP
Posted by moondaddy at 11/6/2006 11:53:07 PM
from a trigger I want to pass all of the ID values from the deleted table or
inserted table to another stored procedure for additional processing.
for example, if I use this select statement:
SELECT ID from inserted
I would get
ID
--
1
2
3
4
I want to pass these into an sp to use... more >>
SELECT from list
Posted by spitapps at 11/6/2006 11:44:23 PM
I need to create a stored procedure that takes a list of product
numbers(541, 456, CE6050,...) and selects only the customers that have
all product numbers in the list. I have a product table that has the
following schema:
rowid numeric(18,0),
productNumber numeric(5,0),
customerNumber n... more >>
Need Help Please!
Posted by Ruby Nadler at 11/6/2006 9:53:02 PM
Hi everyone,
i have to problems since i upgraded to sql 2005:
1)
My backup routin of my sql 2005 contains full (once a week),diff (once a
day) and log (every 20 min) backups.
because i have 3 fulltext catalogs in my db and i dont want to backup them
(due to space problem) i want to backup on... more >>
sp resultset to table
Posted by joejosephmul NO[at]SPAM gmail.com at 11/6/2006 9:02:54 PM
Hello I have a sp where the last statement is a "select * from...."
Now can I capture this resultset that is returned , into a table ?
(without modifying the sp itself)
Something like this ? (this obviously does not work :) )
select into #ttt exec mod_pos_fx_r :) Regards Joe
... more >>
Development Tools
Posted by rafialim at 11/6/2006 7:09:01 PM
My team (2 of us) are in the process of revamping our current computerize
system f(i.e. quite old and frustrated). We were thinking of using SQL Server
as a database. We would like to get some general idea on what to use as a
front-end to develop our new system; whether to use Visual FoxPro 9.... more >>
Script out multiple jobs to files (Question?)
Posted by Matthew at 11/6/2006 6:33:17 PM
In management studios, is there a way to script out multiple jobs at
the same time, but place each job in a different file?
Can this also be done with stored procedures and other database
objects?
Thanks
-Matt-
... more >>
Stored Procedure Question.
Posted by Manny at 11/6/2006 6:25:21 PM
Hi there,
I have been trying to develop this sproc for awhile and this is what I'm
trying to accomplish;
what I'm doing is pulling sales data from the sales table, trying to pull
let's say today's data with a parameter date and then pulling data from a
year ago from the first date parame... more >>
Error with sp_send_dbmail.
Posted by RJ_Murray at 11/6/2006 6:06:01 PM
Hi All,
I can not get sp_send_dbmail to send more than one attachment at a time
without throwing an error that the second file name is invalid! Following is
the parameter statement. I can send one attachment with no problem, but not
more than one! Any help would be greatly apprecated...
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
tables dependency
Posted by Deumber at 11/6/2006 5:22:50 PM
How can i know if a dependency is ON DELETED CASCADE or ON UPDATE CASCADE????
From http://www.developmentnow.com/g/113_2004_7_0_5_0/sql-server-programming.htm
Posted via DevelopmentNow.com Groups
http://www.developmentnow.com... more >>
How to order by lastname
Posted by zwieback89 via SQLMonster.com at 11/6/2006 4:09:01 PM
Hi,
I am working with this query -
SELECT DISTINCT A.Member_Manager,
A.Member_Subordinate,
A.Owner_DateOfPost, Employee.EmpID,
Employee.FirstName + ' ' + Employee.LastName AS Emp_Name
FROM A INNER JOIN Employee ON
A.Member_Subordinate = Employee.UniqueIdentifier
WHERE A.Member_Manager ... more >>
Server is growing the swap file way to large now.
Posted by SRussell at 11/6/2006 4:00:03 PM
Win2000 Server with 3 gig of ram. Swap file has potential for 9 gig. I
know !!!!
Is there a way to circumvent the ram usage back to conventional ram?
I'd add the /3 gig boot ini switch also for the next reboot.
Any other ideas?
__Stephen
... more >>
Best practices for passing parameters to a 2005 stored procedure?
Posted by JT at 11/6/2006 2:45:02 PM
In the past, I've used XML to pass a large number of variable sized
parameters to SQL 2K stored procedures (search procedures, generally).
Is there anything new in SQL 2K5 that makes this approach obsolete?
We were considering using UDTs as the parameter containers, but I haven't
seen ... more >>
Item cannot be found in the collection corresponding to the reques
Posted by Rockitman at 11/6/2006 2:41:02 PM
Used to have a SQL 7.0 server running on Windows 2000 Server and former
programmer made a client app to access a database in it.
We have just migrated to a new box running Server 2003 and have installed
SQL 2000 on it. I copied the database and user logins over successfully.
Client app ... more >>
Please explain this Unicode behavior
Posted by Adam Patrick Cassidy at 11/6/2006 2:21:17 PM
I was having problems with an application Friday that has been running for
years without problem and over the weekend noticed the following:
When I run a sample query such as:
SELECT ID, FirstName, LastName, Zip
FROM Table1
WHERE Email = N'MyEmail@MyEmailCompany.com'
AND Password =... more >>
Help with selecting non-primary contacts
Posted by rlueneberg NO[at]SPAM gmail.com at 11/6/2006 2:16:11 PM
I need to find all contacts where IsPrimary is "F" in order to set at
least one = 'T'. Look the example below:
AccountID ContactID IsPrimary
AccountX contact 1 F
AccountX contact 2 F
AccountX contact 3 F
AccountX contact 4 F
AccountX contact 5 F
AccountY contact7 F
AccountY ... more >>
How convert NULL to empty string in select statement?
Posted by ChrisB at 11/6/2006 1:39:37 PM
Hello:
I was wondering, given the following select statement is there an easy was
to return an empty string for the FirstName field if the value is NULL? I'm
not quite sure of the necessary syntax:
// If FirstName IS NULL, FirstName should = ''
SELECT FirstName, Age, State FROM Customers... more >>
Performing a Double-Redundant Insert based on conditions.
Posted by The Toddibear at 11/6/2006 1:10:03 PM
SQL DOUBLE INSERT ISSUE:
Okay, I'm a pretty good script kitty, and this one is causing me no end of
consernation. I know the best and brightest of MS SQL are on this forum, and
I am hoping someone with more talent than I can look at this problem and give
me a better solution. I am trying ... more >>
Truncate table without db_owner permission
Posted by abedon at 11/6/2006 12:12:02 PM
Hi guys,
I need to clear a table containing over 10,000,000 rows in production
environment(SQL Server 2000) every 10 to 20 minutes and DBA would not give us
db_owner or higher permission. I am wondering if there is another way to
truncate the table in this case?
Any reply is appreciated.... more >>
Temp Table and Dynamic SQL
Posted by Esha at 11/6/2006 11:54:03 AM
I'd like to write a stored procedure which creates Temp tables, populate
them with some data from database tables and finally select data from both
database tables and Temp tables.
I started from a very simple statements like these:
SELECT TOP 10 n = IDENTITY(INT, 1, 1) INTO #Num FROM syscom... more >>
Standby server recovery problem
Posted by Rodger at 11/6/2006 11:52:02 AM
HI I have a primary server and a standby server, the primary server is backed
up every night and restored on the standby server . then sequential log
backups are applied on the standby server. last night after the full backup
the server crashed and when the server came back up again i applied... more >>
Symmetric Database Encryption
Posted by shil at 11/6/2006 11:36:40 AM
Is there any cookbook that explains step by step procedure about
setting up symmetric database encryption in SQL 2005?
I'm planning to build a vb.net windows app that calls the encrypted
database. Data must be sent to VB App in encrypted format and the App
should decrypt it. When this applicat... more >>
last records
Posted by vincent at 11/6/2006 11:23:01 AM
hello,
what i'm trying to accomplish is to return only the most recent record(date
field).
Table1
code date balance
111 20061020 100
111 20061021 95
111 20061023 75
112 20061021 95
112 20061022 110
but i need to return
code date balance
111 20061... more >>
Combine results from multiple queries into one
Posted by aamir69 NO[at]SPAM gmail.com at 11/6/2006 11:08:18 AM
I have three different queries which goes after three different tables
to grab data. I want to combine results from all three queries into
one table. I can't use UNION because each query returns different
number of columns. Is there an option on SQL server to achieve this?
Thank you,
Aamir... more >>
clean phone field
Posted by JFB at 11/6/2006 10:51:33 AM
Hi All,
I want to clean a phone field with different formats to keep only numbers
like 702777777
Formats that I have:
(702) 777-7777
[1] (702) 777-7777
702-777-7777
702.777.7777
How can I do this?
Rgds
Tks
JFB
... more >>
SQL Indexing error
Posted by Rahul Chatterjee at 11/6/2006 10:33:33 AM
Hello All
I was performing some tests on SQL Server and I deleted an index from the
sysindexes table. I had earlier modified the SQL server properties to allow
updates set to 1 via using the sp_configure stored procedure.
Then I went into sysindexes and dropped an index. Now I get an erro... more >>
Date Field
Posted by Chris at 11/6/2006 9:41:01 AM
Hi,
What's the best format (widely used format) to store date? Is it 2006-01-01
or 01/01/2006.
Thanks... more >>
Scheduled backups?
Posted by mikeyatsony at 11/6/2006 9:12:59 AM
hi all..
i just created a backup for a database and added a schedule to have it
backup every day at a certain time. now i would like to go and modify
the time of that daily schedule. but i don't know how to get to the
schedule. i'm using sql server 2000 and enterprise manager.
where do i g... more >>
Using Function in Where clause
Posted by Michael Vlk at 11/6/2006 9:00:01 AM
I have a simple function that parses a string and returns a table based on a
delimeter give. I.e. dbo.fn_ParseStringToTable ( 'C;D', ';' ) will return a
table with one field called Item of two rows ( C and D ).
This works great. My problem comes when I try to use this within a larger
proces... more >>
Indexing Advice
Posted by FARRUKH at 11/6/2006 8:14:02 AM
we have a table called 'INVENTORY_HISTORY' and there are 1386937 records.
When I run select statement, it takes 1min to bring all records. So, I run
DBCC SHOWCONTIG ('INVENTORY_HISTORY') and then Rebuild the index
DBCC DBREINDEX ('INVENTORY_HISTORY') but still taking 1 min to bring the
record... more >>
Update statement reindexing database
Posted by Stephane at 11/6/2006 8:00:02 AM
Hi,
I have a weird problem. When I run a simple update statement, which is
updating a single row, it triggers the reindexing of all the database.
Here's the statement:
update tbl_users
set companyName = 'None',
name = 'Steph',
password = 'pass',
email = 'mail@mail.com',
fk_tbl_... more >>
check disk space
Posted by Kevin at 11/6/2006 7:52:02 AM
hi all,
I know xp_fixeddrive proc will return what are the free disk spaces are
available for each drive, but how do I check total disk space (including
used space) using Sql Server?
... more >>
Trigger working on SQL Server 2000 but not on SQL Server 2005
Posted by Jas at 11/6/2006 7:29:02 AM
Hi, we have a tigger that is currently working in SQL Server 2000 but not in
SQL Server 2005. If we run it manually in the query it's working.
Does anyone had the same problem?
If someone knows it will be greatly appreciated!!!
Thanks in advance!... more >>
SQL Help for a novice
Posted by vvenk at 11/6/2006 7:29:02 AM
Hello:
I have two tables:
TABLE A_B
(
A_ID char(18) NOT NULL ,
B_ID char(18) NOT NULL ,
CONSTRAINT XPKA_B PRIMARY KEY NONCLUSTERED (A_ID ASC,B_ID ASC)
)
TABLE C
(
A_ID char(18) NOT NULL ,
B_ID char(18) NOT NULL ,
CONSTRAINT XPKC PRIMARY KEY NONCLUSTERED (A_I... more >>
Update a column in top 100 rows in a table
Posted by Rajeev at 11/6/2006 7:27:22 AM
Hi,
I have a table which has a column processcd.
Is it possible to update the processcd to say 'Y' from 'N' in top 100
rows of that table.
Regards,
Rajeev
... more >>
How to ignore a MSDTC error to stop job from failing
Posted by James at 11/6/2006 6:46:01 AM
Hi,
I have a simple cursor, which loops through a list of SQL servers. It then
fires of a stored procedure which remotely grabs the server drive space
(xp_fixed drives) and inserts the values into a table (on the monitoring box)
for analysis. I run this as a job on a daily basis, however, I am... more >>
Must declare the variable @user_action Error
Posted by MikeyFunk at 11/6/2006 5:18:08 AM
CREATE TRIGGER [folder_test] ON [dbo].[collection1]
FOR UPDATE
AS
IF UPDATE (name)
BEGIN
DECLARE @id_value int
DECLARE @newvalue varchar(64)
DECLARE @datenow datetime
DECLARE @database varchar(64)
DECLARE @irole varchar(64)
DECLARE @user_action int
BEGIN
SET @database = 'AB... more >>
what is the use of uniqueidentifier datatype
Posted by vipin at 11/6/2006 2:07:02 AM
hi,
can any body give me defination about this datatype.
... more >>
Release locks within a transaction
Posted by McGeeky at 11/6/2006 12:00:00 AM
Hi. We have several long running queries that lock out some core tables for
the length of the query - which causes problems for another process that
wants to update those tables. Is it possible for the long running queries to
be rewritten such that they will select the rows from the core table... more >>
recursion when parent and child datatype is varchar
Posted by vsvinuraj via SQLMonster.com at 11/6/2006 12:00:00 AM
Hi,
i have an intresting problem.
I have a to get the hierarchichal data from table when the parent and child
datatype is varchar.
Below givenis the table structure.
Please help meou in this.
Col Name DataType Comouted Lenght
--------------------------------... more >>
Attaching DB & Security
Posted by Leila at 11/6/2006 12:00:00 AM
Hi,
I want to prevent others from attaching my database, is it possible? Imagine
that the administrator at customer's office stops SQL Server Service and
copies our DB. How can I protect it?
Any help is appreciated.
Leila
... more >>
|