all groups > sql server programming > january 2007 > threads for friday january 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
Displaying rows vertically.
Posted by Ant at 1/12/2007 11:25:00 PM
Well, in a sense...
Hi, I need to create a set of monthly totals, however, the months need to be
displayed as columns with the totals being displayed in the row beneath it.
Row 1 = month, row 2 = total.
I have a table that has a datetime column. I can use this to group the
totals into mon... more >>
How to debug
Posted by zwieback89 via SQLMonster.com at 1/12/2007 11:10:13 PM
Hi,
Any ideas as to how I can debug a stored procedure?
This stored procedure has no parameters.
It grabs data from a base table, dumps the data into a Tree table, then it
builds a Stack table to build the Org Structure.
I just want to step line by line and see what values are inserted ... more >>
query help!
Posted by Jami at 1/12/2007 11:09:34 PM
Hi!
i have a following sample data
create table mytab
(region char(3),total int, mt int , st int,ryear char(4),rmonth char(3),
rday char(2))
go
insert into mytab values ('AAA',50000, 20000,30000,'2006','Jan','01')
insert into mytab values ('AAA',60000, 25000,35000,'2006','Jan','12')
inse... more >>
How to:Make a view index
Posted by Nassa at 1/12/2007 10:21:48 PM
Hi all,
Do I have to make a view index from one table or I can join different
tables then make indexes?
What is different between view index and table index?
Thanks,
Nassa
... more >>
Documenting database
Posted by Robert Bravery at 1/12/2007 10:04:07 PM
HI all,
Where can I find information or have can I, document my database
Thanks
Robert
... more >>
deterministic UDF causes reads on *some* servers
Posted by JXStern at 1/12/2007 9:11:59 PM
Have a big select, somewhat complex (does a pivot), that uses a few
simple UDFs to format money fields into strings with commas, etc,
something like:
select
f1 + dbo.myudf(f2) + f3 + dbo.myudf(f4) as myresult
from whatever
inner join something ...
left join somethingelse ...
(actua... more >>
how to change views column data type
Posted by meghana via SQLMonster.com at 1/12/2007 8:53:45 PM
OLAP ERROR:
unable to open the record set
the count-unique aggregate opration cannot take a uniqueidentifier data type
as an argument
The workaround is to create a view within SQL Server that converts the
uniqueidentifier data type column(s) to a char(n) or varchar(n) data type.
so i am ... more >>
Duplicating a database
Posted by Robert Bravery at 1/12/2007 8:35:23 PM
HI all,
I have a developer database and a live database. I need to be able to delete
one of them and copy the other over again
So if I delete the developer database, I want to make a copy of the live one
into the same name as the developer one.
I've tried detatch, copying via OS, atach,; scri... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Restoring backup SS 2005
Posted by Sandy at 1/12/2007 7:55:01 PM
Hello -
I am trying to restore a Sql Server 2005 backup to Sql Server 2005 on my
home machine. I am getting the following message:
The backed-up database has on-disk structure version 611. The server
supports version 539 and cannot restore or upgrade this database . . . Error
3169.
... more >>
Insert Spaces in the text
Posted by Divyesh at 1/12/2007 3:31:35 PM
Hello,
I have a field with the following type data
1
12
3
B-2
B-3
B-C-2
B-C-3
BB
BBB
D-3
D-30
EEEE-3
JJJJ-N-A-B
I would like to insert spaces and replace hypens and update another
field with new value. How can I get the following result for above
example
1
12
... more >>
Multiple Replace([ ?
Posted by TommyT at 1/12/2007 3:07:18 PM
Tom
Can I use the replace function more than once in a query return?
I have a column returning
enroll
I
S
I
D
D
I
S
D
I
C
S
D
I
I
C
D
I need to replace the I's with 6's and remove the D's, S's and
C's
I can replace the I's with 6's using
Expr1: Replace([enroll],"I... more >>
copying stored proc to another server
Posted by Rick Charnes at 1/12/2007 1:49:58 PM
Using SQL Server 2000, I only have Query Analyzer and don't have access
to Enterprise Manager. What's the best way to copy a stored procedure
from one server to another? Thanks.... more >>
How to know when server started
Posted by Mike Hudson at 1/12/2007 1:27:34 PM
Is there any way(command) to know when the server got started.
Thanks, Mike
... more >>
join a table value with a field name
Posted by Blasting Cap at 1/12/2007 11:42:48 AM
Not so sure what I'm trying to do - at least as far as how I've got to
this point is concerned.
I have the following query, that will read an input table with a 2
character field on it called DC. When it does that, I end up creating a
new table with fieldnames of the records on that table.... more >>
DISTINCT
Posted by obelix via SQLMonster.com at 1/12/2007 11:17:36 AM
What are the prons and cons of using a DISTINCT and what alternatives are
there for a similar prupose?
--
obelix
"Whether you think you can or you think you cant you are right" .... Anon
Message posted via http://www.sqlmonster.com
... more >>
OUTER joins, aggregates, and WHERE clause
Posted by Geoff Lane at 1/12/2007 11:14:15 AM
I'm at my wit's end, can't figure out what's going wrong, and so seek the
sage wisdom of the group.
I have a query based on three tables:
ITStatus records a list of possible levels of support to which users may
be entitled
People records staff information with the primary key of ITStatu... more >>
Creating a temp table (and cols in report) with variable number of fields
Posted by Blasting Cap at 1/12/2007 10:51:59 AM
I have a table (no dups) with 20 records on it. They need to be columns
when I do a report on another table.
The table with 20 records on it though, is subject to change, with old
records coming off it and new ones coming on to it.
The table has a field DC, with 2 characters as the field ... more >>
Date range for 12 months
Posted by gv at 1/12/2007 10:45:30 AM
Hi all,
I want to select all data between a 12 month date range from the current
month reguardless of the current day in the month and
the query I run now is not returning correct data.
Like from todays month I would need all data that is from
02-2006 to 01-2007 and when Feb 1 comes I woul... more >>
Caching Question
Posted by Mike Hudson at 1/12/2007 10:28:15 AM
Hi Gurus,
I am pretty new to SQL server world.
I know SQL server caches few things, but I am not sure what exactly it
caches.
Does it cache the query data or does it cache the execution plan, or both.
And how long does it keep the caching.
I'll appreciate any help you can provide.
Than... more >>
How to check if date ranges intersect?
Posted by bogdan at 1/12/2007 10:18:12 AM
I have a table with start/end DATETIME columns. I'd like to be able to
select rows whose start/end overlap with a date range passed to a stored
procedure as @start/@end. I came up with the following WHERE clause that
seems to do the job but seems awfully convoluted.
...
@start DATETIME,
@... more >>
Table View limitations are giving me a Headache
Posted by Factor at 1/12/2007 9:59:05 AM
Hey all, I have a SQL problem and was wondering if I am once again
attempting the impossible. IT involves Views and what I perceive to be
a limitation of them. Then again, I am self-trained so, maybe I am
missing something that is rather simple. Using MS-SQL 2000.
I have a table in which I ha... more >>
Dr Watson error after writing to SQL Server
Posted by fniles at 1/12/2007 8:43:26 AM
I have a VB6 program that receives data using socket and save the data to a
SQL Server 2000 database.
It has Windows 2000 SP4 with all hot patches in it. It has 2 gig of RAM.
The program had been running for years with no problem, but for the last 3
days it had died exactly at 3 AM, right after... more >>
CASE in update statment
Posted by adam.rhodes NO[at]SPAM gmail.com at 1/12/2007 8:04:18 AM
So, I don't quite see why this doesn't work other than you can't put a
CASE where I'm trying to put one. Am I missing something or can I
really not do this?
-----
While (@loop<11)
BEGIN
update @total
set
CASE @loop
When 1 Then customReg1
When 2 Then customReg2
When 3 Then cu... more >>
Cant figure out this query....
Posted by Mangler at 1/12/2007 7:32:28 AM
I have the following tables:
dbo.lotinfo
idlot phmodel dockqty
1 200 50
2 200 50
3 225 50
dbo.prod
idseed idlot part recdte
1 1 a ... more >>
Modify Existing SQL
Posted by Glenn Billand at 1/12/2007 6:20:15 AM
Hello,
I currently have this SQL statement set to pull records of the table
LegalAction based on max date. However, I'd like to modify it so it
only pulls the latest record inserted for each person but I'm not sure
how to get going on this. Any help would be appreciated. This is what
I hav... more >>
How to setting "Thread Priority" for sql-server-thread.
Posted by andersboth NO[at]SPAM gmail.com at 1/12/2007 3:51:50 AM
When i make my own threads in c#, I can set the Thread Priority to
different values
(see
http://msdn2.microsoft.com/en-us/library/system.threading.thread.priority(VS.71).aspx).
But when I make sql calls from thesse threads it seems to me like sql
server still takes over the cpu power to muc... more >>
Query Help!
Posted by Jami at 1/12/2007 2:53:46 AM
Hi to all!
here is sample data & query that i m running to get the desired results.
create table mytab
(region char(3),total int, mt int , st int,ryear char(4),rmonth char(3),
rday char(2))
go
insert into mytab values ('AAA',50000, 20000,30000,'2006','Jan','01')
insert into mytab valu... more >>
|