all groups > sql server programming > october 2003 > threads for tuesday october 14
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
Complicated Query
Posted by Abhi at 10/14/2003 11:21:42 PM
I am using SQL server 2K.
I have a table
ID,School,Program,Credits,Amount
ID School Program Credits Amount
1 Eng BS.EE 12 100
2 Arch BS.Arch 14 200
3 ... more >>
preparing for 70-229 (about modify tables)
Posted by Jeff at 10/14/2003 10:39:32 PM
sqlserver2000 EE, win2k3
Here is a question from Microsoft 70-229 Readiness Review:
Create table Customers (
Customers_id int not null identity(1,1) primary key,
Customers_text varchar(60))
Then add the column Customers_salesinfo
alter table Customers add Customers_salesinfo ... more >>
how
Posted by Mark at 10/14/2003 8:36:04 PM
How do I program in sql server?... more >>
Help me on INSERT rows from 25 diferent places
Posted by Bruno Alexandre at 10/14/2003 7:38:35 PM
Hi there,
I have a serious question, cause to my web application work, I need to
resolve it, and I do not know where to start...
I'm developing a ASP/SQL application for 25 offices arround Portugal and
Galiza (northwest of spain) and I have this difficulty:
They add one row to... more >>
local packages relating to mapped drives can not be scheduled
Posted by moonriver at 10/14/2003 7:08:38 PM
I am encountered with the following problem while working
with local packages in SQL Server 2000( running on Windows
2000 Professional):
Any local package relating to a mapped drive can run well
immediately. However, if the local package is
scheduled as a job in SQL Server Agent, it will a... more >>
TEXT data type in a Stored Proc
Posted by Andy Pickering at 10/14/2003 6:44:36 PM
I have a stored proc that needs to retrieve data from a TEXT column in one
table and insert it into another (there's a bit more processing than
that(!) - but this is the main problem). I've only just found out that you
can't define local TEXT variables (d'oh!).
Is there any common work around... more >>
SQL Errors with LINKED SERVERS
Posted by Greg Walker at 10/14/2003 6:28:48 PM
Hello,
I would like to rehash a topic that crops up frequently -- errors in
T-SQL and how to handle them.
I am trying to execute SQL via linked servers, and if the SQL is "bad"
(table dropped, renamed, whatever),
the T-SQL batch simply HALTS and no error checking can be done.
Oh, BTW, OP... more >>
Help with Indexing....
Posted by Brett at 10/14/2003 6:12:48 PM
I presently have this query that is taking about 1 1/2
minutes to complete.
SELECT COUNT(*)
FROM quova_main
WHERE ip_start_num <= 168430510
AND ip_end_num >= 168430510
The table contains approximately 15 million rows. How
would I index this for optimal performance?
Thanks,
Brett
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Difference between OPENROWSET and OPENDATASOURCE
Posted by Daniel Caetano at 10/14/2003 5:49:12 PM
Can anybody helps me about the differences between OPENROWSET and
OPENDATASOURCE ?
Thanks
... more >>
SubQuery Vs Joins
Posted by Babz at 10/14/2003 5:37:49 PM
Hi,
I want to the performance of SubQuery Vs Joins.
Please give ur views or Give any Site ID
Thanx
Babz
... more >>
Save message
Posted by frk at 10/14/2003 5:20:58 PM
Hi,
If we run a store procedure in Query Analyzer, we can get
the full description for the SP execution. Is the message
saved somewhere? How can i copy these message and use it
in my application?
Regards
Frank
... more >>
create a script to display total number of oils with cautions
Posted by Cristian at 10/14/2003 4:58:02 PM
I like to thank you ahead of your help.
I need to create a view of Oils_Caution_View_2 that
display the total number of oils with caution
Here is the code
USE Aromatherapy
GO
if exists (select name from sysobjects
where name = 'Oils_Cautions_View_2' and
type = 'V')
D... more >>
HOW TO AVOID CURSORS
Posted by Nags at 10/14/2003 4:49:09 PM
In couple of postings I have seen that in 99.99 % of the cases CURSORS can
be avoided. I have one scenario where in I would like to avoid a cursor.
Table structures
Table : Product
PRODUCT_ID
PRODUCT_NUMBER
DESCRIPTION
.....
Table : Entitlement
ENTITLEMENT_ID
PRODUCT_ID
.....
Ta... more >>
newbie: multiuser question....
Posted by Asko Telinen at 10/14/2003 4:43:53 PM
Hi all..
I´m new in SQL Server programming and i have to
write a SQL Server 2000 client application (in VB or VC++ 6.0).
I have programmed DB apps using ADO and thought this
would be the easiest way to implement this client app as well.
Now the problem:
The one of the client app requiremen... more >>
shrink database files and log files
Posted by JJ Wang at 10/14/2003 4:43:14 PM
Hi
is this a good practice if I shrink the database files and
its log files after each day's full backup? Is this a
good practice for data warehouse databases?
many thanks.
JJ... more >>
Scripting foreign key constraints too !
Posted by chantal at 10/14/2003 4:36:05 PM
Hi
Whenever I script a few tables i always make sure that my script options in
Enterprise Manager are :
*Script indexes
*Script full-text indexes
*Script triggers
*Script PRIMARY Keys,FOREIGN keys, defaults, etc.
But the end script always lands up DROPPING the Foreign Key constraints, b... more >>
What is wrong with this statement.
Posted by Tom Groszko at 10/14/2003 4:21:47 PM
This statement works in our test environment but runs forever in our
production system. The production system for this database is a copy of test
for now.
This statement runs on a laptop MSDE database somewhere and gets data from a
corporate server.
DECLARE @Material TABLE (
MaterialID ch... more >>
URGENT, under attack ... Is there a log which tells the IP hitting SQL ?
Posted by Fox at 10/14/2003 4:19:53 PM
Attempts at breaking into the SA account are at 3000 per minute.
I am using Windows only authentication, which I was told eliminates
the SA account from being able to be used. But my CPU is staying
from 30% - 50% and I cannot afford that. Can anyone point me
to any way I can help to lessen this ... more >>
Replace Url links in valid html links
Posted by mquenez at 10/14/2003 4:00:51 PM
Hello
I've got some tables with text fields wich contain sentences with "hard
coded" urls.
I mean : blabla nla bla bla http://www.microsoft.com bla bla
I'm seeking some code or piece of code (or idea ?) to convert this sentence
in :
blabla nla bla bla <a href=http://www.microsof... more >>
Select TOP n
Posted by Fritz Mack at 10/14/2003 3:43:32 PM
Hi all,
how can I use a parameterized "SELECT TOP n" as in the sample.
-- Password definition
DECLARE @CryptoPW varbinary(128)
SET @CryptoPW = 0x123456C5A9496E
-- User ID
DECLARE @UID int
SET @UID = 77
-- last n history entries
DECLARE @n int
SET @n = 4
SELECT (CASE WHEN count(*... more >>
Difference in Time
Posted by Brad M. at 10/14/2003 3:28:28 PM
How would I be able to tell if a supplied datetime value is less than 5
minutes older than the current value of GETDATE()?
Any help is appreciated!
Best Regards,
Brad
... more >>
Reducing Spam Associated with Posting to Newsgroups
Posted by Microsoft Communities Team [MSFT] at 10/14/2003 3:27:53 PM
Due to a recent increase in spam sent to posters in newsgroups, Microsoft advises that newsgroup participants should consider avoiding posting to newsgroups using their real email address. Microsoft is also committed to continuing to address the issue of spam from a technological perspective.
To... more >>
How do I call an .exe from SQL2000
Posted by Rick at 10/14/2003 3:21:04 PM
Hi,
I'm developing an intranet for a lab that is automated and I'm not sure how I should develop this one piece of the puzzle.
The user will be able to go to the website and file a "New Job" request and save the data into a SQL2000 DB. The system running SQL2k has 2 NIC's in it. One goes to... more >>
Reducing Spam Associated with Posting to Newsgroups
Posted by Stephen Dybing [MSFT] at 10/14/2003 3:18:57 PM
Due to a recent increase in spam sent to posters in newsgroups, Microsoft
advises that newsgroup participants should consider avoiding posting to
newsgroups using their real email address. Microsoft is also committed to
continuing to address the issue of spam from a technological perspective.
... more >>
problem debugging - Cannot load the DLL mssdi98
Posted by Les Caudle at 10/14/2003 1:47:46 PM
I can no longer debug within VS.NET 2003 or even within the 2k Query Analyzer.
I'm not sure when I lost this functionality - the last time I tried was before
upgrading VS.NET from 2002 - and before sql2k sp3a
I'm running win2000 SP3, sql2k sp3a. - and attempting to debug sql server living
on t... more >>
crosstab / pivot
Posted by GLock at 10/14/2003 1:37:20 PM
Hi,
I have a table with the following attributes:
criteria
rating
description
I created a crosstab query in Access 2000 that allowed me to list the data
as follows:
criteria rating5 rating4 rating3
rating2 rating1
criteriaA ... more >>
RE: Group By Params in Functions
Posted by Ricky at 10/14/2003 1:25:00 PM
Hi
I have a function that I wish to pass some parameters to, and one of them
will be a Group By field, is it possible to do this?
An example of the code I'm trying to use:
ALTER FUNCTION qfm_NewGraphAssets1(@ByField AS VARCHAR(128))
RETURNS table
AS
RETURN
(
Select @ByField... more >>
Calculating The Number Of Work Days Within A Given Date Range
Posted by bri.gipson NO[at]SPAM mindspring.com at 10/14/2003 12:37:35 PM
This type of funcationality appears to be widely requested. Although
below is a function, it could be easily converted into a stored
procedure or inline T-SQL code. The basic logic should also be easily
transferrable to other languages such as VB, C, C++, etc.
Hope the following code comes acr... more >>
SQL Help - formula req
Posted by Harag at 10/14/2003 12:29:25 PM
Hi all
win 2k pro sp4
sql 2k dev ed sp 3
I need to do a formula using SQL if possible. I've worked out how to
do it on paper step by step but would love to do it with one "update"
sql line if possible
the step formula is:
if total > (curr+past) then curr=curr+(tot-(curr+past))
if tot... more >>
Network Backup
Posted by André Almeida Maldonado at 10/14/2003 11:43:55 AM
Hey Guys, so...
I have to create a Maintenance Plan that have to made a backup in other
machine in the network... But when I create it, the Maintenance Plan don't
make the backup. Why it happens???
Thanks
... more >>
sp_executesql with text datatype
Posted by Nikola Milic at 10/14/2003 10:22:31 AM
Hi,
How can I execute text (or ntext) string as @stmt argument of sp_executesql?
I cannot create local variable of text type, nor I can pass subquery (which
returns text type) as value of @stmt.
What is solution?
I have SS2000 EE, SP3, WIN 2000, Advanced, SP4
Thanks in advance
Nikola Mi... more >>
Trimming end of a field
Posted by Sass Girl at 10/14/2003 9:53:59 AM
I don't know where to turn, but I am having an issue trying to trim the
middle initial and/or suffix (Jr, Sr, etc...) off of a name field.
Example:
Name = Mouse,Mickey M
I want it to store:
New Field = Mouse, Mickey
I can do it in Excel (VB for apps) and in Access, but SQL is not
except... more >>
Stepping Through Stored Proc
Posted by Jim Heavey at 10/14/2003 9:53:58 AM
Hello, I am trying to figure out how to step though the code in my
stored procedure using Visual Studio.Net. I'm sure I have heard
somewhere that you can do this.
When I bring up the stored proc ins VS.Net and identify the line that I
want to begin monitoring, intellisense provides a message ... more >>
Need help creating a view
Posted by Peter Afonin at 10/14/2003 9:51:56 AM
Hello:
I have a table that I'm populating programmatically using VB code. However,
I think I could just create a view instead, but I cannot figure out how. I
would appreciate very much any help with this.
User enters 3 numbers:
nCustom int,
nStart int - starting number,
nRecords int - n... more >>
Need to select a table based on an other table.
Posted by Jack at 10/14/2003 9:50:50 AM
Hello,
I hope this is enough info:
Widgets Table
WigitID = Key
WigitMaker = varchar(20)
Sales Table
SalesID = Key
WigitID = INT
WigitMaker = varchar(20)
I would like to see all the sales by wigitmaker, but I would like to be able
to do this without the WigitMaker in the SalesTa... more >>
Flagging consecutive attempts
Posted by Doru Roman at 10/14/2003 9:36:03 AM
Hi,
CREATE TABLE [dbo].[MyTable] (
[Start_Date] [datetime] NOT NULL ,
[FromS] [char] (10) NOT NULL ,
[ToS] [char] (10) NOT NULL ,
[Status] [char] (10) NOT NULL ,
[Rec_ID] [int] IDENTITY (1, 1) NOT NULL
) ON [PRIMARY]
Insert Into MyTable(Start_date,FromS,ToS,Status) Values ('10/6/20... more >>
Describe Tables
Posted by André Almeida Maldonado at 10/14/2003 9:11:11 AM
When I use MySQL I can execute the command SHOW TABLES, DESCRIBE TABLES to
see all the tables that exists in my database and to see all columns in the
table, respectively. How I can do this in SQL Server (using osql or Query
Analyzer)???
Thanks
... more >>
using SET for multiple SELECT columns ?
Posted by exBK at 10/14/2003 9:01:05 AM
Hi,
I would like to retrieve more than 1 column and assign them to a local variables in a single query is it possible ?.
Here's what I am trying:
DECLARE @intInvoiceNo INT
DECLARE @strInvoiceName VARCHAR(20)
SET @intInvoiceNo = (SELECT InvoiceNo from Invoice where InvoiceID =1)
SET @strInvoiceName... more >>
Two column constraint
Posted by j.m.autry NO[at]SPAM earthlink.net at 10/14/2003 8:51:47 AM
How do I create a constraint on an associative table where I need to define
the combination of two columns as being unique. What is the syntax.
Thanks,
Jim... more >>
Proxy Account Problem - Sql Server Agent
Posted by syadavalli NO[at]SPAM covansys.com at 10/14/2003 8:47:43 AM
Posted - 10/14/2003 : 09:45:21
--------------------------------------------------------------------------------
Hi
I have a situation here..
I need to give a developer permissions to execute xp_cmdshell and as I
did permit the userid... I get the following error
Msg 50001,... more >>
CAST and datetime string
Posted by Brian Baley at 10/14/2003 8:27:14 AM
Hi,
can someone tell me why this fails or the right way to go about it?
I'm just trying to create a month froma date so that the new date =
'mm/01/9999'
CAST(
CAST(MONTH(PaidDate) AS char(2)) +
'/01/' +
CAST(YEAR(PaidDate) AS char(2))
AS datetime
) as P... more >>
Convert Unix Date to Datetime
Posted by Elecia at 10/14/2003 8:19:55 AM
Hi All,
I need to convert a unix date to a datetime format. I have tried the
following
dateadd(ss, open_date, '19700101')
but it is actually a few hours off.
A script to do an acurate conversion would be greatly appreciated.
Thanks,
Elecia
... more >>
Calculating an order field for each group of id
Posted by david.parenteau NO[at]SPAM compuware.com at 10/14/2003 7:49:02 AM
Hi,
My objective is to convert a simple query result like this:
SELECT e.ent_id, lia_id, mend_description_fr
FROM ENTREPRISE e, LIAISON l, menu_desc m
WHERE t.ent_id = l.ent_id
AND l.numi_id = 37
AND l.mend_id = m.mend_id
ORDER BY t.ent_id, lia_id ASC
The table ENTREPR... more >>
Locking problem
Posted by ufobox at 10/14/2003 7:01:02 AM
Here is the statement which updates an ID counter and return it:
Declare @ID int
Declare @nextid int
BEGIN TRAN
UPDATE IDTable set ID = ID + 1 WHERE ID_Name = @TableName
select @nextid = ID from IDTable (nolock) WHERE ID_Name = @TableName
COMMIT TRAN
return @nextid
Sometime it cuase l... more >>
Database Monitoring Tool
Posted by RonaldA at 10/14/2003 6:01:58 AM
Is there any third party database monitoring tool for SQL Server 2000
that provides more than what Enterprise Manager and SQL Profiler
already offers?
--
Posted via http://dbforums.com... more >>
getting a list of groups a specific user belongs to in sql server 2000
Posted by b_van_den_broek NO[at]SPAM hotmail.com at 10/14/2003 5:38:39 AM
I need to know if there is a way in Microsoft SQL Server 2000 to
determine which Windows groups a user belongs to if logging into the
database under Windows Authentication. I am making a tool to view all
permissions of a user, but since most permissions are granted through
groups here, I need to... more >>
Unicode characters in Stored Procedure
Posted by Erik at 10/14/2003 1:34:51 AM
Hi all,
I'm having a problem:
I want to compare nvarchars, but its a problem with signs
(such as chinese). I can select it but can't compare it. I
got this already:
CREATE PROCEDURE sp_selectLanguage
@Language_Name nvarchar(255)
AS
SELECT Language_ID FROM Languages WHERE
Language_... more >>
SQL Dynamic Query
Posted by SQL Novice at 10/14/2003 1:26:05 AM
I am an SQL vovice and I would like to learn from you experts. I wrote a web form to enable my users to search my database. The form includes three fields Title, Author and Publisher that are programatically concatenated by AND conjuction. Now I want my users to fill in just one, two or all three fi... more >>
I could not view locked records
Posted by V.GANESH at 10/14/2003 12:53:37 AM
I am using sql server 2000.
I want to build a application which will be used on LAN.
the same application will be running on multiple PC's and
will be using same table. Now I want to introduce
transaction control in this application. My current
problem is if I start transaction at one plac... more >>
Update timeout
Posted by Dawn at 10/14/2003 12:23:01 AM
Hi,
I hope someone can help me with an error I seem to be
having when attempting to update data in a table.
I migrated some tables from Access to SQL Server. These
tables were then linked into a client access database.
Queries and forms use these tables, however when anyone
has the f... more >>
|