all groups > sql server programming > may 2006 > threads for monday may 8
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
Design Question!
Posted by Simon Whale at 5/8/2006 11:51:45 PM
Hi,
i need some advice on the best way to do something; here the explaination
i have a request from the powers above me to design a solution that will do
the following
from telecom CDR (Call Data Records); record the following the destination
telephone number, date and if it was evening... more >>
sp_MSForEachDB
Posted by Lawrence at 5/8/2006 9:22:01 PM
Hello,
I know that sp_MSForEachDB is not being supported, but I am wondering if
someone would help me find out if I can use sp_MSForEachTable within
sp_MSForEachDB.
The code below does not work, and I am wondering if the code is feasible.
Error Message - "cursor hCForEach already exist"
... more >>
SQL Server Express Backups
Posted by Liddle Feesh at 5/8/2006 8:56:26 PM
Hi all,
I can't seem to find a way to automate the backups of SQL Server Express
Edition. I presume that I'll need to use oSQL via the command line and
schedule the task via windows scheduler.
Does anyone have an example of how to do this handy?
Many thanks!
... more >>
get Stored Procedures Parameters, how?
Posted by Tark Siala at 5/8/2006 8:32:29 PM
hi
i make smal Application to get information from SQL Server 2000 by using
VB6.
now i can get Databases, Tables and Colomn, and Stored Procedures, but my
problem how i can get SP Parametres?
i am thinking to make small function to get Parametres From SP.Text, but i
think its not good solut... more >>
Help - Exporting Table in XML Format that Contains a Field Which also containts XML data - How Do I
Posted by msnews.microsoft.com at 5/8/2006 6:59:46 PM
Ladies / Gentlemen
I am current writing a program that will query a MS SQL2000 Database
Table and Export the contents as XML. The problem that I am having is that
one of the Fields in this Table also contains XML data.
How do I tell the output file to not interpret this fi... more >>
Understand effect
Posted by Roy Goldhammer at 5/8/2006 6:41:19 PM
Hello there
I had some understand effect:
I run by mistake cartezic query: table that based on 1000,000 records that
duplicate it self.
My computer was shut down, when i restart it the tempdb wasn't big and there
were file on documents and settings with 40 gb who added.
what is that ... more >>
Port of SQL Server 2005
Posted by Retf at 5/8/2006 4:43:46 PM
Hi all, what port I need open to SQL Server 2005 work?
I have firewal and it block my MSSTUDIO.
Thanks to all.
... more >>
GetDate() --- Does not Return Milliseconds ?
Posted by msnews.microsoft.com at 5/8/2006 4:19:10 PM
Ladies / Gentlemen
If you run the following select statement you will find as I did
that GetDate() does no obtain Milliseconds - Why Not and can I use something
that does ?
Mark Moss
SELECT CONVERT(varchar(20), GETDATE(), 113) AS Expr2,
CONVERT(varchar(20), GETDATE(),... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Unicode Signature + Notepad + Bulk Insert
Posted by Alp Eren at 5/8/2006 4:17:05 PM
Hi,
I tried to use Bulk Insert for big data extracts containing unicode
characters (Danish etc.) from ETL to SQL Server. I found that the bulk
insert gives " DataFileType will be assumed to be char because the data
file does not have a Unicode signature" warning and does not load
unicode char... more >>
dbo with respect to performance
Posted by Rajesh at 5/8/2006 4:15:01 PM
Hello Sql Gurus,
I had a discussion with my boss regarding this.
we need to have dbo at the stored procedures level
but not needed for tables with in the sp.
But I suggest to have dbo at every level at the stored procedure level
and also at the table level. which is valid.
IF EXISTS (S... more >>
Insert trigger not working...
Posted by lytung NO[at]SPAM gmail.com at 5/8/2006 3:26:56 PM
can someone shed some light on this? i want this to work on update and
insert, but it only works on update. When i run a simple insert
statement, i get this
<root>The specified statement did not generate any data</root>
Here is the trigger:
CREATE TRIGGER trg_UpdateQty ON [fastpic].[FP_... more >>
SQL Server takes up a lot of CPU
Posted by fniles at 5/8/2006 3:23:01 PM
Our SQL Server database takes up a lot of CPU (50 - 100%), we are wondering
what can cause that, and if there is any SQL Server diagnostic/monitoring
tool we can use to find out what takes up the most CPU.
Thank you.
... more >>
SQL 2005 SP1 breaks CDO and Database mail
Posted by Sjoerd Verweij at 5/8/2006 2:51:03 PM
Since installing SP1, a previously flawlessly working procedure sending
e-mail (using sp_OA procedures to create a CDO.Message) now crashes after a
day and a half or so (of working properly every minute) with a DLL
initialization error. And once it crashes, it keeps crashing until we reboot
... more >>
Creating select statement with seperate columns for different valu
Posted by David Tilman at 5/8/2006 2:50:02 PM
I've been trying to figure out a select statement that would list a seperate
column with the count of a particular value for each value. Basically if I
have a table like this:
number value
--------- ------
10 good
10 bad
10 bad
12 good
1... more >>
SqlServer Encryption
Posted by perspolis at 5/8/2006 2:06:00 PM
Hi
I'm looking for a good encrypt/decrypt for sqlserver.
I want this encryption doesn't show any column or table in
EnterpriseManager.
I found www.NetLib.Com but It says it's product works for above 64 bit?I
didn't understand that..
can somebody suggest me a good product??
thanks in adv... more >>
SP Question
Posted by Vai2000 at 5/8/2006 1:42:14 PM
Hi All, I have an SP usp_Foo which returns three Column Values basically
SELECT C1,C2,C3 FROM TABLE1
WHERE ID=@ID
How do I know whether any results where outputted from this proc if I call
it within an external process?
EXEC @usp_Foo @ID
I want to figure out where the proc returned any... more >>
SQl Server 2K Performence
Posted by Perayu at 5/8/2006 1:27:36 PM
Hello all:
We are having performence problem in SQL server 2000 with Transactional
Replication in it.
I noticed that some processes in Current Activities - Process Info window
have "Wait
Resource" list as 11:1:676442, and Wait Type as "PAGEIOLATCH_SH". And
sometime all disappeared and perfo... more >>
Warning messages in SQL Server 2000 views
Posted by loga123 at 5/8/2006 12:57:43 PM
Hi All,
I have a view that has a "SELECT " statement in it. I am using the
aggregate function MAX in this SELECT statement and also I am using
ISNULL() for the aggregate function to eliminate NULL values.
When I execute the view, it gives me the correct result set along with
a warning message... more >>
Nested operators
Posted by Ana Morales at 5/8/2006 12:41:02 PM
Hi all
I would like to submit a question to the SQL Server expert group about a
problem that I am having related with nested operators; it may seem something
foolish to ask but it is driving me crazy since 4 hours ago:
I am using a case statement that looks like this (I put it simplified jus... more >>
Help with stored procedure!!!
Posted by bqirici NO[at]SPAM gmail.com at 5/8/2006 12:37:06 PM
I really need help with a stored procedure I am working with.I am
totally new to SQL and it has been hard for me to learn it from
scratch. I have a table with columns EMPL_CODE,NAME,PUNCH_TYPE,DATE and
TIME.Under the PUNCH_TYPE column I have two types of punches I (IN) and
O (OUT).Each punch has... more >>
Multithreading SQL connections
Posted by Spike Spiegel at 5/8/2006 12:24:01 PM
Hi there
I am working on the design of a system that its’ main function will be to
talk to devices over TCP/IP. There can be up to 50,000 devices that I need to
talk to within an hour period.
There will be a Queue on SQL 2005 which will contain requests for these
devices. I will nee... more >>
Please help: date-only comparison
Posted by John61 at 5/8/2006 11:58:48 AM
We have a select query on SQL server 2K with some date criteria like this:
transaction_date + 30 <= end_date
Because the data type of the date fields is "Datetime", the comparison gets
to time. This may cause missing records when (transaction_date + 30 =
end_date).
So I tried with Date-... more >>
VB Scripting
Posted by Jim Heavey at 5/8/2006 11:53:02 AM
I would normally have accesses in VB Script to the "Dir" Function, but no
such function appears to be present for me to access when I am writing a DTS
VB script (in SQL Server 2000).
I want to find out if a directory is present and if not present, create it
and then I want to copy some file... more >>
move record from TableA to TableB at a specified time of the record
Posted by Tony WONG at 5/8/2006 11:13:11 AM
How can i move record from TableA to TableB at a specified time of the
record?
Thanks for any hints.
Tony
... more >>
SQL2005 Database Backups: How to specify max number of backups, etc
Posted by Mark Findlay at 5/8/2006 11:02:57 AM
SQL2000 Maintenance lets me backup a database a specify how many days
backups to maintain. I couldn't find an equivalent setting in SQL2005. Is
there such a setting?
Thanks!
Mark
... more >>
Cursor with Execute Statement
Posted by Lianne Kwock at 5/8/2006 10:53:01 AM
Hello,
In the declare section of a cursor, I need to pass a tablename as variable.
How can I do that? I was trying to use the execute statement instead of the
regular statement. It won't work. Does anyone have any idea how I can do
this?
any input to his issue is highly appreciated ... more >>
Deleting from a table
Posted by Peter Newman at 5/8/2006 10:38:02 AM
Im working on a project that import data into a gash db. there are about 15
tables in this db and each phase of testing requires the tables to be
cleared. This seems to take ages when i got run a query as follows
delete table1
delete table2
etc
any suggestionon speeding this up ?... more >>
Sql Server 2005 Output Parameter Problem
Posted by DLP22192 at 5/8/2006 10:31:02 AM
Hi,
I have written a stored procedure that is called by an ASP.Net app and
passes in an output parameter that returns the record count of the query that
is executed. If I only execute the statement that sets the output parameter,
the correct value is returned to the app. If I also execute... more >>
Averaging values by month
Posted by Terri at 5/8/2006 10:20:53 AM
Given a series of dates with values I want to find the average by averaging
the data by month and then taking the average of these values. I can do this
(see below) by creating an additional temp table but I'd like to do this
with a single SELECT. Thanks.
CREATE TABLE #TestTable
(
TestDate d... more >>
Help with CASE statement
Posted by Dustin at 5/8/2006 9:49:01 AM
I need some help with a case statement that I'm trying to write. I wrote this
query a couple of weeks ago, but then my sql server had a hardware failure
and I lost all of my stored procs and now I can't remember how I implemented
it. I'm trying to write a dynamic "IN" statement using a case st... more >>
Retrieve REDO Information
Posted by Charles Parker at 5/8/2006 9:41:08 AM
I need a way to retrieve INSERT, DELETE and UPDATE information from SQL
Server, which needs to include basically a redo statement such as the actual
INSERT and DELETE statement and an UPDATE statement with the new (set
values) and original values. I know SQL Server has log files and there are ... more >>
Query Help: Get one row per record
Posted by JDP NO[at]SPAM Work at 5/8/2006 9:35:26 AM
I only want one row per record in my final output, however if a contact_id has
the same **date in one of the date tables, then my query returns an addtional
row.
I could say that I'd want the one with the greatest amount; how would I add that
criteria so that I'd only get the one row per recor... more >>
SQL 2005 Server Boolean value
Posted by Macca at 5/8/2006 9:20:02 AM
Hi,
I am trying to implement a boolean field in my SQL 2005 database. I've read
some newsgroups saying that there is no boolean type but instead a bit typeis
used which can be 0 or 1.
Does this mean on my .NET side i shouldn't use the boolean type but another
data type which I set to 0 ... more >>
Viewing combined fields
Posted by aviens NO[at]SPAM trgusa.com at 5/8/2006 8:57:02 AM
I am working on creating a new view from a single table.
what is the syntax in SQL to show two individual files as one combined field
in the view? for example, a first name and last name field in the table to be
displayed as a complete name in the view.... more >>
SQL Update / Insert to another table
Posted by ck NO[at]SPAM cksiteoftreats.co.uk at 5/8/2006 8:46:34 AM
Running SQL 2000 / (2005 in the future), I have to update a lot of data
(table 1) based upon other data (table 1&2). My predecessor inserted
data into an interim table (table 3) e.g. accountnumber; reason, then
ran a second pass to update table 1 based upon the data in table 3. I
have changed ... more >>
how to find out column name with sql server store procedure
Posted by amjad at 5/8/2006 8:33:03 AM
Hi
I have table which has Fields A,B,C and D for example. is thier any way to
retrive these field column as inline table function or store procedure.
thanks
some thing like select column_name from xxxx
thanks
... more >>
Partitioned View not operating as Documented
Posted by John Kotuby at 5/8/2006 8:12:30 AM
Hi All,
We have run into a huge problem at a large data-heavy multi-user
installation. In order to increase response times we split up a number of
tables into "Company" specific divisions to reduce the volume of records in
each Division and then placed Check constaints on each table by DIVI... more >>
Best practice
Posted by Peter Newman at 5/8/2006 7:43:02 AM
i have two databases on two different servers, one which is a live server.
What i want to do is run a query to update a table in the second server with
records from the first database. would this be a select if not exists ?
... more >>
using views within stored procedures
Posted by Dan D. at 5/8/2006 7:25:02 AM
Using SS2000 SP4. We have some contractors developing an app for us. They are
creating views and then using the views inside stored procedures and then
using the sp in the app.
Is there any point to using a view at all? Why not just use the base table
in the stored procedure? They are not u... more >>
OPENXML Question
Posted by Robert at 5/8/2006 7:22:02 AM
How do I return the number of rows inserted/updated using OPENXML?
I tried to use the @@ROWCOUNT function, but it always returns a 0.
Generic update example trying to return the # of rows updated:
declare @i int
exec sp_xml_preparedocument @i output,
'<mydata>
<test xmlID="3" xmlData... more >>
Sql Command object, set Parameters collection using Reflection
Posted by gdick NO[at]SPAM kerrhenderson.com at 5/8/2006 6:32:43 AM
..NET 2005 SQL Server 2005 CLR Stored Procedures
Apologies if this is in the wrong group - My question is in the
comments
using System;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;
using System.Reflect... more >>
Extracting a WinRAR file and backingup a dbs
Posted by Chris at 5/8/2006 6:26:02 AM
I have a DTS package now that runs a batch file to compress a backup file
using the switches available in the WinRAR app. I cannot however figure out
how to uncompress it. Does any one have a solution to this?
-Chris... more >>
Using T-SQL ISNULL...what if the record doesn't exist?
Posted by mj.redfox.mj NO[at]SPAM gmail.com at 5/8/2006 5:45:35 AM
I'm using a query which looks like this.
SELECT TOP 1 ISNULL(ReferenceVal,1) as ReferenceVal
FROM References
WHERE RefDescription = 'Mister' AND RefType = 'TITLE'
The problem I'm having is, although no ReferenceVal exists for these
criteria (as expected), the ISNULL doesn't work because the... more >>
SP4 Gather Streams and autoconvert data type
Posted by Krisnamourt at 5/8/2006 5:29:02 AM
We have many Server and only one have SP 4. Others with SP3a.
This query (and many like that) filter column with numeric(8.0) datatype.
SQL Server with SP4 make execution plan total diferente, that include
Parallelism(Gather Streams) and take many time to execute. If we put a dot(or
convert stat... more >>
Cursor fails when fetch happens -Attempt to fetch an unopened curs
Posted by Sultan at 5/8/2006 4:48:02 AM
Windows 2000, SQL Server 2000 SP 3, Number of Processors=more than 1(multiple
CPUs)
In the above mentioned environment, my TSQL code opens cursor and
immediately checks that whether the cursor opened successfully or not. After
successful open, it fetches the record from table. But while fet... more >>
Query Problem
Posted by neeju at 5/8/2006 4:42:28 AM
Hi All,
I am having one problem with the query. Please see below the query.
Declare @p_code_type_cd varchar (200),---3599, 6023
@p_lang_cd varchar (10),--39
@p_code_val varchar (2000), --67330000, 67000000
Select @p_code_type_cd = '3599,6023', @p_lang_cd = '39', @p_code_val =
'67330000... more >>
Query Remote database
Posted by Dinesh at 5/8/2006 3:27:02 AM
Hi,
This may be a stupid question. But it is very urgent.
I need to the query remote database without adding the server as linked
server.
Mine is c# application, I will execute a sp on on db, the sp queries the
information from other server which is not linked.
Please let me know if ther... more >>
sql field to text string
Posted by Ganesh at 5/8/2006 2:48:01 AM
Hi There,
select 'grant execute on ' + name + ' to adept_user'
from sysobjects
can i stored all records in a single string then i want to execute in the
command like exec()
can i do this without cursor
--
Thanks
Ganesh... more >>
parameterised queries in reporting services
Posted by Mike P at 5/8/2006 1:48:45 AM
When you are using a number of parameters in a report, how do you set it
so that if a parameter is selected the query runs against that
parameter, but if a parameter isn't selected, the query runs against all
values for that parameter?
Here is my query :
select o.opportunityid as 'Opportuni... more >>
Trigger Backup of a record
Posted by Confused at 5/8/2006 1:45:48 AM
Ok,
I have read some of the threads, but can not seem to gasp the consept.
The problem is I have 2 tables:
Table 1 : (ClientNo, EditDate, Address1, Address2) --ClientNo Unique
Table 2 :(ClientNo, DateFrom, DateTo, Address1, Address2)
Whenever a user change Table1, I want to add that recor... more >>
index on table variable
Posted by Manish Sukhija at 5/8/2006 12:33:01 AM
Hi guys,
Can we put Index on table type variable like if we create a
table type variable by this:
DECLARE @Results TABLE (
[rownum] [int] IDENTITY (1, 1) PRIMARY KEY NOT NULL,
[PlanID] BIGINT,
PlanPriceID BIGINT,
PricePerMonth MONEY,
ConnectionFee MONEY,
Connec... more >>
|