all groups > sql server programming > march 2007 > threads for tuesday march 27
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
More trusted jobs here
Posted by palanivel at 3/27/2007 11:54:28 PM
Easy Working at Home
$1000 Monthly Income!
Homebased Job Directory plus information package of Education,
Knowledge, Wisdom
World's Premier Web Based Company Offering
Click it now:
www.l-red.com/index.asp?REF=megna
visit:http://classifieds.byindia.com/detail.php?
siteid=3571&cityid=168&show_... more >>
Full DB backup
Posted by prince at 3/27/2007 11:32:01 PM
Hi,
Does full DB backup in SQL 2005 includes trans log backup too? if yes does
the trans logs are truncated @ server?
thanks and regards
prince... more >>
Need a query...
Posted by GB at 3/27/2007 11:08:43 PM
Hello,
I have a table tblInput like this:
CREATE TABLE [dbo].[tblInput(
[NameID] [nchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Date] [datetime] NULL,
[Value] [nchar](10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
with data (sorry, no SQL INSERT...):
NameID |Da... more >>
howto: I need trigger with parameter
Posted by Aykut Canturk at 3/27/2007 11:07:15 PM
I need to write a trigger that updates every record inserted to database.
this trigger will update only one field lets say 'branchofficename' field in
table. But in my VB application, that uses that database and that table, I
need to declare a database-wide parameter, lets'say Branch_Office_Na... more >>
exporting mssql BD
Posted by Areq at 3/27/2007 10:13:06 PM
Hi,
How can I dump my BD structure into some sql file?
Regards,
areq
... more >>
Rounding Up
Posted by lesleyann76 NO[at]SPAM gmail.com at 3/27/2007 9:03:57 PM
Is there a way to round up in sql? For instance, I want automatically
round 0.3 to 1, 1.1 to 2, etc. Using the "round" function I only seem
to get traditional rounding effects (ie, once the value is more than
half a round up will occur, however less than half way to the next
higher integer rou... more >>
Commit & Rollback Question
Posted by BigO at 3/27/2007 9:02:02 PM
I am writing a table load process that I'd Like to control by one main
stored procedure. That main stored procedure executes multiple store
procedures that each creates & inserts multiple rows into the SAME
table.
My logic is as follows: (Don't worry about the syntax of the SQL)
Create Proce... more >>
Service Broker connection
Posted by fireball at 3/27/2007 7:49:06 PM
After I create ENDPOINT for SERVICE_BROKER, will I see port open for
listening (np via netstat)?
(Servis Broker is enabled on both databases, and so (I am able send and
receive messages using LOCAL route)).
sys.dm_broker_connections view is empty. When will I see any connection in
t... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Database Error 22285
Posted by FARRUKH at 3/27/2007 7:03:03 PM
when i came this morning, database was down and got a error message. there
was no error message n a log file. this was the message n a screen.
'database 'Ocean is alreay open and can only have ine user at a time'
I fixed the problem but I dont know why the database went on a single user
mode... more >>
Prevent row change on system table
Posted by bic at 3/27/2007 6:46:50 PM
How to prevent row data changes on system table such as master..sysusers
table. Thanks
--
bic... more >>
Delete really slow
Posted by Stephane at 3/27/2007 6:45:15 PM
Hi,
I have a two tables with ~5M rows. They have 5 to 10 foreing keys. Almost
all of them are indexed. It's a data warehouse so there are only few
updates. There's batch insert sometimes. Select statements are really fast,
but when I want to delete, it's a real pain in the neck.
In the ... more >>
Createb table from a query
Posted by Gopal at 3/27/2007 6:44:05 PM
Hello All,
I would like to create a table from a query. The query is a complex one with
results being generated from 9 tables.
I will do some manipulation on the table and then use it for reporting. I
cannot use the view here.
Please help.
Regards
Gopal... more >>
table related query
Posted by JohnE at 3/27/2007 6:19:39 PM
I am relatively new to sql 2005. I am wondering if anyone has a sample of a
search query that could be used to determine all stored procedures, views,
etc that would be associated with a table? If anyone has a sample of such a
search query and willing to share it, that would be great.
Let m... more >>
get the first of the month
Posted by rodchar at 3/27/2007 6:00:34 PM
hey all,
i have a stored proc i'm working with:
i need to take the current date go back a certain number of months specified
in the parm.
for example:
SET @monthsDifference = DATEADD(month, -(monthsBack), GETDATE())
which takes us to:
12/26/2006
1. what i'd like to know is the eas... more >>
I can't Copy a database from Sql Server 2000 to 2005
Posted by Johan Garst at 3/27/2007 5:55:22 PM
Hi,
I can't Copy a database from Sql Server 2000 to 2005. I am using the Copy
Database option from Management menu. I want to transfer all tables, and all
stored procedures. I've tried everything for the past 3 days, and it didn't
work. I always get the same error.
Below is the error that I... more >>
status and indid from sysindexes table
Posted by Jodie at 3/27/2007 5:54:58 PM
Hi All,
I have a sqlstatement as below:
select * from sysindexes
where indid < 255 and (status & 64)=0
But I don't understand what is the mean of
1) indid < 255 and
2) (status & 64)=0
Would you please explain it for me.
Thanks In Advance,
JP... more >>
Select query in sql 2000
Posted by RickSean at 3/27/2007 5:54:50 PM
I have a table TableA (Col1, Col2, Col3) which contains 5000 records. Col1 is
the key field.
Another table TableB (Col1, Cola, Colb) contains 300 records, Col1 is the
key field.
Another table TableC (Col1, Cola1, Colb1) contains 100 records, Col1 is the
key field.
I want to return all 500... more >>
2 table update
Posted by rodchar at 3/27/2007 5:54:04 PM
hey all,
i have the following 2 tables:
table1
-------
employeeID(PK)
,Name
,status (part-time/full-time)
,startDate
,endDate
table2
-------
employeeID(FK)
,status (part-time/full-time)
,startDate
,endDate
Sample Population:
table1
-------
1, John Smith, null, null, null
2, Ja... more >>
using table variable
Posted by Roy Goldhammer at 3/27/2007 5:40:24 PM
Hello there
I have some process that i can't run on single sql query.
In order to run it i must split the huge query to 3 temp tables and run it.
The problem is that i can't use temp tables on function but only on store
procedure. Also if
So i thought using table variables. I used it ... more >>
Difference in UPDATE between 2000 and 2005
Posted by Andrew Hayes at 3/27/2007 5:21:50 PM
SQL command:
UPDATE tblGrossUpFixedIncome SET FixedIncome = '3,4,5,6' WHERE KeyID = 1
SQL Server 2000 result:
"Cannot implicitly convert varchar to money. Use CONVERT."
SQL Server 2005 result:
FixedIncome field now contains 3456.
How do I get the UPDATE command in 2005 to giv... more >>
Nested Stored procedure issue
Posted by KMP at 3/27/2007 5:10:50 PM
I am not sure which is the right newsgroup to post my message, so sorry about
the double postings.
I have a stored procedure SP1 which gets its data from another stored
procedure (SP2) that is nested in it. SP1 will not run the very first time by
itself, it basically fails. After I have exe... more >>
JOIN Question...
Posted by Joe at 3/27/2007 5:06:32 PM
I am trying to pull together information from two different Linked Server
databases.
Let's call the LinkedServerA and LinkedServerB, both of which are Oracle
databases.
So, what I want to do is pull the following Columns from LinkedServerA:
ANUMBER, FNAME, LNAME, C_ID, S_ID, STATE
And ... more >>
Internal Serer Error
Posted by Dan Holmes at 3/27/2007 5:02:05 PM
Msg 8624, Level 16, State 1, Procedure PurgeReceipts, Line 14
Internal SQL Server error.
This is on a SQL 2k server. I tried the same on a 2k5 server and it
worked fine. I don't know how to troubleshoot this.
The print statements do not show.
CREATE PROCEDURE PurgeReceipts
AS
PRINT '... more >>
Setting up SQL Server Agent Mail
Posted by DBA at 3/27/2007 5:01:01 PM
When I go to set up SQL Agent mail, teh mail session area is greyed out. How
do I fix this since it does give me the option of choosing a mail profile. I
have outlook installed on the server... more >>
maximum fragmentation to allow for table
Posted by Jodie at 3/27/2007 4:21:12 PM
Hi All,
What is the optimize number of fragmentation to allow for table before
we need to run the "DBCC INDEXDEFRAG" for the table to
improve the performance,
Thanks In Advance,
JP... more >>
Update trigger
Posted by YaHozna at 3/27/2007 4:14:18 PM
Hi. Can someone remind me how to do this?
I have a table on which there is an Update trigger. Works fine. However
there is also a scheduled job that runs a batch update on that table every
week which then also fires the tigger for every row in the table. How do I
prevent this happening and... more >>
Not Exists Date
Posted by StvJston at 3/27/2007 4:07:24 PM
Thanks in advance for help received.
Accounts can be created any time
Accounts can go years before an opportunity is created
Accounts can have multiple opportunities in a year
Any Account that has an year(opportunityDate) = 2007 but does NOT have any
previous years opportunities
Crea... more >>
how do i meaure time
Posted by Ramesh Subramaniyan at 3/27/2007 3:57:51 PM
hi all ,
if i have table that contains 50 columns and 120 rows (data's ) .
if i m executing a (select / insert /update) query . i have some server
specification and client specification , and n/w specification . i want
calculate time , that select query should take , update query sh... more >>
calc start-of-week and end-of-week
Posted by John Grandy at 3/27/2007 3:49:27 PM
I need to calculate a datetime for the start of the current week (Sunday
12:00:00AM) and a datetime for the end of the current week (Saturday
11:59:59 PM).
I've written some long-winded code to do this involving building up strings
and then explicitly or implicitly casting them to datetime.... more >>
Display rows even when sum is 0.
Posted by aiu4840 at 3/27/2007 3:00:38 PM
Hello SQL gurus,
I have a query as follows:
SELECT DISTINCT
P.PlantDescription,
'SETUP' AS TransactionType,
SUM(MT.ActualMinutes * MT.Crewsize)/60 AS [SETUP run labor
hours]
FROM dbo.GLB_Plant_MASTER P
LEFT OUTER JOIN GLB_BusinessUnit_MASTER B ON
P.Depart... more >>
opendatasource excel
Posted by nkg at 3/27/2007 2:22:55 PM
I am using opendatasource to insert rows in excel. First i clear the Excel
sheet all rows to NULL,
I am noticing that the new rows are always appended from the last insertion
point in the excel rows.
Is there a way to clear the excel sheet and insert rows from the top of the
sheet ?
thx
... more >>
Referencing Multiple Tables MSSQL 2000
Posted by Nico VanHaaster at 3/27/2007 1:42:25 PM
Hey All,
Just wanted to say i am still green with writing complex SQL Queries
so please bear with me.
I have 2 tables 1 containing an employee number (table:1) which is
bound to the type of system they are using and another table which
specifies the universal employee number(tabel: 2) for t... more >>
User query hanging a critical application
Posted by CSAWannabe at 3/27/2007 1:25:00 PM
I have a critical production system.
There is an application.. that runs as a Windows Service that
continually queries a SQL Server 2000 DB, on Windows 2000 every second
or two.
A user went onto the system and executed a complex query, that ended
up causing SQL Server to utilize 100% of the C... more >>
String parsing
Posted by kbutterly at 3/27/2007 12:24:43 PM
Good evening, all!
I have a field that will contain between 2 and four alpha characters
and upto 8 numbers. So all of these are valid:
AB12335
MEAB4567
RNAP3456789
XY87654321
I need to left pad the number to be exactly eight digits. So I need
the above to be:
AB00012335
MEAB00004... more >>
Indexing strategy for a very large table?
Posted by MikeJohnson at 3/27/2007 12:06:30 PM
Hi,
We have a very large SQL Server database of around 2-3 Billion
records.
Each table holds hundreds of millions of records.
Each table has the same simple schema:
emailsender: varchar (255),
emailreceiver: varchar (255),
date: datetime
id: ... more >>
Finding values that don't exist in another table
Posted by Rick at 3/27/2007 11:26:24 AM
Hello All,
I have a table like this
Id Target
1 access
2 access
3 acrodynamo
4 acrodynamo
5 addrecord
I have a second table like this
Id Destination
1 access
2 addrecord
3 afptrouble
4 approvals
5 auxlayoutmap
I need to find all of the records in the fi... more >>
SQL help with Subtraction
Posted by DG at 3/27/2007 11:25:40 AM
I am VERY new to SQL programming and don't know if this is the correct place
for this post but here goes.
I have a spreadsheet in excel that I use ODBC to pull data from an SQL
database. I can do the basic stuff (select fields from a table and return
them). Normally I return the data to t... more >>
Help optimizing a query-- its not using the indexes
Posted by Dan English at 3/27/2007 10:21:32 AM
This query is slow on my production server:
Select Top 10 * From Data
Where
(GetDate()-Created > 365) And
(GetDate()-Modified > 60)
Order By MyPrimaryKey
Data has about a million rows (each record is not very large). Created and
Modified are datetime columns. I have separate ... more >>
Output of sp_helprotect
Posted by Moin Africawala at 3/27/2007 9:03:43 AM
Hi can anyone help me out with the sp_helprotect procedure. i need the servername and databasename alongwith the output of sp_helprotect in a table. I have 100+ servers and multiple databases on each other. Can you anyone over here help me out for the same. Wuld be much obliged. Thanks in advance.
... more >>
Multiple Return Parameters
Posted by Looch at 3/27/2007 7:41:51 AM
Got a question with a stored procedure...
Create Procedure GetCCInfo
(
@TickNumAuto nvarchar(255),
@ExpDate datetime Output,
@CardNumber bigint output,
@CardType nchar(10) output,
@NameOnCard nvarchar (50) output,
)
as
select cc.CustomerID, cc.CardType, cc.CardNumber, cc.ExpDate,
cc... more >>
Removing unwanted characters in a field
Posted by chgruver NO[at]SPAM hotmail.com at 3/27/2007 7:01:44 AM
Hello, here is my issue, I have one database using MS SQL Server 2000,
that has a table with first names, middle names, and last names stored
in it along with other information. I have written a stored procedure
that when a certain flag in that table gets set the information
regarding that perso... more >>
Oracle Linked Server problems, OpenQuery accepts no variables and fully qualified Linked Server syntax has datatype discrepencies
Posted by themarkfords NO[at]SPAM yahoo.com at 3/27/2007 5:45:39 AM
Hi all,
Long time programmer/jack-of-all-trades. Using a linked server set up
in SQL Server 2000, connected to an Oracle 9i instance. I need to
query specific rows of data in several large Oracle tables from
several SQL Server stored procedures via an already defined linked
server using the MS ... more >>
Query Help!
Posted by Jami at 3/27/2007 2:50:30 AM
Dear All!
i have following two tables and sample data
create table worktab (Rno smallint,atype tinyint,number int,amount int)
go
insert into worktab values (1,1,12,6000)
insert into worktab values (2,1,12,16000)
insert into worktab values (3,1,12,26000)
insert into worktab values (4,... more >>
Find an ID and select it in another table
Posted by David Trasbo at 3/27/2007 2:49:44 AM
Hi group,
I am making a login system for an instant messenger. What I want is a
fast way to find a users primary key (UserID) in a "Users" table by
using the "UserName" and "UserPassword" columns.
Then check if there exists a "loginsession" with that "UserID" in the
"LoginSessions" table an... more >>
Boolean field
Posted by Alan T at 3/27/2007 12:00:00 AM
I am an application programmer using a front end component which has a
property link to a Boolean field of a dataset.
It is fine when I connect the MS Access, as MS Access has field type Yes/No.
However, for SQL 2000 it has no data type of Boolean or Logical or Yes/No.
How do I return the fie... more >>
number function
Posted by simon whale at 3/27/2007 12:00:00 AM
hi all,
can anyone tell me how i would take a positive number x and make it a
negative number x. but when doing this i will not know the value of x.
any pointers would be grate full
Simon Whale
... more >>
Scope_identity()
Posted by Guy at 3/27/2007 12:00:00 AM
Hi all,
Newby here - with a problem!
I have two tables (A and B). Table A has a unique id (Aid) and table B has
its own unique id (Bid) but also a foreign key which is table A's unique id
(Aid).
Table A
Aid (PK)
Table B
Bid (PK)
Aid (FK)
When inserting a new record into table A... more >>
generate a unique ID
Posted by Geo at 3/27/2007 12:00:00 AM
Guys, I have to extract old data from one table and insert it into a new
table. This part is simple but the problem I have is the new table has a
column named storyID. This doesn't exits in the old table. I thought I
could do something along the lines of insert into new table (select from old... more >>
|