all groups > sql server programming > november 2006 > threads for saturday november 25
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
Alter Table add column problem
Posted by steve at 11/25/2006 8:48:51 PM
Hi All
I need to add some columns to a SQL server 2005 database
The following TSQL code returns an error 'incorrect syntax near 'setup
devices'
if COL_LENGTH('dbo.staff', '[setup devices]') is NULL
begin
ALTER TABLE dbo.staff ADD
[setup devices] bit NULL
ALTER TABLE dbo.staff ... more >>
How to Parse XML in a stored procedure
Posted by Charlie NO[at]SPAM CBFC at 11/25/2006 8:44:19 PM
Hi:
I would like my stored proc to accept an XML document as a parameter. I
know I can do this with new xml data type, but once I have it stored to a
local variable, what is best way to parse it so can insert the xml data into
tables.
Thanks,
Charlie
... more >>
Help with WHERE clause
Posted by Dave at 11/25/2006 7:08:56 PM
I have a table that associates cars (vehicle ids) with attributes (color,
body style, transmission) and I want to return a list of all cars that have
certain attributes (e.g., a black car with manual transmission).
The table looks like this...
if object_id('tempdb..#attrib') IS NOT NULL
D... more >>
MS SQL : How to get adjacent records?
Posted by mylinuxjourney NO[at]SPAM gmail.com at 11/25/2006 6:58:47 PM
Hi,
Let's say I have 3 records stored in MS SQL in the following order:
ID 4
ID 2
ID 10
I'm doing an classic asp page.
This page have a "Prev" and "Next" Button.
Assuming that Im viewing this page and it reflects record "ID 2",
How am I supposed to retrieve the 2 adjacent records... more >>
Index Tuning Against Restore of Backup
Posted by querylous at 11/25/2006 4:30:01 PM
Is restoring a backup of my current production database to a development
server, running index tuning against it with a sample workload, and then
applying the recommended changes to the production database a legitimate way
to utilize ITS? I don't want to put the load on the production db if I ... more >>
raiserror cariage return line feed
Posted by Robert Bravery at 11/25/2006 2:41:04 PM
HI all,
I have a rather long errormessage that I am returning to the client app via
raiserror.
I would liek to have the errormessage on several line.
How do I insert carriage retun and line feeds to the errormessage
Thanks
Robert
... more >>
Primary Key stops total Update
Posted by Stephen Lynch at 11/25/2006 2:37:29 PM
I'm sure this is simple but I am coming from access and just learning.
My table - ManualContribution has a key on EmployeeUID to prevent
duplicates.
I am trying to go to another table - employees and apend any employees that
are not already in the ManualContribution table. But when I run ... more >>
making a grid display
Posted by Andy at 11/25/2006 1:30:10 PM
I have 2 tables.
Sites:
Site char(3)
Zip Char(5)
Entity Char(3)
Grp Char(3)
Shipments:
Acct Char(4)
I_O_Ind Char(1)
Entity Char(3)
DestZip Char(5)
Originzip Char(5)
DetailNbr Char(1)
Amt Decimal
Sample Data:
Sites:
417,77777,200,300
424,48717,300,400
425,11111,400... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Subquery(?) question
Posted by AlBruAn at 11/25/2006 12:10:01 PM
I’ve been having some difficulty trying to create a sproc to sum values in a
data table based on the value in another field of the same table. My sproc
also needs to be able to output the department name from a second table.
Simplifying the data table’s layout (omitting the primary key, ... more >>
querying text data
Posted by Marc at 11/25/2006 11:15:38 AM
I have an application that stores lengthy news articles in a table using the
TEXT data type. One of my requirements is to display only the first
paragraph of the text in a summary web page. My question, is there a
(relatively) easy way to query ONLY the first paragraph of the data from the
... more >>
multiple insertes and insert trigger
Posted by Robert Bravery at 11/25/2006 10:13:56 AM
Hi all,
New to SQL programming. I created an insert trigger
ALTER TRIGGER [dbo].[PasswordDateupdate]
ON [dbo].[lstUser]
AFTER INSERT,UPDATE
AS
BEGIN
SET NOCOUNT ON;
if update(password)
begin
update lstuser set passworddatechanged = getdate()
end
END
This works well, except that we g... more >>
kill process question
Posted by Keith G Hicks at 11/25/2006 9:53:51 AM
In EM you can stop a statement from running by clicking the red exclamation
mark a second time. You can do the same in QA by clicking the stop button. I
also use another 3rd party tool (Database Workbench) for doing development
work. This tool does not have a feature where you can stop a query fr... more >>
max degree of parallelism
Posted by Sammy at 11/25/2006 8:58:02 AM
Hi max degree of parallelism is set to 0 o my server which I believe enables
all processors to get involved when a large query executes.
I have used the MS Script Sp_blocker80 and it shows a big query with waits
on CXPACKET. When I looked at performance monitor it shows one processor at
60%... more >>
how to write ....?
Posted by merdaf at 11/25/2006 6:48:39 AM
I am pretty new to sql and i need some help.
I have a table with 3 columns:
id (int), date (datetime), country (varchar(30)).
id and date are primary keys.
can u please help me to write this store procedure:
input: @id
output: the row with the latest date for the given id
any help will ... more >>
|