all groups > sql server programming > november 2005 > threads for friday november 4
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
Access Text Within A SQL Binary Field
Posted by Anthony at 11/4/2005 9:10:12 PM
Is there any way to access the text within a SQL Binary object? For example
if I wanted to count the number of words within a Word document that had been
added to a binary field in the database.
I figure the IFilters used by the Full-Text indexing service must do
something like this in o... more >>
ALTER TABLE to add NOT NULL fields
Posted by scuba79 at 11/4/2005 8:23:01 PM
I'm using the following statement to create two new fields in a table:
ALTER TABLE tblActivity ADD LOGUserID [INT] NOT NULL, LOGDATE [DATETIME] NOT
NULL
When I run it in QA, I get this error message:
ALTER TABLE only allows columns to be added that can contain nulls or have a
DEFAULT defi... more >>
DELETING 100 million from a table weekly SQl SERVER 2000
Posted by harish at 11/4/2005 7:46:33 PM
DELETING 100 million from a table weekly SQl SERVER 2000
Hi All
We have a table in SQL SERVER 2000 which has about 250 million records
and this will be growing by 100 million every week. At a time the table
should contain just 13 weeks of data. when the 14th week data needs to
be loaded the... more >>
Six Degrees of Separation
Posted by jvjean24601 at 11/4/2005 5:07:52 PM
I'm having trouble trying to code a SQL update statement that
interestingly enough follows the scenario very similar to the 'Six
Degrees of Separation' premise.
Consider that we have a table with the following data. We want to
update the ACQUINTANCE column starting with KevinBacon. The only ... more >>
dts fired from sp
Posted by John 3:16 at 11/4/2005 4:17:30 PM
Hello,
Is it possible to fire a DTS from within a stored procedure?
tia,
bob mcclellan
... more >>
xp_cmdsh
Posted by oldboyfriend NO[at]SPAM gmail.com at 11/4/2005 2:12:45 PM
I have the following stored procedure, and it works for me (the
developer), but it won't work for my users. I have set up a SQL Server
Agent Proxy user and that does not work. Does each individual user
have to have rights on the machine to read/execute the .net console
application?
CREATE P... more >>
Clustered Index -minimize the cost of Page Splitting
Posted by John Kotuby at 11/4/2005 1:33:29 PM
Hi guys,
I hope this is the last post from me for a while. Your help in the last 2
weeks has been appreciated. We have run into problems with a production
system that was deployed at a site with 4 times the data found at our other
sites and have just 2 more weeks to optimize.
We have fou... more >>
ReadOnly Cursor
Posted by Li at 11/4/2005 1:17:59 PM
DECLARE CP_Cursor CURSOR FOR
SELECT InsID, DateID
FROM dbo.vw_CP
ORDER BY InsID, DateID
FOR UPDATE OF ToDateID
OPEN CP_Cursor
FETCH NEXT FROM CP_Cursor INTO @iInsID, @iDateID
WHILE @@FETCH_STATUS = 0
BEGIN
UPDATE dbo.vw_CP SET ToDateID = 0
WHERE CURRENT OF ... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Pivot SQL Statement in SQL SERVER 2000
Posted by harish at 11/4/2005 12:55:36 PM
I have a table temp1 with the following data:
a b c d
10 11 888 991
10 11 888 992
How do I pivot this such that the output be
10 11 888 991 992
Thanks
harish
... more >>
Unique Index Vs Primary Index in SQL Server 2000
Posted by harish at 11/4/2005 12:39:39 PM
Hi
Will there be any performance difference if a primary index is created
instead of a unique index or vice-versa in SQL Server 2000.
All the columns are non-nullable.
Thanks
harish
... more >>
Index Tuning Multiple Queries
Posted by Brett Ossman at 11/4/2005 12:31:04 PM
I'm attempting to run the Index Tuning Wizard against multiple queries at
once (dozens) in SQL Query Analyzer. I put a GO at the end of them to
indicate a batch, select all the queries + GO, but the wizard only analyzes
the first query. I'm also avoiding the production hit of the Profiler,
... more >>
Calling SQL Stored Procedure from ASP
Posted by Tincho at 11/4/2005 12:29:02 PM
Hi friends, i want to call a SP from ASP (not dot net) that returns some many
rows.
The conn string is:
<%
Set objCon = CreateObject("ADODB.Connection")
Set objRS = CreateObject("ADODB.Recordset")
objcon.connectionstring = "Provider=SQLOLEDB.1;User
ID=USER;Password=XXXX;Pers... more >>
substitution
Posted by rodchar at 11/4/2005 11:46:15 AM
hey all,
if i have a integer status column like the following:
Status
1
2
3
How do i substitute a descriptive string in place of the numbers in a
resultset?
1=Unchanged
2=Updated
3=Underwriting
thanks,
rodchar... more >>
how do I prevent duplicate ID in my situation
Posted by Samuel at 11/4/2005 11:21:02 AM
Hi everyone,
I am running into a issue that only happens very rarely. In a web app I
developed (ASP.NET + SQL server), I need to add a record into a table
[messageTbl] that has a column [messageID] as the primary key, so I must
generate a unique value for this column (type int, not identity... more >>
Stop/Start SQLSERVERAGENT service with Transact-SQL
Posted by Ben Rum at 11/4/2005 11:07:37 AM
Is this possible?
... more >>
Extended Stored Procedure creation error
Posted by nick at 11/4/2005 10:59:12 AM
I've created an extended SP on my local machine (Win XP/ VS.Net 2003 / VC++).
It works fine when I tested on my local PC after I copied the created dll
file to binn directory and ran sp_addextendedproc.
I copied it to a Win 2000 Server/MS SQL's binn directory and
sp_addextendedproc complete... more >>
best solution?
Posted by da fish & da chip via SQLMonster.com at 11/4/2005 10:57:07 AM
hi there,
i need a kind of "more about this area" feature on my website to set some
links to articles about the same area or spots in this area, but im not sure
whats the best (fastes) solution for this. "area" can be a country, a state
or just a city in this case. so have a databae and a fiel... more >>
Why does this code fail as stored procedure?
Posted by Morten Wennevik at 11/4/2005 10:48:26 AM
Hi,
Why does this code execute correctly and returns 3 rows in Query Analyzer
SELECT ImportID FROM TempTable
WHERE Field1 NOT IN ('', 'K', 'KE', 'KR')
but returns all rows in the table when executed as stored procedure
CREATE PROCEDURE dbo.[StoredProcedure] AS
SELECT ImportID FROM... more >>
SQLBulkCopy WriteToServer timeout exception occassionally
Posted by AdrianDams at 11/4/2005 10:46:53 AM
I have a system that fills a DataTable and periodically sends it to the SQL
Server using SQLBulkCopy.WriteToServer. On the whole, the solution works
great, but very occassionally I get a timeout exception. I have set the
bulkcopy timout to 30 seconds which, for my data load, is plenty. Typical... more >>
Cannot create a worktable row larger than allowable maximum. Resubmit your query with the ROBUST PLAN hint.
Posted by pdobos375 at 11/4/2005 9:57:42 AM
I am getting this error message (Cannot create a worktable row larger than
allowable maximum. Resubmit your query with the ROBUST PLAN hint.) when
trying to run the following SELECT query:
SELECT a.*,a.Model_Number AS
Model_Number,convert(varchar(40),b2.Product_Line) AS
Product_Line_Numbe... more >>
Query with OR never completes
Posted by rvgrahamsevatenein NO[at]SPAM sbcglobal.net at 11/4/2005 9:40:18 AM
This runs 'Instantly':
SELECT J.JobID, J.JobName, J.CustName
FROM JOBS J Join Jobs J2 on J.Jobid = J2.JobID
WHERE J2.Jobid IN (SELECT jobid
FROM jobs WHERE jobname IN
(SELECT parent FROM Jobs WHERE
parent IS NOT NULL AND
schedtdate BETWEEN '1/1/2005' AND '11/... more >>
[OT] SQL 2005 Launch - San Francisco
Posted by Kevin3NF at 11/4/2005 9:29:52 AM
So...who's going to be at the Launch in San Fran on Monday?
I'd like to meet some of you face to face either Sunday or Monday..
Chime in if you will be there :-)
Thanks!
--=20
Kevin Hill
President=20
3NF Consulting
www.3nf-inc.com/NewsGroups.htm... more >>
Transaction Log in a large delete operation performed in steps.
Posted by harish at 11/4/2005 9:26:18 AM
I am using teh following code in a large delete operation performed in
steps.
SET ROWCOUNT 5000;
WHILE 1 = 1
BEGIN
DELETE FROM T1 WHERE dt < '20030101' -- original delete
IF @@rowcount < 5000 BREAK;
END
SET ROWCOUNT 0;
Using this code if I delete 1 million in each step out of a to... more >>
Challenge! Trying to understand this piece of code
Posted by Morten Wennevik at 11/4/2005 9:21:06 AM
Hi,
Can anyone tell me if this piece of code does anything useful?
SELECT * from TempTable t WHERE (EXISTS (
SELECT Field1, Field2, Field3, Field4 FROM
(SELECT DISTINCT Field1, Field2, Field3, Field4, Field5
FROM TempTable) SUBQUERY
WHERE (t.Field1 = SUBQUERY.Field1)
And (t.Fiel... more >>
Sporadic Behavior From ITW
Posted by A. Robinson at 11/4/2005 8:51:07 AM
I am seeing some odd behavior from the Index Tuning Wizard.
Just yesterday, I created a SQL trace and ran it on a server. I then saved
the output as a SQL script. I started the ITW and it actually tuned the SQL
script.
Now this morning all of a sudden the ITW tells me the workload file doe... more >>
how do i say this...
Posted by rodchar at 11/4/2005 8:44:03 AM
hey all,
Given the table:
DeptName Status
IT Updated
IT Unchanged
IT Unchanged
Finance Updated
Finance Unchanged
How do i answer this question in SQL syntax:
What is the total count for each status type?
The answer for the above scenario should be :
Unchanged ... more >>
Program for scripting data
Posted by checcouno at 11/4/2005 7:46:26 AM
There are free program for scripting data in sql tables?
Thanks... more >>
How can I get a table reference knowing his name inside a system f
Posted by Argiris Petromelidis at 11/4/2005 7:46:10 AM
I want to call the system function
DBCC CHECKIDENT( ) inside a stored procedure which takes as an input
parameter a @TableName varchar variable represanting the table's name.
DBCC CHECKIDENT( ) requires as input the table object, while I have the
table string name.
Is there any way tha... more >>
how to process each record of select results
Posted by vinod at 11/4/2005 7:23:34 AM
Hi All,
I have some SQL query returns numbers of records. I want to process
each of this record.
consider the example
suppose my select query returns following results
col1 col2 col3
NY 1 <some value>
CA 2 <some value>
TN 3 ............. more >>
dayly table update
Posted by Xavier at 11/4/2005 6:37:06 AM
hello,
i must dayly update a table in my database with the values of a CSV file
(~300000 entries)
example of the tabel (artNr ,productname ,price )
000001 monitor 234,66
000003 pc 699,44
......
245433 router 126,33
Now dayly the table-content is deleted and the csv-file is imported
... more >>
Stored Procedure Development
Posted by Art at 11/4/2005 6:19:14 AM
Hi,
I'm very new to SQL Server 2000. I'm wondering what the best way to write
stored procedures are.
Currently I go into Enterprise Manager, double click the procedure and then
code. It's been working okay, except that I'm missing a bunch of stuff that
would be helpful. For example Fin... more >>
UDF and table variable
Posted by fdudan at 11/4/2005 6:19:04 AM
Hi,
I have several question about UDF and table variable:
- Is there a way to pass columns as parameters to table-valued UDF in join
clauses ?
ex: select * from mytable t inner join dbo.fn_myfunc(t.col1,t.col2)
- table variable declaration must always use a separate declare statement ?... more >>
How to add a "synonym" to a row ...
Posted by rudolf.ball NO[at]SPAM asfinag.at at 11/4/2005 5:47:31 AM
Hi NG,
I have a query where I get routes through a city, like this
ROUTE || Passengers |||
A-B-C-D 144
A-B-E-X 72
B-F-G-H-J 66
B-F-K-L-X 12
B-C-D-F-G 7
G-H-X-A 1
... more >>
Copy Columns
Posted by tonyp at 11/4/2005 5:23:03 AM
Hi. I have an issue with an SQL 2000 database. I have a column that I
need to copy to another column within the same table. There are already
values in the destination column and I want to append the new values to the
end of the existing data within each field.
I am an experience... more >>
Syntax error converting from a character string to uniqueidentifier
Posted by Racer-D at 11/4/2005 4:28:35 AM
I have two queries that I have combined using a join between two
derived tables and I am getting the error, "Syntax error converting
from a character string to uniqueidentifier."
I have no idea how to get around this, can anyone help?
Thanks,
dp
Query below:
SELECT a.name1,
... more >>
DB Design issue
Posted by Toby at 11/4/2005 4:13:01 AM
Hello everyone,
I have four tables namely course,lesson,topic,page.
1.course ( 1,2,3)
courseid PK
2.Lesson (lesson id would be 1,2,3 for evry course)
courseid+lessonid PK
3.topic( topicid wud be 1,2,3 for evry lesson)
courseid+lessonid+topicid PK
4.page (pageid wud 1,2,3.. for evry pa... more >>
Help selecting maximum number of characters
Posted by chippy at 11/4/2005 4:12:03 AM
I need help with this query.
select
sb.name,
theMin = min(cast(fb.fudmin as int)),
theMax = max(cast(fb.fudmax as int)),
cnt = count(setid),
mso.ord,
fb.chars,
sfo.ford,
sfo.cond
from
mbasic mb
inner join msord mso on (mb.id = mso.context)
inner join sbasic sb on (mso.setref = sb.id)
... more >>
ADO won't catch error while execute an Stored Procedure, Why?
Posted by Bas at 11/4/2005 2:44:28 AM
If have created an stored procedure like :
CREATE Procedure bh_RemoveProcedure
(
@THEID uKey
)
AS
Delete
From [T1]
Where COL1 = @THEID
And COL2 = 6
Delete
From [T2]
Where COL1 in
(Select COL1
From [T3]
Where COL2 = @THEID
And COL3 = 6)
Delete
From [T2]
Where COL1 ... more >>
Query Analyzer
Posted by Paul at 11/4/2005 1:46:19 AM
Hi
I'm working in query analyzer and I'm getting these small yellow blobs with
3 pointy arrows that I haven't seen before and I don't know what they mean -
they appear on most of the icons - any idea what this means?
Ta
Paul... more >>
SQL Join question
Posted by Stefan at 11/4/2005 1:17:03 AM
I want to put the results from two queries together in on new query. I think
I'v to use a join but I'm not sure how.
These are the two queries I want to put together:
Query 1:
Select Value, DiscoveryComputerID from Attribute WHERE ClassAttributeID IN
(Select ClassAttributeID from ClassAttrib... more >>
SP not bring me a value
Posted by Enric at 11/4/2005 12:00:01 AM
Dear all,
I've got an issue with a stored procedure and I can't work out.
This is the stored procedure:
CREATE PROCEDURE Arq_RecuperaIdentity
AS
declare @maxDTS as integer
declare @maxDTSFICH as integer
declare @VALOR as integer
SET @maxDTS = (SELECT MAX(ID) FROM ARQ_DTSDATOS)
... more >>
Date issue
Posted by Ron Wallegie at 11/4/2005 12:00:00 AM
I have got an issue with dateformats. When i retrieve a date field from the
sql server it is noted as 02/10/2005 17:40:00. everything fine so far. I
want to compare it to the current time. This doesn't work. When i print the
current datetime i get " 4 Nov 2005 5:40PM". How can i set sql so it ... more >>
Subqueries... document reference? (sql2k)
Posted by Rebecca York at 11/4/2005 12:00:00 AM
Hi,
Someone recently posted a way of renaming the column names of a subquery.
SELECT
subQuery.Data1
, subQuery.Data2
, subQuery.Data3
FROM
(
SELECT TOP 0 NULL AS Field1 , NULL AS Field2 , NULL AS Field3
UNION ALL SELECT 1 , 2 , 3
UNION ALL SELECT 4 , 5 , 6
UNION ALL... more >>
Date issue
Posted by Ron Wallegie at 11/4/2005 12:00:00 AM
I have got an issue with dateformats. When i retrieve a date field from the
sql server it is noted as 02/10/2005 17:40:00. everything fine so far. I
want to compare it to the current time. This doesn't work. When i print the
current datetime i get " 4 Nov 2005 5:40PM". How can i set sql so it ret... more >>
"Could not find stored procedure 'sp_sdidebug'" SQL 2005 VERY URGENT
Posted by João Santa Bárbara at 11/4/2005 12:00:00 AM
Hi all
i have installed SQL 2005
and when i try to run my application it gives me this error .
Could not find stored procedure 'sp_sdidebug' what can i do to solve this
....
thks
JSB
... more >>
|