all groups > sql server programming > september 2004 > threads for monday september 20
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
All stored procedures...
Posted by Marius Ropotică at 9/20/2004 11:43:10 PM
Hi,
I want to delete all the stored procedures from a database, but not the
system procs. How can I do this?
SELECT * FROM sysobjects WHERE xtype = 'P' gives all the stored procedures.
Thanks,
Marius Ropotica... more >>
query
Posted by EM at 9/20/2004 11:31:27 PM
Hallo to all
I try to run a query from two tabels from one DB with an other table from an
other DB . I would like to get in the result from VnetuserConfig.dbo.site
the colum
NAME.
here my query:
SELECT
JobId,DictatorId,DateTransCompleted,Length,TranscriptionistId,DictatorSite
FROM ... more >>
Is there record set solution for this?
Posted by Farmer at 9/20/2004 10:55:10 PM
Thank you for any comments, help and your time
I am searching for any way to accomplish this with the record set solution.
declare @MaxPartsPerBatch int
set @MaxPartsPerBatch = 400
declare @tmp table
(
ordID int not null PRIMARY KEY
, ordCustRequestDate datetime not null
,... more >>
Newbie help
Posted by Steve at 9/20/2004 8:59:33 PM
After many hours reading the wisdom of those on this ng I have completed my
first attempt at an sp. While it does work, I have no idea if it is written
appropriately or not. I was hoping that I might get some feedback on it.
The purpose of the procedure is to populate a single record with th... more >>
Row numbers
Posted by amish m shah at 9/20/2004 6:07:31 PM
Hi all gurus
I have one problem
Suppose i want to get rows between specified number such as rows from 20 to
40 from my table how can I get it?
Is there any fucntion availabe for it in BOL
--
Thank and Regards
Amish M Shah
... more >>
counting rows question
Posted by Andrew Jocelyn at 9/20/2004 5:54:02 PM
/*
Hi
I want to do a single query to display a row count for each status. The
status detail is inserted in the History table and the HistoryStatus table
contains a list of possible statuses. I'm not sure how to get the results
out as 1 list i.e.:
Status TotalEntries
status 1 3
s... more >>
Simple Bulk Insert
Posted by Prabhat at 9/20/2004 5:04:28 PM
Hi All,
I have one TEXT (Source file = D:\V090804.TXT) file which I want to Bulk
Insert into SQL Table (Table Name = PLEDGEFILE) of Same Structure.
The text file has Data like:
"I","0406927277","MR","EUGENE","JUNGBLUTH"
"I","0401111111","MRS","PAULA","DICESARE"
and My Bulk Insert Stat... more >>
StoredProc Parameter Format
Posted by TomB at 9/20/2004 4:59:07 PM
The following runs as needed with the Sql statement:
SELECT RecordId
FROM Records
WHERE (RecordId IN (989, 990, 991))
How can the (989, 990, 991) part be passed into a stored procedure?
Thanks.
TomB... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Microsoft Exchange
Posted by Just D. at 9/20/2004 4:50:00 PM
All,
Is there any official way to exchange data from/to Exchange(Outlook) and
MSSQL Server 2000? For example if we store something on MSSQL Server 2000 as
TEXT field can we import these records to Exchange(Outlook) folders and
back?
Or I need to write my own utility to do that?
Just D... more >>
SQL Server 2005 Book
Posted by anonymous NO[at]SPAM discussions.microsoft.com at 9/20/2004 4:40:56 PM
I know this is not SQL Server 2005 group but still I hope
someone will answer this question;
Is there any good book out there for Beginners of SQL
Server 2005.
The only book I could find out is this (on Amazon):
http://www.amazon.com/exec/obidos/ASIN/0321180593/qid=10957
23463/sr=ka-1/re... more >>
Executing a Script via ADO that contains multiple GOs
Posted by JT Lovell at 9/20/2004 4:37:29 PM
I have a program that compares a text file with a version control table =
in the database. If the version in the text file is newer, then it runs =
the script (which updates the table). The script itself looks like =
this...
********** start script **********=20
DECLARE @script_version de... more >>
Group By 7 Day week period
Posted by gad at 9/20/2004 4:27:02 PM
I have a field of Dates, and I'm trying to get a count of how many entries
fall within a 7 day period (Mon-Sun). I am obviously able to group by year,
month, day and I've figured out the SQL "week" function that returns the
"number" of the week in the year. Is there a way to translate the # ... more >>
Simple query - I think
Posted by mgm at 9/20/2004 3:13:02 PM
I have a table that stores ranges of numbers - col1 = start_range, col2 =
end_range
If i have a number and I want to find if it fits into one of these ranges,
how would I do that?
Thanks!
braindead today... more >>
How to allow mutiple application to use the sysmessages table without conflicting?
Posted by Peter Rilling at 9/20/2004 3:09:51 PM
I think the idea of a sysmessages table is good since it allows the error
messages to be centralized, much like using a resource file. The problem I
have is that sysmessages are part of the Master database, which means global
scope. What if I am working on a server that has more than one databa... more >>
T-SQL and Code Reuse
Posted by Guadala Harry at 9/20/2004 2:38:06 PM
Beyone cut-n-paste, what are the options for re using code that appears in
multiple stored procedures?
Thanks!
... more >>
UPDATE or INSERT in same statement
Posted by David C at 9/20/2004 2:30:40 PM
I need to check to see if a record exists in a table and if not, INSERT a
record, and if so, UPDATE it. Is this possible? I'm assuming some EXISTS
check and IF....ELSE condition? Thanks.
David
... more >>
Bulk Insert With Identity Field
Posted by Prabhat at 9/20/2004 2:20:27 PM
Hi All,
Can I Bulk Insert to to SQL Table with a Identity Column in it?
My Source is a text file with 17 Columns and My Target is a SQL Server table
with 18 Columns (all 17 column of the source + 1 Identity Column as Primary
KEY).
So In this Situation How can i Bulk Insert to the SQL Tabl... more >>
cursor var as output par bewildering behavior/question/feature:
Posted by saras.asnasi NO[at]SPAM thehartford.com at 9/20/2004 2:08:04 PM
I am using pubs database on sqlserver 2000 to make my question/point.
Given the stored proc:
CREATE PROCEDURE dbo.test_cursor @acursor CURSOR VARYING OUTPUT
as
declare curs1 cursor local for select title_id, title from
pubs..titles
set @acursor=curs1
--open curs1
--or open @curos... more >>
update a row in one table with values from muliple rows in another table
Posted by Derek Ruesch at 9/20/2004 1:57:50 PM
I have to following tables:
Table1
-----------------
ID (int - Primary Key) | Name (varhcar 50 - Primary Key)
1 | Dave
1 | Brad
Table2
-----------------
ID (int - Primary Key) | Names (varchar 300)
1 | <NULL>
I want ... more >>
Retrieve collation settings
Posted by Johannes Lebek at 9/20/2004 1:32:36 PM
Hi there,
my problem is that I want to know what is the collation of the database
I connect to.
I planned to use the following statement:
SELECT DATABASEPROPERTYEX ('MyDatabase', 'collation')
However, I do not know the name of that database... I connect to J2EE
datasources using JNDI.
... more >>
Slow Query - better way?
Posted by jake stahh at 9/20/2004 1:01:46 PM
I have a query that is painfully slow (over a minute)...i've posted
it below:
i don't know what else to do to speed it up...i was thinking that
maybe i could use this query to create a table and just have it run
using a script every 15 minutes or so and then with the report is
requested show ... more >>
SP question
Posted by Nikolay Petrov at 9/20/2004 12:38:08 PM
I need a Stored procedure which checks for existence of a table in a
Specified DB and create it if missing.
Can someone help?
TIA
... more >>
Run a trigger when user logoff
Posted by shrwan at 9/20/2004 12:16:12 PM
Is there any method to execut a piece of code (trigger) when user logoff ?
... more >>
Celko Tree structure, anyone ?
Posted by PL at 9/20/2004 12:02:36 PM
Trying to find an actual implementation of the Celko tree "node set"
structure
but all I can seem to find are sites explaning the theory.
I don't have the time to reinvent the wheel, does anyone have some finished
sp's that implement this ? And a sample schema.
What I would need is sp's ... more >>
Multi Select Clarification
Posted by Mike Labosh at 9/20/2004 12:00:14 PM
I want to use the stored procedure below to make one trip to the database
and load 4 DataTables into a DataSet. Can I assume that the four sets are
always in the same order, or does it just look like that by random dumb
luck?
* VB.NET Calling Code *
Dim ds As DataSet...
Dim da As SqlDa... more >>
Calculated columns.
Posted by anonymous NO[at]SPAM discussions.microsoft.com at 9/20/2004 11:56:48 AM
refnbr and total are column names in invoice table.
The follwoing works.
select refnbr, x=total+10
from invoice
The follwoing works too.
select refnbr, x=total+10, y=10 * (total+10)
from invoice
This doesn't work:
select refnbr, x=total+10, y=10 * x
from invoice
Error says x is not... more >>
update records
Posted by anonymous NO[at]SPAM discussions.microsoft.com at 9/20/2004 11:39:47 AM
I have a need to update data in a table so that
a column contains the generated number for sets of
records for instance I have fileName as listed and it
should generate the SheetNum for each of the set
FileName SheetNum
A001 1
A001 2
A002 1
A002 2
A002 3
A00... more >>
Partioned View & Date Constraint Issue.
Posted by jamiemcc NO[at]SPAM yahoo.com at 9/20/2004 10:44:20 AM
Hello,
This query does not take advantage of my Partitioned View, the check
constraint on the view is on the datetime column, most of my queries
work fine (datetime issues seem to be related to SQL casting the dates
from strings to real dates). This one query gives me grief. The
first vari... more >>
How the SQL will handle this query....
Posted by David at 9/20/2004 10:42:27 AM
Select * from myTable where Col1='something' And Not Exists(Select * from
myTable2 where Col03=myTable.Col1)
The query in the Exists function is very expensive, so I don't want that SQL
Evaluate if the first condition "Col1='something'" is not true.
In normal programming this is called "Short ... more >>
Combine data ine one line?
Posted by John Doe at 9/20/2004 10:41:56 AM
Hi!
Can we do it in SQL? Is there a way to combine data ine one line (if ID
has more than one descp vlaues)?
create table #t
(ID int,
[Desc] varchar(20))
insert into #t values (1, 'description 1')
insert into #t values (1, 'description 2')
insert into #t values (2, 'xyyy')
This... more >>
column names from query
Posted by Robert Taylor at 9/20/2004 10:41:52 AM
I posted this a couple of weeks ago, but didn't get a response. Maybe
because it's not possible, but I will try reposting this.
I need to obtain the columns names return in a recordset. The problem
is, that the underlying query changes every time and sometimes call SPs
instead of dynamic SQL... more >>
Long compiling time
Posted by Mihai at 9/20/2004 10:09:03 AM
Hello,
I have a big select statement (14 tables, 90+ selected columns, 40 outer
joins) used for generating a report. When executed on one database1 takes 13
seconds to compile and generate the result. When executed on database2 it
takes 2:30 minutes to compile and 2 seconds to execute.
B... more >>
Rowset solution is sought. Please help
Posted by news.microsoft.com at 9/20/2004 9:54:55 AM
Here is my problem. Thanks for all replys. Thanks a lot for your time.
declare @tmp table (ordID int primary key, Qty int, prdID int null)
set nocount on
insert @tmp values (1,3,null)
insert @tmp values (2,5,null)
insert @tmp values (3,8,null)
insert @tmp values (4,6,null)
insert @tmp values ... more >>
TRIGGERS
Posted by Phil at 9/20/2004 9:06:25 AM
Hi All,
Like so many people on here I also have a Trigger problem,
I want to enter values in to my second table from my first
table when my first table gets a row added to it, if that
makes any sense, I can do the updates but cant seem to get
my head around the insert part, any help would be ... more >>
How do I test an EOF condition inside an SP?
Posted by Larry Woods at 9/20/2004 9:05:50 AM
I have a statement in an SP like:
SELECT @X = fldX FROM tblX WHERE inx=@Input
Where @Input is a value which might not be represented in table 'tblX'
How do I test to see if the SELECT statement executed correctly?
'Course, same question if I had the following in an SP:
SELECT * FROM t... more >>
de-string a string - help needed
Posted by g at 9/20/2004 7:36:22 AM
Have multiple forenames in one column that I need to put
into 3 columns.
Format of name varies :
forename
forename forename2
forename forename2 forename3
forename initial
forename initial initial . . . . and any other combo !!
Secondary problem is that there differing spaces
between the ... more >>
Trigger Will Not Work Due To Constraint
Posted by Tony C at 9/20/2004 6:38:25 AM
Hello NewsGroup
I have created the following Trigger.
This trigger gathers certain information from a Table in a
Database, runs some calculations and Checks, and if
everything is OK, it will then insert compiled data into
another Table into another Database: -
CREATE TRIGGER [AddToYea... more >>
Row-Level Pseudo -Security
Posted by google NO[at]SPAM netlineit.co.uk at 9/20/2004 6:02:43 AM
Hi
I need your advice on whether I'm barking up the right tree ;-)
I have a table, with an owner userid. When anyone logs onto the
database, I need to check if the login matches the owner id and if
not, to disable update of that table. The table needs to be
accessible, but only as read-only... more >>
Dynamic SQL - Updating Identity
Posted by Jimbo at 9/20/2004 6:00:50 AM
Dear All,
Though a set of circumstances that I will not go into we
have a db where the indentities are not correct.
So I decidied to write an SQL Statement that would update
it. So I declared a cursor, selected the sysobjects = 'U'.
Anyway I have come across a showstopper. I need to kno... more >>
SQLDMO EnumHistory method
Posted by Steve at 9/20/2004 4:03:01 AM
I am trying to create a VB app to return Job history using SQLDMO, but the
returned column order does not appear to that match that shown in
documentation
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqldmo/dmoref_m_e_9ick.asp).
Does anyone know the correct format of th... more >>
destring a string -
Posted by g at 9/20/2004 2:32:36 AM
Have multiple forenames in one column that I need to put
into 3 columns.
Format of name varies :
forename
forename forename2
forename forename2 forename3
forename initial
forename initial initial and any other combo !!
Secondary problem is that there differing spaces between ... more >>
|