Home All Groups Group Topic Archive Search About

SQL Server database programming

microsoft.public.sqlserver.programming
Score UPDATE SP works in QA but not in VB
Mark Hoffy - 5 Nov 2005 9:03 PM - 3 messages
Hello, I have a stored proc that works when I run it in query anlalyzer, but returns an error when called from code.  Do I need to make some change to the query to make it callable?  Thanks for any help. ...
Score SQL server 2000 fragmentation
Nada Sherief - 5 Nov 2005 7:47 PM - 2 messages
[Message not available] ...
Score matching saved searches to newly inserted record
neilmcguigan - 5 Nov 2005 7:00 PM - 5 messages
Hello SQL wizards, I'm trying to match saved searches to a newly inserted "job", and send an email for matching searches. get about 20 job postings a day, and have about 150k saved searches. want to do this as quickly as possible. ...
Score Why can't a LEN argument be passed to a CAST call?
rvgrahamsevatenein - 5 Nov 2005 5:35 PM - 9 messages
Can someone tell me why this creates an error: declare @int int set @int = 55 select cast(@int as char(Len(@int))) CHAR takes an integer argument, and LEN returns an integer, so why should it fail? Probably something about set-based logic that eludes me, that would ...
Score How to add strings to NTEXT data type
Aphex3000 - 5 Nov 2005 2:29 PM - 2 messages
Hi, All, First of all thanks for reading my post.  I’m trying to figure out how to add strings to a NTEXT data type column. TABLE (         NoteID VARCHAR(10) PRIMARY KEY, ...
Score Image upload FREE
Picica - 5 Nov 2005 12:19 PM - 1 message
Upload your image free! send blank message to sa***@lpi-hk.com to get access. ...
Score Image upload FREE
Picica - 5 Nov 2005 12:19 PM - 1 message
Upload your image free! send blank message to sa***@lpi-hk.com to get access. ...
Score Image upload FREE
Picica - 5 Nov 2005 11:51 AM - 1 message
Upload your image free! send blank message to sa***@lpi-hk.com to get access. ...
Score Image upload FREE
Picica - 5 Nov 2005 11:51 AM - 1 message
Upload your image free! send blank message to sa***@lpi-hk.com to get access. ...
Score free world sms
Fesstica - 5 Nov 2005 11:04 AM - 1 message
Free SMS send all over world send blank message to sa***@lpi-hk.com to get access. ...
Score free world sms
Fesstica - 5 Nov 2005 11:04 AM - 1 message
Free SMS send all over world send blank message to sa***@lpi-hk.com to get access. ...
Score Access Text Within A SQL Binary Field
Anthony - 5 Nov 2005 5:10 AM - 3 messages
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.  ...
Score ALTER TABLE to add NOT NULL fields
scuba79 - 5 Nov 2005 4:23 AM - 3 messages
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 ...
Score DELETING 100 million from a table weekly SQl SERVER 2000
harish - 5 Nov 2005 3:46 AM - 6 messages
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 ...
Score Six Degrees of Separation
jvjean24601 - 4 Nov 2005 11:07 PM - 6 messages
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 way I've been able to do this is by using a loop and going up the acquintance level one at a time. Is it at all possible to do this in one elegant and efficient SQL statement? ...
Score xp_cmdsh
oldboyfriend - 4 Nov 2005 10:12 PM - 5 messages
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 ...
Score dts fired from sp
John 3:16 - 4 Nov 2005 9:17 PM - 5 messages
Hello, Is it possible to fire a DTS from within a stored procedure? tia, bob mcclellan ...
Score Pivot SQL Statement in SQL SERVER 2000
harish - 4 Nov 2005 8:55 PM - 7 messages
I have a table temp1 with the following data: a    b    c    d 10    11    888    991 10    11    888    992 ...
Score Unique Index Vs Primary Index in SQL Server 2000
harish - 4 Nov 2005 8:39 PM - 2 messages
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 ...
Score Index Tuning Multiple Queries
Brett Ossman - 4 Nov 2005 8:31 PM - 4 messages
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 ...
Score Calling SQL Stored Procedure from ASP
Tincho - 4 Nov 2005 8:29 PM - 4 messages
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 ...
Score substitution
rodchar - 4 Nov 2005 7:46 PM - 4 messages
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 ...
Score how do I prevent duplicate ID in my situation
Samuel - 4 Nov 2005 7:21 PM - 26 messages
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 ...
Score Extended Stored Procedure creation error
nick - 4 Nov 2005 6:59 PM - 3 messages
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 ...
Score Clustered Index -minimize the cost of Page Splitting
John Kotuby - 4 Nov 2005 6:33 PM - 3 messages
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 ...
Score "Could not find stored procedure 'sp_sdidebug'" SQL 2005 VERY URGENT
João Santa Bárbara - 4 Nov 2005 6:20 PM - 2 messages
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 ...
Score ReadOnly Cursor
Li - 4 Nov 2005 6:17 PM - 5 messages
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 ...
Score Query with OR never completes
rvgrahamsevatenein - 4 Nov 2005 5:40 PM - 7 messages
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 ...
Score Transaction Log in a large delete operation performed in steps.
harish - 4 Nov 2005 5:26 PM - 7 messages
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; ...
Score Date issue
Ron Wallegie - 4 Nov 2005 5:03 PM - 3 messages
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 ...
Score Sporadic Behavior From ITW
A. Robinson - 4 Nov 2005 4:51 PM - 3 messages
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 ...
Score Date issue
Ron Wallegie - 4 Nov 2005 4:48 PM - 10 messages
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 ...
Score how do i say this...
rodchar - 4 Nov 2005 4:44 PM - 3 messages
hey all, Given the table: DeptName                    Status IT        Updated IT        Unchanged ...
Score Subqueries... document reference? (sql2k)
Rebecca York - 4 Nov 2005 4:10 PM - 4 messages
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 ...
Score SQLBulkCopy WriteToServer timeout exception occassionally
AdrianDams - 4 Nov 2005 3:46 PM - 5 messages
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. Typically ...
Score Program for scripting data
checcouno - 4 Nov 2005 3:46 PM - 2 messages
There are free program for scripting data in sql tables? Thanks ...
Score How can I get a table reference knowing his name inside a system f
Argiris Petromelidis - 4 Nov 2005 3:46 PM - 3 messages
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 ...
Score [OT] SQL 2005 Launch - San Francisco
Kevin3NF - 4 Nov 2005 3:29 PM - 5 messages
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! ...
Score how to process each record of select results
vinod - 4 Nov 2005 3:23 PM - 8 messages
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 ...
Score Cannot create a worktable row larger than allowable maximum. Resubmit your query with the ROBUST PLA
pdobos375 - 4 Nov 2005 2:57 PM - 2 messages
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 ...
Score dayly table update
Xavier - 4 Nov 2005 2:37 PM - 5 messages
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 ...
Score Stored Procedure Development
Art - 4 Nov 2005 2:19 PM - 8 messages
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 ...
Score UDF and table variable
fdudan - 4 Nov 2005 2:19 PM - 2 messages
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 ? ...
Score How to add a "synonym" to a row ...
rudolf.ball - 4 Nov 2005 1:47 PM - 6 messages
Hi NG, I have a query where I get routes through a city, like this ROUTE              ||    Passengers   ||| A-B-C-D                   144 ...
Score Copy Columns
tonyp - 4 Nov 2005 1:23 PM - 3 messages
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 ...
Score Syntax error converting from a character string to uniqueidentifier
Racer-D - 4 Nov 2005 12:28 PM - 4 messages
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? ...
Score DB Design issue
Toby - 4 Nov 2005 12:13 PM - 9 messages
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) ...
Score Help selecting maximum number of characters
chippy - 4 Nov 2005 12:12 PM - 15 messages
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) ...
Score Stop/Start SQLSERVERAGENT service with Transact-SQL
Ben Rum - 4 Nov 2005 11:07 AM - 5 messages
Is this possible? ...
Score best solution?
da fish & da chip via SQLMonster.com - 4 Nov 2005 10:57 AM - 4 messages
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 ...
Score ADO won't catch error while execute an Stored Procedure, Why?
Bas - 4 Nov 2005 10:44 AM - 3 messages
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] ...
Score Why does this code fail as stored procedure?
Morten Wennevik - 4 Nov 2005 9:48 AM - 5 messages
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 ...
Score Query Analyzer
Paul - 4 Nov 2005 9:46 AM - 3 messages
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? ...
Score SQL Join question
Stefan - 4 Nov 2005 9:17 AM - 4 messages
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: ...
Score Challenge! Trying to understand this piece of code
Morten Wennevik - 4 Nov 2005 8:21 AM - 5 messages
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) ...
Score SP not bring me a value
Enric - 4 Nov 2005 8:00 AM - 5 messages
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) ...
Score How to calculate comparisons of fields between records
tshad - 4 Nov 2005 7:46 AM - 12 messages
Just trying to find out if this was the best solution.  I used the derived table solution of a couple of posts ago. What I am trying to do is to select a record from a table and compare the ...
Score UPDATE TABLE question, please
Alex Nitulescu - 4 Nov 2005 3:54 AM - 4 messages
Hi. I have the following updates to make in a table: a. I have to update SalesBrut to (Sales - [Returns]) where Sales and [Returns] are fields in my table:     SalesBrut = (Sales - Returns) b. Then I have to find out the total of SalesBrut for the whole table, so ...
Score SQL: How to Select MAX(Val1, Val2) ??
bgeris - 4 Nov 2005 3:44 AM - 5 messages
Im trying build a query from c# like below, but its not work, how should I wrote MAX section? int xValue = someIntValue; string sql; sql   = "SELECT xmin, xmax, ymin, ymax FROM COORDS "; sql += "WHERE MAX(xmax, " + xValue.ToString() + ")" >= 100"; ...
Score Dynamic table processing
jrett - 4 Nov 2005 2:46 AM - 5 messages
I'm writing a stored procedure and am trying to update a field which is found in many tables, but I don't want to hard code all the tables into this stored procedure.  I am able to execute a select statement which identifies all the ...
Score How can I store the result to a variable in procedure?
Kane - 4 Nov 2005 2:36 AM - 3 messages
I have a problem when i write procedure on sqlserver 2000. [code] DECLARE @intTotalRecord int; DECLARE @strTables varchar(200); DECLARE @strWhereDescs varchar(200); DECLARE @strSQL varchar(500); SET @strTables = 'MyDB.dbo.MyTable'; SET @strWhereDescs = ' name like ''%kane%'''; SET @strSQL = 'SELECT COUNT(*) FROM ' + @strTables + ' WHERE ' + ...
Score Truncate part of the record
qjlee - 4 Nov 2005 2:22 AM - 5 messages
I have a table called order, in which there is a field called ordertype.  The format of this record in this field is XXX---XXXXX, the number of Xs before --- vary, and do not necessarily 3Xs and 5Xs.  Is there any way I could ...
Score extrapilate data - create many rows from 1 row
Paul the admin - 4 Nov 2005 1:19 AM - 2 messages
I have records in a budget table that contain user startdate, enddate and value. I want to create a view, that contains a row (user, date, value) for each week day (not week-end), and the proportion of the value from the table ...
Score search for record with alpha characters
culam - 4 Nov 2005 12:51 AM - 2 messages
I am a zipCode4 field, and some of them have letters in it. I would like to search those that contain letter(s) in it. Thanks for your help, Lam ...
Score Weird unc vs ip address
ppamco@hotmail.com - 4 Nov 2005 12:20 AM - 2 messages
Hi All Am hoping someone can help me please. I am using bcp to create a csv file on a remote share. If I use the ip address of the remote share as part of the unc path to the remote share I get an access denied error. ...
Score Deleting large amount of data on sql server 2000
harish - 3 Nov 2005 11:43 PM - 26 messages
Hi I am new to SQL server. Hence please help me. I need to delete around 100 million records of a table in SQL Server 2000. One delete statement is creating the transaction log issue. 1) Can I run a DELETE statement without recording in the transaction ...
Score Remote Query Join Performance
Asa Monsey - 3 Nov 2005 11:13 PM - 2 messages
I have a remote query to an oracle table with 81 millions rows in it. The query runs on two SQL servers, both with remote collation and collation compatible turned on. Both execution plans use a nested joop join.  However, on one server, the ...
Score query help...
Bob - 3 Nov 2005 11:05 PM - 7 messages
Hello,     I am kinda lost with this problem and hoping that someone here might be able to help out! The sample data below shows transactions for an ID - basically, for different IDs, we keep track of when their rc (return code) changes and the ...
Score Changing table value being field name
Hendrick - 3 Nov 2005 10:50 PM - 7 messages
Deal all, I have a table with values like : ProductID    ProductName    ProductPrice 1                   Product01        1000 ...
Score Attaching Database 'AdventureWorks'???
Steve - 3 Nov 2005 10:46 PM - 2 messages
Hi, I have installed SQL Server 2005 CTP/Trial Version.  When I try to attach the database 'AdventureWorks', I get the following error. Could not find row sysindexes for database ID 11, Object ID 1, index ID 1. Run DBCC ...
Score Attaching Database 'AdventureWorks'???
Steve - 3 Nov 2005 10:45 PM - 1 message
Hi, I have installed SQL Server 2005 CTP/Trial Version.  When I try to attach the database 'AdventureWorks', I get the following error. Could not find row sysindexes for database ID 11, Object ID 1, index ID 1. Run DBCC ...
Score Display data by Weekly in a specified period
shil - 3 Nov 2005 10:31 PM - 1 message
I am have a table like this Date      Clicks    Impressions -------------------------------------------- 10/1/2005  10              100 10/2/2005   20              100 ...
Score Display data by Weekly in a specified period
shil - 3 Nov 2005 10:26 PM - 1 message
I am have a table like this Date      Clicks    Impressions -------------------------------------------- 10/1/2005  10              100 10/2/2005   20              100 ...
Score Display data by Weekly in a specified period
shil - 3 Nov 2005 10:08 PM - 2 messages
I am have a table like this Date      Clicks    Impressions -------------------------------------------- 10/1/2005  10              100 10/2/2005   20              100 ...
Score Display data by Weekly in a specified period
shil - 3 Nov 2005 10:06 PM - 1 message
I am have a table like this Date      Clicks    Impressions -------------------------------------------- 10/1/2005  10              100 10/2/2005   20              100 ...
Score Next Friday
qjlee - 3 Nov 2005 10:01 PM - 6 messages
I have a table called Order, within which there is a field called orderdate, I can I program so that I can always retrieve order with an order date as next Friday when I am running this script anytime this week. ...
Score dynamically creating temp tables
HP - 3 Nov 2005 9:36 PM - 9 messages
I have a dynamic sql which uses "select into" to create a temp table. It has to be dynamic because the fieldnames are soft coded.I need to join this temp table (that i created using the dynamic sql) with another table.Since the ...
Score limit rows in join
Myles - 3 Nov 2005 9:16 PM - 5 messages
Hi all - I have been trying to figure out if this can be done in one query, or if I need to break it out into multiple queries.  The rows are for a report - so subreports may be the direction I need to go.  ...
Score SQL 2005 question
A.M-SG - 3 Nov 2005 9:11 PM - 3 messages
Hi, Is it a good idea to use SQL 2005 Management Studio to manage/work with SQL 2000 servers? Thank you, Alan ...
Score Updating a column in many rows from values in other tables
HMS Software - 3 Nov 2005 9:03 PM - 3 messages
I am trying to write a update that will update the value of one column in several rows of data.  Basically I want to move a total into a column for easier use later as follows. In English it would be EMP_VARTOT=EMP_VARHRS - (SUM OF TAKEN THIS YEAR) ...
Score Order problem
Kuido Külm via SQLMonster.com - 3 Nov 2005 8:59 PM - 11 messages
I have table valid_until      proposal_date 25.10.2005    NULL 23.10.2005    26.10.2005 NULL              20.10.2005 ...
Score ORDER BY decreases performance by 40x?
John Kotuby - 3 Nov 2005 7:53 PM - 6 messages
I am astounded. I haven't read any where that adding a sort order to a query would drastically increase read time for the same query. This query performed on a table with 360,000 records: SELECT TOP 1000 RTRIM(ID) AS [SEARCHKEY], * ...
Score decimal datatpe with less than or equal
microsoft.public.dotnet.languages.vb - 3 Nov 2005 7:28 PM - 7 messages
Hi All, I have a field whose datatype is decimal. I am trying to see if the value is less than or equal to zero. I am getting Server: Msg 8114, Level 16, State 5, Line 1 Error converting data type varchar to numeric. ...
Score Insert / Compare on multiple columns
Jay - 3 Nov 2005 7:22 PM - 3 messages
TableA contains customer_number,product_id,purchase_date. TableB contains customer_number,product_id,purchase_date. I need to insert everything into TableB from TableA where the entire row from TableA (customer_number,product_id,purhase_date) doesn't already exist in TableB (customer_number,product_id,purchase_date).  How is this possible? ...
Score Why does the presence of a UDF (that is not referenced) in a view cause the execution plan to change
smaully - 3 Nov 2005 6:59 PM - 2 messages
I am running the TPC-H benchmark query 1 and I noticed the execution plan changes drastically if I create a view that projects all of the columns of the table and calls a UDF on a column that will not be ...
Score Query Help: Looking for Nextdate based on many prev date fields
JDP@Work - 3 Nov 2005 6:56 PM - 6 messages
How would I make a query to know what the next step is? Currently I run a query that returns these columns and I manually scan the data to look for issues. I would like to be able to have a NextAction date column, perhaps a case, but ...
Score Stored Procedure question
Altman - 3 Nov 2005 6:15 PM - 9 messages
I am still fairly new to SQL server and I am trying to make a stored procedure that I can do the following: run select statement on a table update a table return the data that was selected in line 1. ...
Score Dynamic SQL
HP - 3 Nov 2005 5:36 PM - 17 messages
I am trying to use "select into" query in a dynamic sql.But the temp table is not getting created when i execute the dynamic sql.What am I missing? Thanks in advance. ...
Score Visual Source Safe & SQL Server
marcmc - 3 Nov 2005 5:36 PM - 1 message
Hey All, I have spent the day running around the web reading about the above thread title. I have used SQL and VSS before without any problem. However, in that organisation we had a dev-->> Rel & Tst environment. In mu ...
Score sysobjects.sysstat
len - 3 Nov 2005 5:30 PM - 2 messages
Does anybody know what the sysobjects.sysstat field is used for and when/if it should be used in programming? It's just that I've found it referenced in some old generated SQL scripts and used in logic (if object doesn not exist ...
Score Row Count on all Tables in Database?
Scott Townsend - 3 Nov 2005 5:28 PM - 3 messages
I'm looking for a way to get a Row count on all of the tables in a Database. Is there a slick way of doing a SELECT COUNT(*)    FROM (All Tables) Thanks,   Scott<- ...
Score Help with Syntax please
Lesley - 3 Nov 2005 5:01 PM - 2 messages
I want to insert @DBNAME before the tables in the from section. Would someone help me with the syntax? Thanks! set @DBNAME = N'AFD.dbo.' SELECT @NumRows = count(*) from @DBNAME + tbl_Revenue Rev, @DBNAME + tbl_RevenueTransactions RevTrans WHERE Rev.RevenueID = RevTrans.RevenueID AND ...
Score SQL Server 2005 & Visual Studio 205 RC
Erik - 3 Nov 2005 4:54 PM - 15 messages
I'm really sad guys... I installed Visual Studio 2005 RC with SQL Express 2005 (included on CD) and it worked very well Today I removed SQL Express 2005  and I was really enthusiastic to install SQL Server 2005 Developer Edition because I belive that is more flexible use ...
Score After insert trigger fires even though no insert actually occured
Steve'o - 3 Nov 2005 4:40 PM - 5 messages
SQL Server 2000 SP3a Have I totally missunderstood and AFTER INSERT, UPDATE trigger as mine fires on an insert being run but with no actual inserts occuring. ie I have a sproc which inserts into a table, I've checked the select ...
Score Openquery issue
jaylou - 3 Nov 2005 4:40 PM - 4 messages
Hi All, I have some peocedures that call stored procedures in Oracle from SQL Server 2000.  the way I am doing this is by inserting into an Oracle table that has a trigger that executes the procs.  I have been doing this for some time now, we needed to add a new proc in ...
Score grouping and showing concatenated varchar column?
Jiho Han - 3 Nov 2005 4:36 PM - 26 messages
When you group and wants to show the aggregate of a numeric column, you do SUM() on it. Is there a way to do this for a varchar type so that all the values are concatenated and separated by a comma for example? ...
Score Code behaviour/performance on 2 machines
Sahil Arora - 3 Nov 2005 4:02 PM - 4 messages
Hi, I have UAT and production servers with same database schema. I am running a stored procedure on both machines, Its taking much more time on UAT (31 hrs) where as it is taking less time i.e. 8 hrs (which is expected because of ...
Score AddNew then getting Unique ID
Bob - 3 Nov 2005 3:18 PM - 5 messages
I have an auto-incremental field in my sql database table.  After I add a new record I need to get that ID.  My below code adds the record with no problems but the ID field I request always comes back empty.  If I look in ...
Score Question abount how to make a Ranking
Tincho - 3 Nov 2005 2:54 PM - 6 messages
Hi friends, i have the following issue for you... On one SQL2000 with SP3, i have one database with one table, with this structure: Servername (char,20) DateOfData (Datetime) DataBName (Char,20) SizeOfDB (int) The purpose of this table is to collect information for a lot of servers ...
Score Primary key is it a must??
Toby - 3 Nov 2005 2:50 PM - 7 messages
Hello everyone,        I have 3 tables namely User,UserRole,Role. User table has userid as the primarykey and all the other user details. UserRole has 2 columns userid referencing User.userid roleid referencing Role.roleid ...
Next »