Home All Groups Group Topic Archive Search About

SQL Server database programming

microsoft.public.sqlserver.programming
Score Adv. T-SQL: Finding closest match across multiple columns
Todd Brooks - 28 Jan 2006 11:31 PM - 3 messages
Without resorting to OLAP, I would like a way to query a table of multiple columns to find a match within a specified tolerance level.  For example, if I have a table like below: CREATE TABLE MyTable (     [ID] [int] IDENTITY (1, 1) NOT NULL , ...
Score Using multiple field index when each of the fields already has seperate index
Amir - 28 Jan 2006 11:09 PM - 14 messages
Hi, I have 2 joined tables in SQL Server 7: EVENTS table is holding information for all type of events, and Z_EVENTS table, which holds extra information which is relevant only for events of EVENT_TYPE=2. I apologize for not using DDL. I just don't know how to write that in DDL. ...
Score Improving the Sql environment at our Place ?
Colin Robinson - 28 Jan 2006 9:26 PM - 2 messages
I need to improve the sql setup at my current location (long term contract) Currently there are 100+ msde installations  (1 gb average running a retail back end processes) Backup to disk and tape locally only. 10+ other servers  Running HQ apps including Accouts, Payroll, Credit ...
Score transfer data from remote sql server 2000 to local sql server 2005
Steve_at_BF - 28 Jan 2006 8:11 PM - 2 messages
My objective is to transfer data from a table in a remote sql server 2000 to a table in a local sql server 2005. Any relatively easy way would be OK.  It is OK if it is a manual method ...
Score Tuning Wizard Quits Spontaneously
querylous - 28 Jan 2006 7:56 PM - 2 messages
Hi- I am trying to use ITW on my DB. I'd call it moderately sized; few hundred tables, maybe 100 indexes. DB size is 7GB. I ran a profiler trace (index tuning template) and generated 1700 lines of queries. Then I try to ...
Score FIND OUT IT IS A NUMBER OR STRINg
Savas Ates - 28 Jan 2006 2:00 PM - 7 messages
I have a column with varchar type.. It has some records like this... isbuluyorum 11222 a1285 12r23 How can i find out it is a number or string ? ...
Score COUNT with conditions
Gérard Leclercq - 28 Jan 2006 10:20 AM - 9 messages
SELECT rankingSong, count(rankingPosition) as rankingWeeks, max(rankingPosition) as rankingHighest count(If rankingPosition=1)as rankingWeeksOnTop, FROM tblPositions GROUP BY rankingSong Can i add conditions to COUNT, something like count(If rankingPosition=1)as rankingWeeksOnTop, GL. ...
Score enforce update statement order
éric - 28 Jan 2006 9:53 AM - 6 messages
I have a table with animals in the update statement I have a self join on this table where one animal is joined to itself (by father_id = animal_id) the statement updates a field based on a value obtained from the father's ...
Score SUM
Gérard Leclercq - 28 Jan 2006 7:07 AM - 4 messages
Hi everybody, We keep a hit charts in a database. On the end of the we make a Top 100. So i need to calculate how many points a song have. This is done bu multiply the rankingPosition by a number. ...
Score Send bulk data to SQL
Sirisha - 28 Jan 2006 6:30 AM - 6 messages
hi,    I have to send bulk data to the SQL server. I have an arraylist of the test object and for each test i am making a SQL connection. It is slowing down the process very much. Is there another way to do that. I have a ...
Score Script out whole SQL SERVER Database including INSERT
chirantan.chakraborty - 28 Jan 2006 5:36 AM - 2 messages
Hi All, I am trying to script out a whole SQL SERVER database with all objects in it along with INSERT Statments to populate data into the table.  My goal is to have one single file which I can just run and produce the ...
Score How to perform multi-namespace?
Frank Lee - 28 Jan 2006 1:47 AM - 3 messages
I would like to arrange a table into a multi-namespace, for example, to be db.FM.Accounting.JournalTable.  How to do so? The only way I got is db.FM_Accounting.JournalTable, anyway else? Frank, using sql2005dev ...
Score Query Help
David Tilman - 28 Jan 2006 1:25 AM - 5 messages
I have a database table with data like this (some fields ommited): reserveID   owner    creator -----------   -------    -------- 39009          1            0 ...
Score Help interpreting DBCC CHECKDB output
pshroads - 27 Jan 2006 11:54 PM - 3 messages
I ran DBCC CHECKDB on a database that has corruption. I don't understand which tables it is telling me have problems. I ran: DBCC CHECKDB ( 'qamain1' , NOINDEX ) WITH ALL_ERRORMSGS Here's a snippet from the output: DBCC results for 'tz_datatype_key'. ...
Score Select statement without specifying Field or table name
Justin Doh - 27 Jan 2006 11:45 PM - 6 messages
I am trying to find any record in a table or database where record is empty without specifying column/field name or even table name. What would be the query statement? For example something like; SELECT * FROM table1 WHERE ???? = '' SELECT * FROM ...
Score Notify Apps When DB is Updated
Jeff - 27 Jan 2006 11:09 PM - 2 messages
Just wondering what techniques are generally available or employed when different client application instances must be notified when data changes in a database. For example, assume a basic client/server Windows Forms application that uses SQL Server (2000 or 2005) on the back end. Client1 ...
Score How to group on half-hour increments on a datetime field?
Edgard L. Riba - 27 Jan 2006 9:55 PM - 20 messages
Hi, In my table I have a datetime field (called modtime), and I need to build a select statement that groups by half-hour increments, so that it looks something like: modtime             SUM(sales) ...
Score Hosting a Component in SQL Server 2005 & Security
Baskar Vadivelu - 27 Jan 2006 9:41 PM - 1 message
My environment is 3 tiered. I am developing a system that consumes an external web service. I am going to store the XML document in the MS SQL 2005 database that I will get from the web service. I am planning to develop a ...
Score Reseed identity column in SQL 2000
ktrock - 27 Jan 2006 9:37 PM - 6 messages
Hello. I see that we're not permitted to reseed a incremental column to a value that's lower than the highest value in the table. I guess that's in there for our protection but is there any way around this? On an integer ...
Score SQL Express
jhcorey - 27 Jan 2006 9:18 PM - 3 messages
We have a commercial VB6 app that uses Access.  We want to start using SQLServer, and I see that Express is 'a free, redistributable version of SQL Server 2005' (quote from MS) that we could use as an imbedded ...
Score Slecting from an ordered list Query. Pls help.
MittyKom - 27 Jan 2006 8:56 PM - 3 messages
Hi All I need some help. I have a table. It has 2 columns, ColA and ColDate. e.g ColA  ColDate 1         01/1//05 1         02/12/05 ...
Score Stored Procedure to Make One Table Match Another
Tom Cole - 27 Jan 2006 7:45 PM - 9 messages
I have two tables with identical structures (for example): items_1 id    int    identity item_no    nvarchar   11 description    nvarchar    255 items_2 id    int    identity ...
Score where datefld =... vs datefld Between ... not getting same recor
Rich - 27 Jan 2006 7:43 PM - 7 messages
Hello If I use Where datefld = '1/24/06' my query returns 1 record containing that date.  But if I use datefld Between '1/24/06' and '1/27/06'  it returns 6 records of which 3 are from '1/24/06'.  Why do I not get the 3 records when ...
Score Materialized Views
MAS - 27 Jan 2006 7:34 PM - 2 messages
I'm having a problem creating a materialized view.  Here's the view definition: Create View audit_Report WITH SCHEMABINDING AS select a.audit_id, a.status_id, a.audit_date, a.reference_name... from dbo.audits a join dbo.references r on a.reference_id=r.reference_id ...
Score Date problem
Willie Bodger - 27 Jan 2006 7:21 PM - 7 messages
I want to be able to set-up a job that runs every month on, let's say, the 15th. Now, that job will always look to the following month and pull every transaction of a certain type that falls within that month. So, given that ...
Score Table Scan Cost: 0%
culam - 27 Jan 2006 6:50 PM - 2 messages
I am trying to fine tune some of my Queries and I noticed some TableScan with cost: 0%.  Should I worry about these TableScan? Thanks, Culam ...
Score ExecuteSQLTask Output
sql guy - 27 Jan 2006 6:29 PM - 1 message
Hi I am writing an app in c# that will create a package and utilise the executesql task to execute some sql. from these task, i want to trap the output via a varaible (or any facility available). my code is shown below: ...
Score ExecuteSQLTask Output
sql guy - 27 Jan 2006 6:29 PM - 1 message
Hi I am writing an app in c# that will create a package and utilise the executesql task to execute some sql. from these task, i want to trap the output via a varaible (or any facility available). my code is shown below: ...
Score Return value in SQL
Dgod - 27 Jan 2006 5:27 PM - 2 messages
INSERT INTO table1 .......  (I added a record into a table).  I have an identity field (RecID). I am now recording add transactions in a database.  I want to capture the RecID I just added into another table ...
Score Conditional Where
Brian - 27 Jan 2006 5:12 PM - 4 messages
I have a stored proc that accepts several parameter, one being relocation_id.  If it is passed in I want to add it to the Where clase AND rd.relocateID = @relocation_id Ive been trying to avoid dynamic sql and thought I could do something with ...
Score finding max date
Confused - 27 Jan 2006 5:03 PM - 5 messages
I am not sure how to phrase this query...if i could have MAX in my where clause it would be: SELECT jj.id, jj.lastname, jj.firstname, jj.StartDt, jj.TotalDays, sum(jpm.NbrDaysPaidFor) AS DaysPaidFor, sum(jpm.Amount) AS TotalPaid ...
Score Adding Serial No in the Query Resultset
Ghulam Farid - 27 Jan 2006 4:59 PM - 9 messages
Hi to All! Can any one help me in generating serial no in the query result? e.g. i write a query it gives me 500 rows. select name,fathername from abc name         FatherName ...
Score move row data
Dgragg - 27 Jan 2006 4:59 PM - 2 messages
I have a row that contains invalid information.  I have created another row with the correct data.  each row has a sequence number on it.  The other two fields in each row contain binary data.  how can I move the binary data from ...
Score Running total using day before record.
AshleyT - 27 Jan 2006 4:58 PM - 5 messages
I have 1 record per day with a Daily Difference.  I would like to also keep a running difference.  So I am looking for a way to insert the value for RunningDiff RunningDiff = PreviousDay's RunningDiff - current day's DailyDiff ...
Score Find a certain table in multiple databases
Bob - 27 Jan 2006 4:53 PM - 3 messages
Hello folks. I have a list of servers and for each server I need to loop through all the databases on that server and see if there is a table with the name XYZ (for example). I guess I would start out by going to the master database on the ...
Score Help with a loop to collect database names and tables within those databases.
Matthew - 27 Jan 2006 4:49 PM - 5 messages
I am trying to create a loop that will go though all the databases and collect all the table names. Currently the loop goes around and around till it scans all the databases but only pull from the current database you are in. ...
Score calculate base 32 notation from int value?
jason - 27 Jan 2006 4:23 PM - 10 messages
hello everyone, i have an artificial keying system that is based upon a psuedo-randomly changing 31 bit pattern stored in the database as an int. the current key is stored in a table like so: create table artificialkeys ( keyname varchar(50) primary key not null, ...
Score Joining to large tables to perfrom update
Andy - 27 Jan 2006 4:07 PM - 3 messages
I have 2 large tables that are over 11 million records each.  I need to join them on 1 field and then update 4 fields.  So my script is this update a set a.field1= b.field1,     a.field2= b.field2, ...
Score varchar overflow into an int column
I@n - 27 Jan 2006 3:27 PM - 4 messages
alter    PROCEDURE upGetWarehouseItems     @warehouse_name       varchar(50),   @criteria_name     varchar(50),   @status_name       varchar(50),   @customer_id       varchar(50), ...
Score Service Broker - Queue Priority
bvbone69@yahoo.com - 27 Jan 2006 2:57 PM - 2 messages
Is there a way in Service broker to change the priority of a conversation (or group) within a queue? thanks bv ...
Score SMO - Scripting Indexes (Clustered and Non-Clustered) w/o Primary
JasonDWilson - 27 Jan 2006 2:41 PM - 2 messages
I am writing an SMO console application (in C#) to script out a database.  I am spitting out a seperate file for each type of object.  First and foremost, I am NOT a C# Programmer, secondly, I cannot figure out how to script out ...
Score Alter table and size changes
Darin - 27 Jan 2006 2:34 PM - 2 messages
Question that I hope someone can direct me. I do alter table command to (mostly) add columns to an existing table, but sometimes to change the size of an existing column (such as char(30) changing to char(50)). I remember reading that changing the sze will actually leave the 30 ...
Score Syntax Error in Update
YAHOOid - 27 Jan 2006 2:29 PM - 7 messages
Can't figure out why I am getting a syntax error on this Incorrect syntax near '@RecordID' RecordID is an integer UPDATE CCI SET Insured = @Insured, State = @State, CCICode = @CCICode,   Occupation = @Occupation, PolicyNumber = @PolicyNumber,   PolicyEffective = @newPolicyEffective,   PolicyExpiration = @newPolicyExpiration, ...
Score Linked Servers
Eric D. - 27 Jan 2006 1:54 PM - 2 messages
Hi, I'm trying to create a linked server of DB2. I've tried using the providers "IBM OLE DB Provider for DB2" and "Microsoft OLE DB Provider for ODBC Drivers" but I just don't know what to put in the fileds to create a valid ...
Score Monitoring Changes in SP, Table and Views - Server Objects
Mehul Gurjar - 27 Jan 2006 1:09 PM - 4 messages
Hello,        I would like to monitor the changes in current SQL Server Database Objets like Tables, Stored Procedures, views and Triggers. I would like to store the information in one table and would like to get the report. ...
Score Convert DateTime to String Preserving Format
Ben - 27 Jan 2006 12:57 PM - 3 messages
Hi We have some datetime fields that hold poor data that we want to clean up on the fly (a poor third party system requires it like this). e.g. the field holds just the time: "18:18:23" which is converted to a date ...
Score Optimizing queries
rameshsaive@gmail.com - 27 Jan 2006 11:00 AM - 5 messages
friends, I have the following table with atleast 4,00,000+ records & i want to update some of its fields with the below logic. STOCKEXCDOWNLOAD I've ran the below query in query analyzer with no indexes on this ...
Score MSDE doubts
uday - 27 Jan 2006 11:00 AM - 1 message
i am having a problem with MSDE. My application uses the MSDE databse. Sometimes when my application is trying to connect to database (PMP_v3_0), then the following error is generated: Description = Cannot open database requested in login 'PMP_v3_0'. Login fails. ...
Score Inserting into joined tables
Ant - 27 Jan 2006 10:38 AM - 7 messages
Hi, I need to insert into a set of joined tables. I'm using a select statement as the target 'table' into which it will insert into: INSERT  into dummy as ( SELECT     e.name,     e.email, ...
Score Problem with Cursors
shiva - 27 Jan 2006 10:17 AM - 3 messages
Hi All, i have a problem while using the Cursors, actually i have main cursor, let say "ParentCur"  and i'm definding the another cursor in the Parent Cursor say "childCursor" in the child cursor i'm checking for some validations, ...
Score Recompile Table Functions?
Steve - 27 Jan 2006 10:03 AM - 5 messages
We regularily use functions to return indexed table variables (for a range of dates, products and stores built for the parameters passed in). These are then used to join to tables to return sales information etc. Occassionly, we need to recompile the stored procedures using sp_recompile, ...
Score Field Alias as Function
John - 27 Jan 2006 9:57 AM - 3 messages
I want to change the alias of the fields below to the current month and the month +1  ie datename(month, getdate()) and datename(month, dateadd(mm,1,getdate())), so instead of '1' and '2' I have January and ...
Score Attaach 2000 data file from network drive
Banu_tr - 27 Jan 2006 8:30 AM - 7 messages
Hi How can I attach mdf file without copying it to local disk. I dont have enough space on the server which I have to attach db. But there is enough space on an other server in the network. Thanks ...
Score schema
Alan - 27 Jan 2006 8:28 AM - 2 messages
Hello, I am making a database migration from Sybase SQL Anywhere to SQL server 2005. Under sybase I had functions I use in VB6 applications, and in VB6 I call these functions directly by their names ie: select fGetText(1) ...
Score ex_file
Banu_tr - 27 Jan 2006 7:53 AM - 2 messages
Hi, I have my mdf and ldf files but dont have ndf file. How can I attach db without my indeks file ? Thanks Banu ...
Score load postscript files into sql db
Jack - 27 Jan 2006 7:29 AM - 1 message
We are having a website that generates postscript files when an order is placed on it. These files are placed in a folder on the network. I have been told to Load the postscript files into an existing sql database ...
Score UNION the results from two stored procedures
Scott A. Keen - 27 Jan 2006 5:23 AM - 4 messages
I have two stored procedures which return results in the same column format. I would like to have a third stored procedure which will union the results of the two stored procedures, eliminate duplicates (distinct) and put the results in order by userid. ...
Score Log file size
krygim - 27 Jan 2006 3:27 AM - 3 messages
I find that the following commands successfully decrease the size of the log file: - Backup Log MyDB With Truncate_Only - DBCC SHRINKDATABASE (MyDB) However the following commands (exec one after one) can't decrease the size of the log file: - DBCC SHRINKDATABASE (MyDb, TruncateOnly) ...
Score Stored procedure output parameter does not return value
Steve_at_BF - 27 Jan 2006 3:12 AM - 3 messages
Using Visual Studio 2005, SQL Server 2005 It once worked but now in the code I get no value returned for the output parameter @Msg (I get an empty string).  However in query analyzer I get the right value. ...
Score use UPDATE STATISTICS @table in a cursor
SeanH - 27 Jan 2006 2:20 AM - 3 messages
The script below is a cursor. I get the following error when I run it: --{Server: Msg 170, Level 15, State 1, Line 14 Line 14: Incorrect syntax near '@table'.}-- The error is caused by this phrase: -- UPDATE STATISTICS @table --  How do I ...
Score What's the function to convert Date to "mmyy" varchar
slimla - 27 Jan 2006 1:16 AM - 4 messages
hi Can anyone help in converting A Date format to text and only display month and year? Thanks ...
Score cascading stored procedures
RobKaratzas - 26 Jan 2006 11:48 PM - 1 message
hi folks I'm having a few issues PARAMETERizing cascading stored procedure calls (i.e. HQ Database A, has done it's thing, now call Regional Office AA db to fire off a stored procedure, etc...) Parameterizing EVERYTHING is OK (SERVER, account, pwd, etc.), ...
Score Using TOP
Andrew Chalk - 26 Jan 2006 11:33 PM - 5 messages
Can someone tell me where my syntax is wrong in the following SQL statement. It's something to do with the use of the TOP keyword: SELECT distinct top 1 * from calldetails order by calldate desc I am trying to order the table by calldate and them select the most recent ...
Score How to SELECT data among 4 tables?
Abel Chan - 26 Jan 2006 11:30 PM - 9 messages
Hi there, I have 4 tables: Summary_Table Header_Table Detail_Table_1 Detail_Table_2 Summary_TableID is defined on both Summary_Table and Header_Table.  Summary_Table is like a parent table to Header_Table. Header_TableID is defined on Header_Table, Detail_Table_1 and Detail_Table_2.  Header_Table is like a parent to Detail_Table_1 and ...
Score syntax of user-defined function
Mij - 26 Jan 2006 10:37 PM - 4 messages
Hello, I have the following function and it won't let me pass the syntax.  Help would be appreciated. CREATE FUNCTION dbo.udf_dispMandReq (@empnum varchar(11))  RETURNS table AS  BEGIN     declare @divnum int     SELECT @divnum = DpsDiv_Num FROM vDPSMain WHERE CAST(DpsIndv_StateNum ...
Score Restoring SQL databases
Rob Nicholson - 26 Jan 2006 10:32 PM - 4 messages
We often build databases on behalf of our clients and we're still using SQL 7 as a base level as we can generate .BAK files which can be restored to SQL 7 and SQL 2000. I assume that if we upgraded to SQL 2005 on our production server that we ...
Score Fail part of a Stored Procedures but continue processing
Matthew - 26 Jan 2006 10:31 PM - 3 messages
Here is a fun one, and I am not sure its possible. I have 2 SQL Stored Procedures. The first one calls the second one. All the first one does is grab the next database name and pass that variable to the second stored ...
Score Better way to do a large delete?
Nancy Lytle - 26 Jan 2006 9:40 PM - 8 messages
I have to do a delete from a table with about 25 million rows. I need to delete about 4 million rows, based on the date in another table Table Session SessionID                     SessionDate ...
Score Group by Month
Tod - 26 Jan 2006 9:36 PM - 6 messages
Pardon my persistant newbieness: I have something like this: SELECT     SUM(CASE WHEN ogroup = 'Group_Name' THEN 1 ELSE 0 END) AS 'Open',     SUM(CASE WHEN ogroup = 'Group_Name' AND cgroup = 'Group_Name' THEN 1 ELSE 0 END) AS 'Closed' ...
Score Want to know all the datatypes, lengths and the tables of col in a
MittyKom - 26 Jan 2006 9:32 PM - 3 messages
Hi All I want to know how a certain column called nameID is declared in several tables in a database called DBA. I have noticed that this column has been specified with different datatypes and lenght in the database. I want to know ...
Score SUM of CASE ELSE not matching WHERE clause... why!!!!
Plinkerton - 26 Jan 2006 9:28 PM - 8 messages
The following SQL Sums are not matching up.  Can anyone explain why? SUM(column_a - (CASE WHEN column_b =1 then column_a ELSE 0 END)) FROM my_table SUM(column_a) FROM my_table WHERE column_b <> 1 The first one should subtract column_a from itself, when column_b = 1. ...
Score Concatenating columns with datatype ntext
Naveen - 26 Jan 2006 9:21 PM - 4 messages
How can I concatenate 2 columns, both of type ntext, in a select statement? I get the following error. "Invalid operator for datatype. Operator equals add, type equals ntext" ...
Score Re-Index Script
Joe K. - 26 Jan 2006 9:21 PM - 3 messages
I would like to re-index two tables (t1 and t2) if the logical scan fragmentation is greater 80% on these tables. Please help me create a t-sql script to create this task.  Thank You, ...
Score 3-way, 4-way, n-way full outer joins?
Ian Boyd - 26 Jan 2006 9:12 PM - 3 messages
/* NOTE: you can paste this all in QA i want to perform a 3-way full outer join on 3 tables (in reality it is against 3 views, but my sample DDL here is tables). i want the 3-way join to be Customer,Year,Month ...
Score dateserial eqivalent
Erez Mor - 26 Jan 2006 8:29 PM - 4 messages
hi all what is an equivalent to VB's dateserial (if any)? thanx, erez ...
Score CS0117 error accessing SMO DatabaseCollection.Item property
Rick Razzano - 26 Jan 2006 8:24 PM - 1 message
When I run the code below, I get the following error: 'Microsoft.SqlServer.Management.Smo.DatabaseCollection' does not contain a definition for 'Item' I am using .NET 2.0.50727.42 with the RTM release of SQL Server 2005. The documentation for the DatabaseCollection object includes the Item ...
Score Find all read-only Databases using Stored Procedure
MKruer - 26 Jan 2006 7:54 PM - 2 messages
I am running a Stored Procedure that goes through all the databases and reindexs them. However when it reaches a database that is "read only" the program quits with an error. If there an easy way to determine if the database is Read only and skip it if it is? ...
Score Help with constraint
Star - 26 Jan 2006 6:51 PM - 10 messages
Hi, I have a table where I want a certain condition with 3 of its fields. I want only 1 of them not to be null. For example, if the fields are A,B,C these combinations are ok: A       B      C ...
Score Need to change a table name from all sp's
Tejas Parikh - 26 Jan 2006 6:51 PM - 10 messages
Hey guys. I've a few sp's. This sp's are doing some inserts and updates in a table I need to setup a job to run every4 hours. And at at 12 am, it's supposed to insert in table1 ...
Score Need to script out a sp from Query Analyzer into a varable
Tejas Parikh - 26 Jan 2006 6:51 PM - 4 messages
I want to do something like this. declare @x ntext set @x='' select @x=@x+text from syscomments where object_name(id)= 'report_assetComponent' select @x When I do this, it tells me that ntext can't be a local var. The problem is, ...
Score Checking Settings?
Brian - 26 Jan 2006 6:01 PM - 3 messages
I have an existing view, I didn't create.  It runs, but I was running it through a 3rd party tool Toad to do some tuning and it gve me an error saying, "SELECT failed because the following SET options have incorrect ...
Score Table design (search with ranking)
Patrik - 26 Jan 2006 5:50 PM - 12 messages
Hello! I am trying to design some tables to solve this problem. The main goal is to have a very good performance, but still have a good design. I am trying to build a search function with a ranking system. The search ...
Score Paging of Large Results Using Server Cursors
Mohamed Salah - 26 Jan 2006 5:39 PM - 2 messages
I'm writing an ASP.NET application that uses a SQL Server 2000 database. The application searches in large tables with 500, 000+ Records and then displays the search results, the search results could be easily 20,000 or 30,000 ...
Score Execute Stored Procedure Using Select Statement As Parameters
Jig - 26 Jan 2006 5:22 PM - 3 messages
Hi, I'm trying to run a SP with a select statement.  Example below: Stored procedure: uspI_InsertUsername (@Username VARCHAR(50)) SQL Statement: EXEC uspR_InsertUsername SELECT Username FROM TempUser Will this work? ...
Score How does engine decide whether to scan or seek index
Neil Waldie - 26 Jan 2006 5:21 PM - 9 messages
Hi, I'm working on an application that uses SQL Server 7 as a back end. Nearly everything in the database references one table with the following columns. generation_id int (primary key) entity_id int effective_from datetime effective_to datetime active tinyint ...
Score Remove trailing zeros
kafi - 26 Jan 2006 5:07 PM - 10 messages
Hi; I want to remove trailing zeros from the results produced by stored procedure. SELECT rdts_SizeIN FROM CatalogSQL.dbo.RuptureDiskTypeSize WHERE [rdts_RuptureDiskTypeID]=@rdts_RuptureDiskTypeID and rdts_Active =@Active rdts_SizeIN is a decimal field in the table. Resulting data maybe: 0.2500 0.5000 ...
Score Difference in deleting method
jw56578 - 26 Jan 2006 5:04 PM - 5 messages
What is the difference in doing a Delete Table where x=y VS. Delete From Table where x=y ...
Score Need help with TSQL syntax and JOIN.
Wade - 26 Jan 2006 4:34 PM - 3 messages
Hey all, I'm having problems with a TSQL query, and I know someone out there can help. Note the following: ...
Score Nightmare Query
CJM - 26 Jan 2006 4:32 PM - 8 messages
It's probably a piece of cake for those in the know but it's proving hard work for me... Scenario: I developing a report for a system that managed a filter exchange business. Basically filters are sent to/from customers to our business. I'm ...
Score trouble using dates in dynamic SQL string
tommcd24 - 26 Jan 2006 4:22 PM - 9 messages
I have a stored procedure which uses dynamic SQL  using parameters from a Windows app. Two of these parameters are date fields, but the stored procedure keeps bombing on the section of my string that appends the date values indicating: "Syntax error converting datetime from ...
Score Calculating Row Size
A. Robinson - 26 Jan 2006 4:20 PM - 8 messages
A couple of questions regading table size: 1. Why is the size of a table reported by Enterprise Manager in Table Info so different than the size that is returned when using sp_spaceused? 2. I've found the calculations but was wondering if there exists a system ...
Score DBCC SHRINKFILE causing massive disk queues
DC - 26 Jan 2006 3:59 PM - 5 messages
Hi, I am using a database with massive update and insert action and therefore shrink logfiles every 15 minutes since the logs explode otherwise. Shrinking the logs results in a massive performance hit and usually takes about three minutes with huge disk queues. ...
Score SQL UPDATE Trigger causing "Connection Busy" in App
Mike Trebilcock - 26 Jan 2006 3:46 PM - 4 messages
I have an App that is the front end to a SQL 2000 DB.  The business rules in the App no longer fullfills all the business requirments.   At while ago a consultant was brought in and created a trigger on one of our tables that connects to a seperate database and gets some details that are used to also update the row that is being updated. ...
Score Problem with DateAdd & GetDate()
Jason - 26 Jan 2006 3:36 PM - 12 messages
Hi, I've been struggling trying to figure out this code to no avail.  I need to query a date time field on an external database to give me data if the Closed_Time has changed within the last day.  The Closed_Time field looks ...
Score Inserting or Updating a View
Paul - 26 Jan 2006 3:32 PM - 2 messages
In Sql 2000 or in Sql 2005, what is the best way to INSERT or UPDATE a View? For example, I have three tables: zWoof, zSonOfWoof and zGrandsonOfWoof. Woof has Columns WoofID(key) and WoofName(nvarchar). SonOfWoof has cols SonOfWoofID, WoofID and SonOfWoofName. ...
Score Multiple-step OLE DB operation generated errors.
Dmitriy Shapiro - 26 Jan 2006 2:59 PM - 20 messages
Database: SQL Server 2000 Standard (works fine) Database: SQL Server 2005 Standard (fails) Provider: SQLOLEDB We can update recordset field (database: MS SQL 2000, client side cursor, adLockOptimistic), regardless of the recordset's source (query or stored procedure) The problem begins with SQL 2005. We cannot update recordset field, if the ...
Score Select something that exists in a sub clause
Tim P - 26 Jan 2006 2:12 PM - 6 messages
Hi I've been using Select * FROM tblSomething WHERE SomethingID IN (Select Distinct SomethingID From tblSomethingElse WHERE SomeConditionsAreTrue) in MSAccess quite successfully, but it doesn't seem to work in SQL Server 2k. Is the syntax different in SQL Server? ...
Score Update sql server from spreadsheet
fireloard - 26 Jan 2006 2:04 PM - 2 messages
I have a SQL server I want to update from a spreadsheet. There is data in the table already and I can't clear it but I need to do an UPDATE from the spreadsheet to the sql server? I'm guessing this may be a data ...
Score Copying SQL Stored Procedures (SQL Server 2000)
Ian Henderson - 26 Jan 2006 1:11 PM - 4 messages
Hi folks I am writing a humdinger of a stored procedure, which I can use to automatically create a second copy of a database, and ensure that the tables, etc, are all of the same specification. Here's what I've done so far: ...
Score SQLConnection via proxy?
BadgerByte - 26 Jan 2006 12:47 PM - 3 messages
Hey, I have a .Net Windows Application which in some circumstances needs to make a connection to a remote SQL server instance over the internet.  Where a local internet connection is present  this works fine, just entering the IP ...
Next »