all groups > sql server programming > april 2006 > threads for friday april 28
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
SQL query: is object in a static list showing up in daily results? if so, how many times?
Posted by Randall Arnold at 4/28/2006 10:33:37 PM
The title of this post is a little cryptic but hopefully I can explain well
enough. I asked a similar question a while back, didn't get usable answers
and then thought I'd solved it on my own. However, my current approach to
the query is running way too slowly.
In this case I have a stati... more >>
Loading controls with objects versus recordsets
Posted by mrmagoo at 4/28/2006 9:26:22 PM
I'm building a vb.net Forms project that is getting data from a SQL Server
database.
One of the main goals of the project is to be really responsive to events,
such as textbox change events. I have a textbox for searching, a listbox to
display the searched results, and a big textbox (memo) to ... more >>
How to find Server Collation from SQL 2005 tables/views?
Posted by Mark Findlay at 4/28/2006 7:09:07 PM
Does anyone know what table, view, etc., contains the SQL Server 2005 server
collation (not database collation) value? When I use SQLDMO it returns an
empty string, yet when I view the SQL Server 2005 instance properties in SQL
Server Management Studio, it correctly shows as SQL_Latin... etc.
... more >>
Permissions to debug SQLCLR as non-admin
Posted by Simon Sabin at 4/28/2006 4:47:53 PM
Does anyone now the minimum permissions to debug SQLCLR. I have a friend
trying to develop as a non-admin and he finds that it doesn't work even if
he launches Visual Studio to run as an admin account.
Is it possible? Are there certain rights required?
Simon Sabin
... more >>
2005 Management Studio questions
Posted by rvgrahamsevatenein NO[at]SPAM sbcglobal.net at 4/28/2006 3:29:39 PM
Two things are bugging me:
1) The bug where you get an partial crash in the "Summary" window if
you do something the underlying ListView control doesn't like;
apparently it's an issue MS knows about but when will it be fixed? This
isn't supposed to be Beta anymore! Anybody know more about this... more >>
Help Setting Sum of Column
Posted by tony NO[at]SPAM acslhome.com at 4/28/2006 3:27:42 PM
This seems like this should be easy but I'm struggling. I have an
Items_Sold table with columns for Loc_id, Item_no, Qty_sold, and
Date_sold. I also have an Item_Inv table with columns of Loc_id,
Item_no, Max_qty, and many other columns. I need to update the
Item_Inv table and set the Max_qty... more >>
Results from SP as CSV file (BCP or SQLDMO)
Posted by yitzak at 4/28/2006 2:49:49 PM
Hi
I have an app that executes a stored procs and writes out the data to a
file. Currently uses ADO recordset and goes through each record.
This is slow.
I would like to use bulkcopy - however have the problem that the app
resides on a client machine - so will not have SQL server installe... more >>
Repost: Exporting Information
Posted by Randy at 4/28/2006 2:43:20 PM
Hello NG
We have a production database that we have moved the tables to SQLServer and
I have been creating stored procedures to replicate some of the processes
done on the access side - the server does processing extremely faster than
access - Here is my problem I am currently pulling info fro... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Stored Procedures and several queries
Posted by Rey at 4/28/2006 2:38:32 PM
Howdy all.
Somewhat new to stored procedures...
Have a crystal report that uses a stored procedure but appears to be missing
data...
Background - the original data table was generated through a several Paradox
queries which are now being converted to SQL.
Have done some readings on sto... more >>
Surrogate or Natural Keys?
Posted by Retf at 4/28/2006 2:27:10 PM
Hi All,
I need know: what is best choice:
Surrogate or Natural Keys?
I need understand, what is best?
Thanks
... more >>
Retrieving a distal query plan
Posted by ionFreeman NO[at]SPAM gmail.com at 4/28/2006 2:22:38 PM
Hi!
I have a consultant onsite at a client, and she's sending back
pictures of the query plan for a script with a performance issue. These
are useful, as they're turning out somewhat different from the
development and test machines. But, is there any way we can pass the
query plan so that I ... more >>
Return Null on Unmatched Join?
Posted by Daniel Regalia at 4/28/2006 2:14:02 PM
Greetings and Salutations on this most beautifull Friday...
I have 2 tables that are joined as such:
INNER JOIN dbo.tblSettles ON dbo.aaaBODPNL.ExchangeLongCode =
dbo.tblSettles.trDelta
Is there a way to join it so that if there is not a match to join up to on
the trDelta Table, it return... more >>
Report Syntax help !!!!!!!
Posted by ITDUDE27 at 4/28/2006 2:02:01 PM
Hello,
I was wondering if some one can direct me to a link where code samples are
posted or syntax checkers.
I've taken on this report project using stored procedures, the request is
base on inventory commission for sales reps.
The rep will be paid commission on a $ amt base on the invoi... more >>
Newbie?: Can This Be Done?- If so please direct
Posted by Randy at 4/28/2006 1:33:46 PM
Hello NG
I have been working with Access for a Long Time - Am just now starting
to get my feet wet with SQL Server 2000 - We have a production database that
we have moved the tables to SQLServer and I have been creating stored
procedures to replicate some of the processes done on the acces... more >>
Analyze SPS
Posted by Seanms NO[at]SPAM keeyon.com at 4/28/2006 1:07:53 PM
What is the program microsoft has developed to help optimize Stored
procedures? (I am not talking about the quesry analyzer).
Sean
... more >>
returns null not cost value in SP
Posted by Grant at 4/28/2006 12:53:36 PM
I do not understand what I am doing wrong. I have no problem getting the
value into @tot but I cannot get the value assigned to @item_cost. When I
use the debug mode, it says @item_cost is null before the start of the debug
and after the debugging is done.
CREATE PROCEDURE test
... more >>
whats the difference between these two queries??
Posted by TSQL at 4/28/2006 12:18:02 PM
will there be any difference in query performance between statement1 and 2???
How sql server 2000 treat them ??? do they run in the same manner?
DECLARE @FDOFMONTH AS VARCHAR(30)
DECLARE @FDOFYEAR AS VARCHAR(30)
DECLARE @TO DATETIME
DECLARE @FROM DATETIME
DECLARE @YEAR VARCHAR(4)
DECLARE @... more >>
Could not allocate new page for database 'TEMPDB'.
Posted by Marty at 4/28/2006 12:11:18 PM
I recently had a routine using a table variable involved in a fairly
complex query using a number of fairly large tables which ended with
the following error.
Server: Msg 1101, Level 17, State 10, Line 40
Could not allocate new page for database 'TEMPDB'. There are no more
pages
available in... more >>
Conversion of Access query using First() Aggregate
Posted by ScottW at 4/28/2006 12:09:02 PM
All,
I am trying to figure out how to convert this particular query, and am
stumped...
SELECT tCollatList.CollatID, tCollatList.ListCatID, tlListCategory.Category,
First(tlListCategory.[CatWholeVal%]) AS [FirstOfCatWholeVal%],
First(tlListCategory.Unit) AS FirstOfUnit, First(tlListCate... more >>
problem using default value in SP
Posted by Rich at 4/28/2006 12:08:02 PM
I created an SP for searching rows in a table.
Create Proc stp_search
@recID varchar(100) = '%'
As
Select * from tbl1
Where recID In (coalesce((select * from dbo.udf(@recID)), recID))
The SP works if I pass in only 1 recordID, or if I don't pass in anything
(default val of %). But ... more >>
How to write an T-SQL statement for this complex prob?
Posted by rockdale at 4/28/2006 11:57:33 AM
Hi, All
I have banged my header to the keyboard for 2 days
Suppose I have a log table as following
pointA, pointB, eventTime, event
100, 200, 2006-04-28 14:15:15 Terminate
101, 200, 2006-04-28 14:13:15 Rejected
101, 200, 2006-04-28 14:11:15... more >>
IIF Statement on Select
Posted by rmcompute at 4/28/2006 11:20:02 AM
Is there a way in an SQL Select statement to set up something similar to the
IIf command in Access:
Select LastName, IIf(CodeA = "Y","Yes'","No")
From NameTable... more >>
Data transformations
Posted by CJEN at 4/28/2006 10:34:23 AM
I need to know if I can do this with a CASE statement:
I have a column (Name) in table start that I want to compare to another
column (ProperName) in table finish. If the Name matches any
ProperName then I want to display TransName from finish.
Can I do this:
CASE
WHEN start.name = fi... more >>
how to override/trap Tsql errmsg and use custom errmsg in SP?
Posted by Rich at 4/28/2006 10:09:02 AM
create proc stp_errorTest
as
select 1/0
if @@error <> 0
RAISERROR ('my custom err message', 16, 10)
go
I purposely generate the 'Divide by zero' error. When I invoke the SP in QA
in get the 'Divide By Zero' message along with my custom message. Is there a
way to overrid/bypass/t... more >>
how to get count of occurence of a specific char in a string
Posted by Rich at 4/28/2006 9:25:02 AM
Is there a Tsql function that returns the count of the occurence of a char in
a string? I looked at string functions and various functions return the
starting point of a char or set of chars. Example of what I am looking for
Declare @s varchar(100)
Set @s = 'abc, def, ghi, jkl, mno, pqr)
... more >>
Problem with sum function and group by
Posted by wxbuff NO[at]SPAM aol.com at 4/28/2006 8:36:53 AM
I have a temporary table that includes worker names, titles,
departments and data about meeting our service level agreements over
various incident severities.. I have included some the DDL below...
The problem I have is that the report must also sum (for the counts)
and average (for the percen... more >>
SQL Concatenation
Posted by CJEN at 4/28/2006 8:26:50 AM
What am I doing wrong here?
heat.CallLog.CallDesc + heat.Journal.EntryText AS Expr12
Both of these fields are text fields.
I keep getting this error:
Invalid operator for data type. Operator equals add, type equals text.
Isn't the '+' symbol the operator for concat... more >>
Execute stored procedure for each value returned in a query
Posted by JasonDWilson at 4/28/2006 8:22:02 AM
I have a stored procedure that I am trying to execute passing it each value
returned in a query, but I cannot figure how to do it. I am trying to use
sp_executesql. Here is an example
Query:
(select distinct cust from customer_tbl)
Results:
Cust
-------------------
Cust1
C... more >>
Sql Injection
Posted by Arne Garvander at 4/28/2006 7:54:02 AM
Is the store procedure below secure?
ALTER PROCEDURE myproc
@arg varchar(200)
AS
declare @mysql varchar(300)
set @mysql = 'some dynamic sql' + @arg
exec @mysql
--
Arne Garvander
Certified Geek
... more >>
Exporting to Excel thru an SP
Posted by jaylou at 4/28/2006 5:55:02 AM
Hi all,
I know how to use DTS create a package and use the cammand shell to call the
DTS package.
Is there a way to BCP a table into Excel using windows authentication
without creating the DTS package and calling it?
TIA,
Joe
... more >>
Comparing data structure
Posted by MaK at 4/28/2006 5:51:02 AM
Hi,
The task: we have to two databases. Both evolved from one root in ancient
times. Right now they differ quite a lot. We want to take them both back to
one. To prepare it we have to make some kind of report (no matter what kind –
standalone program, excel sheet, visio diagram) to aid â€... more >>
How to SELECT FROM In-Memory dataset in C# .NET?
Posted by BillJohnson4 NO[at]SPAM gmail.com at 4/28/2006 5:44:01 AM
Experts:
I have built an in-memory dataset by parsing a flat file so that I can
display the contents onto a datagrid.
The Microsoft C# .NET System.Data.DataTable.Select() method allows me
to select all rows that meet certain criteria (just like "WHERE") and
to sort them (just like "ORDER BY... more >>
Help please with updating large amounts of data on SQL Server 2000
Posted by GeorgieBR at 4/28/2006 4:30:02 AM
Hi all,
I am writing an application to look through an Interbase back office
database, detect any changes (by looking at a timestamp) since the last
'synch' and write them to the SQL Server 2000 DB. In general it works fine
with smaller quantities of data, but when I get into the 10,000s of... more >>
insert into statement for image
Posted by Soheil Amjadi at 4/28/2006 4:21:02 AM
hello i would like to know how to insert data into a row of the table car,
that has one attribute with the datatype image. I want to use the insert into
statement from the INSERT INTO Transact-sql information.
Greetings
Soheil Amjadi... more >>
Select from a column that is a variable
Posted by Rui Oliveira at 4/28/2006 3:08:01 AM
I have a variable @column that is the name of a column.
I what use this variable in a select. Some like
DECLARE @column VARCHAR(20)
SET @column = ‘COLUMN_X’
SELECT @column FROM TABLE_X
How can I do this?
Thanks,
Rui
... more >>
Insert multiple lines
Posted by chook.harel NO[at]SPAM gmail.com at 4/28/2006 2:01:48 AM
In MySql this query whould have worked:
insert into TABLE (a,b) values("1","2"),("3","4");
it would have added 2 lines.
It doesn't work in SQL SERVER, and I really need to know
how I can send one big sql string that will add a number of rows.
Thanks, Chen.
... more >>
Location of query results (sql 2000)
Posted by Lan at 4/28/2006 1:45:02 AM
I have a multi user application running with a query to fill GUI components
(Delphi)
I get a 'share violation' for 'del1.mb' (according to a user). All users run
with the same userid/password against the SQL server. Now I wonder where MS
SQL put the resultset from the query and if access righ... more >>
Error connecting to SQL Server 2005 - ... does not allow remote connections?
Posted by Marco Napoli at 4/28/2006 1:13:19 AM
I have an ASP.NET 2.0 Website that in the connection string does not connect
to the local SQL Server but tries to connect to another SQL Server 2005
Server in another State. When I run the application from Visual Studio 2005
it connects just fine. When I published the website to the Live Serve... more >>
System procedure
Posted by Shimon Sim at 4/28/2006 12:19:07 AM
Someone once showed me a system stored procedure that executed some
statement on each table in a database. Can't remember the name of the
procedure.
Does someone know what I am talking about?
Thanks
Shimon
... more >>
Strange behavior with MS SQL
Posted by kn at 4/28/2006 12:05:17 AM
I am running a query and am getting very strange results.
When I run this, it returns 36.
select max(len(source)) from datatable where date > getdate()-1
When I run this, it returns 20.
select source into #temp from datatable where date > getdate()-1
select max(len(source)) from #temp... more >>
trigger for update and insert
Posted by JFB at 4/28/2006 12:00:00 AM
Hi All,
I'm trying to create a trigger to fire an email after a bit field has the
value 1.
MyTable has 4 field the one I'm tracking is fcheck. With the sample above
I'm able to do the email when the row is updated.
What about when is a new row? Can I do it here or I need to create another
t... more >>
best way of making changes to a production database
Posted by Robert Bravery at 4/28/2006 12:00:00 AM
HI all,
We have three verions of our database, one that is in continual development,
do'nt as why, it would take me too long to explain, but they are valid.
ANyway, we have a developer version, which we develop on test changes, crash
etc etc.
Then we have a test version where people can test th... more >>
store procedure
Posted by beachboy at 4/28/2006 12:00:00 AM
Hello all,
there are 2 update query in my store procedure (SP_update_employee)
i want to do is make sure query1 is done and no error and then execute
query2
how i do that?
Thanks in advanced.
... more >>
Guid / uniqueidentifier ...
Posted by Jarod at 4/28/2006 12:00:00 AM
Hey
I have database ( ASP.Net membership ) that use uniqueindentifiers. I don't
need to use this tables manualy so I thought I will just create another
table that uses userGUID and UserID( int ), so it will map pretty quickly,
and applications accustomed to work with UserID as integer will wo... more >>
|