all groups > sql server programming > may 2006 > threads for wednesday may 31
Filter by Day: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Debugging Stored Procedure
Posted by RKNET at 5/31/2006 9:11:01 PM
How to Debug the Stored procedure in SQL 2005.
I thnk its thru VS, pls let me know the details or any references.
Thanks
--
RKNET... more >>
How to write this query?
Posted by VJ at 5/31/2006 8:43:28 PM
I've a Bill of Material table that looks some what like this:
Table BOM:
Part# Component#
1 A
1 B
1 C
A X
A Y
B M
B N
B O
B P
B Q
B R
R ... more >>
Email Trigger
Posted by panda at 5/31/2006 8:02:02 PM
Hi.
I am trying to set a trigger to send an email notification. is this possible
in SQL 2000?
What i am trying to do is send an email saying that a client has been here
for 12 months and would like to raise the rent.
Regards Wilbur... more >>
SQL2K & SQL2005, Can they coexist?
Posted by Jorge Luzarraga at 5/31/2006 7:35:00 PM
Hi,
I wonder If I can have both SQL2K and SQL2005 installed on my windows XP
box.
TIA,
Jorge Luzarraga C
... more >>
SQL Server 2005: client-connectivity changes?
Posted by KJ at 5/31/2006 4:52:32 PM
Hello Everyone,
I would like to know if there are any major changes in client
connectivity when connecting to SQL Server 2005 vs. SQL Server 2000.
I know about a few of the new things, such as using Native Client,
Shared Memory, and the Dedicated Admin connection. Are there other big
change... more >>
using master..sysdatabase return an error message in MSSQL 2005
Posted by Jodie at 5/31/2006 4:38:01 PM
Hi All,
I ran the following sql statement in the command line :
osql /Usa /Psa /Sjpham-pc -l60 -Q"select version
from master..sysdatabase where dbid=1" -o file
and the error message return back is :Invalid object name
'master..sysdatabase'.
It worked on MS... more >>
double vs decimal in high-frequency db
Posted by CP Developer at 5/31/2006 2:46:02 PM
I am storing financial data (stock prices, profit and loss figures, etc..) in
a SQL 2005 database. The database will be updated with a high frequency. I am
debating whether to use decimal or double/float to store these values and I
am concerned that using decimal will slow down the database. S... more >>
Sql error not being caught within vb.net 2.0
Posted by hardingaj NO[at]SPAM ilga.gov at 5/31/2006 2:07:27 PM
Here is a sample Stored Procedure:
Create PROCEDURE spSample
AS
SET NOCOUNT ON
DECLARE @ErrorMsg varchar(8000)
BEGIN TRY
--the following error will be caught and returned to vb.net 2.0
--declare @var int
--select @var = 1/0
--the following error will be caught but will not be retu... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Sub-Query
Posted by Eric Stott at 5/31/2006 2:05:14 PM
I have a requirement that I need to extract person's data from multiple
tables, along with checking to see if they are twins. The 'twin' logic is if
they have the indicator of 02, 03, etc. as the dependancy code and they have
the same sex and birthdate are the same.
so my query looks somethin... more >>
Update multiple records - SQL
Posted by Keith Kubicek at 5/31/2006 2:04:23 PM
Thanks Dan, I alread tried = and got the same error.
Where would I find an update trigger (on the Inventory table)?
--
Keith Kubicek
------------------------------------------------------------------------
Posted via http://www.codecomments.com
----------------------------------------... more >>
transport-level error
Posted by none NO[at]SPAM no.com at 5/31/2006 1:53:02 PM
Hi,
I'm accessing a pair of databases with ASP.NET 2.0 (ADO),
and using stored procedures on the first database access.
SQL server 2005 is local: Client and server are on the same box.
The first access works OK - everything gets written
to where it's supposed to be.
On attempting to wr... more >>
Parameter Queries
Posted by MikeV06 at 5/31/2006 1:31:45 PM
If I understand what I am doing ....
I can run an unnamed parameter query in Query Analyzer
SELECT au_lname, au_fname
FROM dbo.authors
WHERE (state = ?)
However, that is about all I can do with it. I have not been able to do
anything with named parameter queries.
I gu... more >>
Mobile 5.0 app can not connect to SQL 2005 Express
Posted by RedHair at 5/31/2006 12:18:21 PM
I'm using VS2005 pro to develop one windows form and one Mobile5.0 app ,
they are simple apps and just connect to SQL server to get data. The SQL
servers include Win2K + SQL2K, Win2K3 + SQL2K5 std and Win2K3 + SQL2K5
Express.
All works fine until one day I updated Win2K3 patches to the sql se... more >>
Rounding very small negative numbers to string
Posted by Alan Z. Scharf at 5/31/2006 12:16:36 PM
Hi,
I'm trying to round a very small negative number, e.g. -.024, to a string.
If I round -.024 to 1 place, I get 0.0
However, when converting to string, I get .-0
Is there some combination of functions to get rid of the minus sign in such
a situation, or do I have to put in an IF condi... more >>
temp tables
Posted by Lianne Kwock at 5/31/2006 11:17:02 AM
Hello,
I experienced extreme slowness on performance when I did multiple joins on
global temporary tables, I checked the query analyzer plan and found out that
multiple table scans were occuring. Does anyone know why the system behaves
like that?
The following is a sample of my query af... more >>
MOD Equivalent in SQl Server?
Posted by Greg Toronto at 5/31/2006 11:15:02 AM
I'm trying to build a query that I'd like only run on records with an odd
number in a specific field.
Using the "MOD" function, I'd simply throw a criteria in that says where
"Field Mod 2 <> 0"
Is there a mod function in SQL Server 2K? I can't find it... If not,
what's my alternative?
... more >>
How can I implement error handling within a SQL script that uses b
Posted by Dave at 5/31/2006 10:36:02 AM
I am trying to incorporate error handling into a SQL script that creates
several database objects.
Those objects are referenced later in the script by other blocks of code.
It is my understanding that I need to use a new batch to reference an object
that was just created. I can do this by... more >>
Run Script from drive location
Posted by Jaco at 5/31/2006 9:36:01 AM
Hi,
How can I run a script in a job and call it from a drive location?
ie. the script file will be located on a network share.
The script is more than 3200 chars so I cannot call it in the job step.
Thanks.... more >>
sp_executesql not working
Posted by Mike at 5/31/2006 8:53:44 AM
Greetings,
We are trying to use sp_executesql to perform integration of SQL Server
2005 with a .NET application. We are receiving an error "Incorrect
syntax near <sp_name>" which we have been able to verify is working via
direct query.
So in other words, ...
sp_name
....succeeds, wher... more >>
Extended Property
Posted by S Chapman at 5/31/2006 8:29:57 AM
How do I query the extended property of a column (like MS_Description
property). I run the following query and SqlServer returns nothing. But
I see the description in enterprise manager. Am I missing anything here
please?
SELECT *
FROM ::fn_listextendedproperty (N'MS_Description',
N'us... more >>
@return_status from SQLCLR stored procedure
Posted by Greg Larsen at 5/31/2006 8:29:02 AM
I'm trying to write a VB CLR stored procedure that will set the return status
to 0 or 1 depending on whether the CLR was successful or not. How do I do
that? Basically I want to use the following T-SQL code to call my CLR and
set the @return_status
declare @return_status int
EXEC @return... more >>
Combine two int columns into one bigint column
Posted by kerplunkwhoops NO[at]SPAM yahoo.co.uk at 5/31/2006 6:59:35 AM
Hello
I have created a database that uses an int for the table primary keys.
This database is being deployed at several sites. Each site has a
unique site ID which is less than 100.
There is another database that acts as a master viewer. This database
holds a copy of all the site database... more >>
SQL select question - simplify my code pls
Posted by Swoosh at 5/31/2006 6:03:18 AM
I have this select:
SELECT [Category_ID], [Category_Cd], [Category_Dsc]
FROM [PMO_TBL_EMP_CATEGORY]
it returns me a nice small list (3 columns)
whic is the easiest way to have a 4th column which contains Count(*)
So basically i want to do this:
SELECT [Category_ID], [Category_Cd], [Cat... more >>
Select - Basic Question
Posted by S Chapman at 5/31/2006 5:28:07 AM
In terms of performance which one is better?
1. SELECT * FROM table_name
OR
2. SELECT column1, column2........lastColumn FROM table_name ?
Thanks
... more >>
Pass record to user-defined function and create xml
Posted by porsch55 NO[at]SPAM yahoo.com at 5/31/2006 5:15:06 AM
Does anyone know if there is a way to pass a record from a select to a
user defined function in SQL Server 2000? The number and names of the
columns in the record will vary depending on the upload temp table
selected from... You should be able to see what I am trying to
accomplish bellow... If y... more >>
Datalength of unicode and non-unicode types?
Posted by pedestrian via SQLMonster.com at 5/31/2006 2:35:18 AM
I'm using SQL Server 2000. Suppose I'm in Northwind database and
I execute the following query:
SELECT Notes, Datalength(Notes) As 'Text length' FROM Employees
The results of 'Text length' shows 2 X total characters because
Notes is of type ntext (Unicode type).
Q: How to form a query ... more >>
Data type problem
Posted by Chandra at 5/31/2006 2:22:02 AM
Arithmetic overflow error converting numeric to data type numeric.
I'm getting this error when I'm trying to insert.
this is my SQL
insert into ABSCTRL
( ID, column1 )
values ('123',12)
ID is char (4)
Column1 is decimal(4,1) in the database table.
Please let me know why I'm ge... more >>
Using Aggregate functions in joins
Posted by Rajeev at 5/31/2006 12:17:28 AM
Hi,
SELECT
amount,
currencycode
FROM
Expenses (NOLOCK)
We have to select the latest exchnage rate from other table
EXCHANGE_RATE.. this table will contain exchange rate of every date. We
have to take the exchage rate for the latest day and use for
calculating amount in the expenses tabl... more >>
getting null values
Posted by Frederik Vanderhaeghe at 5/31/2006 12:00:00 AM
Hi,
I want to build up a table with which hours my site is being watched, i have
the data in a table and i can get it out. But what I get is just the hours
that it has been watched and for the hours that haven't been watched I would
like to get 0.
Example
0 0
1 5
2 0
3 0
4 ... more >>
Simple Question - update statment
Posted by Agnes at 5/31/2006 12:00:00 AM
I got a field whose date is '2006-04-30'
How can I update statement to change the date into '2006-04-01'
thanks a lot
... more >>
Leading zero's
Posted by Bart Steur at 5/31/2006 12:00:00 AM
How do you add leading zeroes to a string when converting a number?
ie. Number = 300
CONVERT(varchar,Number) results in '300', but I would like to have
'00000300'
How?
... more >>
Stored Procedure input string parameter
Posted by Alan at 5/31/2006 12:00:00 AM
CREATE PROCEDURE Demo_FTS @SQL varchar(128)
AS
select * from openquery(demo, @SQL)
GO
Anyone knows what did I do incorrectly ?
I got error: Incorrect syntax near '@SQL'
... more >>
generating DDL
Posted by arch at 5/31/2006 12:00:00 AM
In Oracle, there is a system packaged function that returns the DDL for a
database object (DBMS_METADATA.GET_DDL). What is the equivalent in SQL
Server?
... more >>
order by day
Posted by Frederik Vanderhaeghe at 5/31/2006 12:00:00 AM
Hi,
I have a query but I would like the result to be:
sunday monday tuesday wednesday thursday friday saturday
44 157 153 222 74 455 22
how can i assure that it is sorted by day?? Always first sunday, then
monday, ...
Fré
... more >>
How SUSER_SNAME works?
Posted by Pushkar at 5/31/2006 12:00:00 AM
Hi,
I want to use SUSER_SNAME() in my application, but I don't how does this
function resolves the windows SID.
In whose context it does the resolution?
I have added a Windows group of a trusted domain to my SQL Server and then a
memeber of that group connect to SQL Server, then how does SQL ... more >>
|