all groups > sql server programming > march 2005 > threads for saturday march 12
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
SHOWPLAN_TEXT
Posted by kevin at 3/12/2005 7:19:48 PM
Hi guys,
I want to create store procedure called "GetQueryPlan",
CREATE PROCEDURE GetQueryPlan
@Enabled INT=0
AS
IF @Enabled=1
exec master.dbo.sp_executesql N'SET SHOWPLAN_TEXT ON '
ELSE
exec master.dbo.sp_executesql N'SET SHOWPLAN_TEXT OFF'
Howev... more >>
Need help with complex select
Posted by dw at 3/12/2005 5:47:14 PM
Hello, all. I have a student voting application on SQL Server 2000. Once
everyone has finished voting, I need to display the results broken into the
various categories (offices) and subcategories (sophomore, junior, ...).
Here's the table that holds the votes,
CREATE TABLE [Votes] (
[voterID... more >>
Complex UPDATE
Posted by Stephen Howe at 3/12/2005 5:11:11 PM
Given the 2 tables Sponsor and SponsorEvent with SponsorID on SponsorEvent
as a FK
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
CREATE TABLE [dbo].[Sponsor] (
[SponsorID] [int] NOT NULL ,
[SponsorCode] [char] (15) NOT NULL ,
[BrandID] [int] NOT NULL ,
[FirstDate] [int] NOT NULL
) ON [PRIMA... more >>
Calculating Holidays
Posted by Michael C# at 3/12/2005 2:19:35 PM
Hi all,
I want to calculate holidays for the next 10 years and store them in a
table. Unfortunately a lot of holidays are defined as "the <nth> day of
<Month>." Has anyone done this already, or can you point me to a website
that describes how to do this before I re-invent the wheel?
Th... more >>
money and accuracy
Posted by Keith G Hicks at 3/12/2005 2:16:00 PM
What's the best way to avoid the problem of being off by a cent or 2 in
money calculations due to internal floating point rounding? Does using the
"money" datatype solve this alone? Do you need to use all "integer" data
types insetad and handle displaying the data appropriately manually? I don't... more >>
READTEXT error
Posted by Rlane at 3/12/2005 1:31:01 PM
I can't figure out I continually get a msg 7124 error using READTEXT.
The script:
DECLARE @TextfieldPtr varbinary(16)
DECLARE @CommentsBytes int
SELECT @TextfieldPtr = TEXTPTR(TextComments)
FROM Comments
WHERE CommentId = 25
SELECT @CommentsBytes = DATALENGTH(TextComments)
FROM Comme... more >>
Best Advice
Posted by Peter Newman at 3/12/2005 12:37:04 PM
I have a table containing 65 fields. One of the fields is a varchar(6) field
which is unique and contains a client number . witin the 64 other fields
there are 10 'PIN number' fields ( PIN1, PIN2 etc ) and i need to check if a
given pin exists
ie check if '123456' exists in PIN1, PIN2 - PI... more >>
Capturing stored proc names in profiler
Posted by Oliwa at 3/12/2005 12:31:17 PM
Hello,
I was wondering if anyone had some insight into my problem.
I'm running a trace and I want to generate a report to show some simple
statistics about the duration, reads, and writes for the stored procedures
in my database. I'm having trouble parsing the stored procedure name from
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Help with Query
Posted by Marek at 3/12/2005 11:55:02 AM
Hi,
Am trying to work out how to perform a query. I have a table which contains
finance cost codes (tblCostCodes). I have another table that contains
Customers and the Cost Codes used by that Customer (tblCustomerCostCodes) -
they are related by the CostCode field. What I want is to be a... more >>
recompile sp
Posted by Ed at 3/12/2005 9:11:09 AM
hi,
I understand if the table structure is changed in terms of index and
column, sp needs to be recompiled. is there anyway to tell if it is
necessary to recompile the stored procedure.
Thanks
Ed... more >>
Select Top X problem
Posted by Adrian at 3/12/2005 7:42:55 AM
Using the following DLL
=======================================================
CREATE TABLE [Test] (
[Job] [int] NULL ,
[Area] [int] NULL ,
[Town] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Road] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[AddressID] [in... more >>
limite the resource a stored procedure can use
Posted by guoqi zheng at 3/12/2005 4:45:17 AM
Dear sir,
Some times, some unimportant stored procedure on my application are using
too much resource, etc 50% of CUP power. Is there a way to set the priority
of a SP or limite the max resource it can use?
thanks,
Guoqi Zheng
http://www.ureader.com... more >>
Concatenate a string in SQL
Posted by Jon A at 3/12/2005 3:23:07 AM
I have a char(10) column in a table, I would like to concatenate the string
to a variable with coma's in between the strings. I currently use a cursor.
Can any one think of a better way?
--
Thanks,
Jon A... more >>
How to solve this problem through SQL Server 2000 newid() procedur
Posted by JoseTA at 3/12/2005 1:03:01 AM
I have two tables like this:
1. Transfer Table: TranID, TranDate, PlaceID,..., Amount
2. Place Table: PlaceID, PlaceName
I am sending the money one place to another place, like that I will receive
the money from their also and will update in one database. so need some
unique identification.... more >>
|