all groups > sql server programming > april 2006 > threads for wednesday april 5
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
Looking for a method
Posted by Enric at 4/5/2006 11:26:01 PM
Dear all,
I'm struggling myself trying to obtain the total number of transactions
commited in a database in a specific period of time, for instance a month.
Using this query you obtain info based in .log file although dates not
appeared:
SELECT Operation, count(*) FROM ::fn_dblog(null,... more >>
case expression in where clause and null's
Posted by nospam NO[at]SPAM nospam.sss at 4/5/2006 11:06:02 PM
Using SQL Server 2005
I have a simple table example with two columns: FirstName varchar(20) and
LastName varchar(20)
I am doing something like this in a stored procedure where @firstname and
@lastname are passed in and @lastname could be null
select * from table where FirstName = @firstna... more >>
Q: on EXEC a sp
Posted by Ana at 4/5/2006 9:29:31 PM
Hi,
How to send an email when a sp result is TIME whilst:
Select Case When Date_OUT = Getdate()+3 Then 'TIME' Else '' End
From dbo.Clients?
I'd appreciate some help.
TIA Ana
... more >>
Table Design question
Posted by S R H at 4/5/2006 8:24:22 PM
I have a table "EMPINFO" in which I have to store 2 pieces of information:
1) employed
2) required
Now the values of the above attributes can be in Days(1) or Weeks(2). Days
and Weeks are already defined in a table "duration_type":
CREATE TABLE duration_type
( duration_type_id int PRIMARY KE... more >>
Data type for storing MS Word documents/large data type?
Posted by Justin Little at 4/5/2006 8:00:01 PM
Hi all,
I am bginning to build a SQL Server database that will be used to store
documents from various users. The document types will mostly be MS Word and
MS PowerPoint. I want to know what datatype to use in the database to store
these kinds of documents.
The data will be fed to SQL... more >>
Time out
Posted by Chris at 4/5/2006 7:49:01 PM
Can I set the lenght of time a query should take to run before it time out.
I am running some query but I keep getting a time out error - I would like
to increase the time out period
Thanks
Chris... more >>
Dynamic Date/Calendar
Posted by Paul Reed at 4/5/2006 7:33:02 PM
Hey,
I have a financial query that has to retrieve sales totals for each day of
the month for the current year and prior year. Some days though (current and
prior) don't have any sales on those days so I still have to return zero. I
have this working just fine...but to do it I created a mo... more >>
Import TXT files via sql
Posted by Jim at 4/5/2006 6:58:42 PM
Hello,
I have a bunch of text files that are in a directory that i need to import
into an sql table. each txt file only has one line of text.
i.e.
fileone.txt has "this is an exmaple"
filetwo.txt has "this is an example also"
and so on.
thx
whats the best way to do this...
... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
comparing two records field by field
Posted by helmut woess at 4/5/2006 6:46:45 PM
Hi,
a stored proc should find all different fields in two records. This two
records are in two temp tables and have the same fields, but the
recordstructure can be different in every call of the stored proc.
For example, in one call i check the difference of two records from the
customer tabl... more >>
Memory usage keep growing....
Posted by nick at 4/5/2006 6:13:01 PM
I am executing a T-SQL script:
1. Open a cursor on a big table with millions rows.
2. for each row, passing column values and call an extended stored procedure
I found the memory usage keep going up - about 40K in the delta usage in
Windows task manager.
Does the Cursor cause the proble... more >>
creating a blank verion of the database
Posted by Robert Bravery at 4/5/2006 5:19:36 PM
Hi all,
I need to create a blank version of my database. That is, all tabes are
empty ready for input. But also copy acroos all the triggers and sp's. This
on the same SQL server.
The purpose, is that I neede a completely fresh start for testing purposes
with different departments
Whats the ... more >>
updating Servers BCP?
Posted by Stephen K. Miyasato at 4/5/2006 4:35:22 PM
I have servers that I have to update from another server with Lookup tables.
I have not as yet set up set up replication and all of these are lookup
tables.
What is the best way to update those tables on other isolated servers?
There are of course changes to table structures mainly added c... more >>
transaction rollback : preferred technique
Posted by John A Grandy at 4/5/2006 4:28:49 PM
When writing a SQL sproc that performs operations inside a transaction, and
there are a number of junctures where in certain cases you would like to
rollback , what is the preferred technique ?
I assume use of GOTO statements is not it.
... more >>
output of SP into a variable
Posted by Dan Holmes at 4/5/2006 2:56:54 PM
I have a SP that creates a result set. I want the value in the keyvalue
column of the first row to be put into a variable (@var1). I can't
figure out how to do this except for a cursor (which i don't really
like). For example suppose:
CREATE PROC Test AS
SELECT column1, * FROM TestTable... more >>
Using YEN sign in MONEY field
Posted by Alan Z. Scharf at 4/5/2006 2:44:26 PM
Hi,
Is there a way to use the YEN sign ¥ as the preceding currency symbol in a
MONEY field where most of the values use dollar sign.
Either direct field entry or using T-SQL?
BOL has a Monetarty data section with a table of currency symbols and Hex
codes, but doesn't really indicate how... more >>
Send to Email
Posted by Newman Emanouel at 4/5/2006 2:13:02 PM
Dear All
Can someone help me with the following script. I cannot get the information
to print in the body of the email. All I get is what is in the quotation
marks.
I am using SQL Server 2000
DECLARE @body VARCHAR(4000)
SET @body = 'select au_lname from pubs..authors'
exec sp_send... more >>
Replication from SQL 2005 into SQL Express 2005???
Posted by Kevin S. Goff at 4/5/2006 1:55:56 PM
Hi, all,
I'm not even sure that this can be done....
We have a .NET app with SQL2005. There's a new requirement for users
to work with the application in areas where no connectivity exists.
Unless someone has a better suggestion, the idea was to have SQL
Express 2005 running locally. Us... more >>
auto number
Posted by Me at 4/5/2006 1:53:02 PM
I have two columns A and B, I want to auto-number B with respect to A
How can it be done?
For eg. I will have data like column A column B
A 01
A 02
... more >>
Left Padding with Zeros on Count(*)
Posted by grizgirrl at 4/5/2006 1:03:51 PM
For some reason, I have a vendor who needs his record count padded with
zeros on the left. Spaces are not good enough.
Here is the code for this footer. The last line, with the count, needs
to have zeros in front of the count.
SELECT DISTINCT 'FT0080CAPS' + SPACE(1) + 'ALL' +
LEFT(REPLACE(C... more >>
T-SQL problem.
Posted by SangHunJung at 4/5/2006 1:00:01 PM
Hello,
I would like to get an output like below so simply copy from the output and
past to query windows to run.
### desire output ###
exec sp_spaceused ProviderGroupCodes
GO
exec sp_spaceused EmployeeEventHistory
GO
Here is my t-sql but having a problem with newline with "GO".
select ... more >>
::FN_DBLOG - Retreiving [row data]
Posted by hillel at 4/5/2006 12:58:55 PM
Subj: ::FN_DBLOG - Retreiving [row data]
Hello
While attempting to retrieve [row data] column using ::FN_DBLOG
an empty '0x' value is passed back.
The retrived record does contain row data. It can be seen when using DBCC LOG.
However - DBCC LOG is not as versatile as ::FN_DBLOG(): whic... more >>
Numbers of rows returned from mquery
Posted by Markgoldin at 4/5/2006 12:47:01 PM
I am using the following code to find if a use exits in the table:
declare @UserName char(30)
set @UserName = (select fullname from udf_GetUserName(@UserId))
SELECT @@ROWCOUNT
but that always returns 1. How do I solve that?
Thanks... more >>
view joined to subquery of random record
Posted by David Shorthouse at 4/5/2006 12:02:56 PM
Hello folks,
I'm wanting to create a distinct recordset with a subquery containing
one random record. Essentially what I am trying to do is create something
like an image gallery grouped by "theme" but the one individual image per
theme is randomly selected according to its "theme" memb... more >>
SQL 2000 vs SQL 2005
Posted by Scorpion219 at 4/5/2006 12:02:01 PM
Where can I find information / fact sheet about the differences between SQL
2000 and 2005?
Thanks in advance... more >>
remove all double quotes from column values using t-sql
Posted by cooltech77 at 4/5/2006 11:18:02 AM
Hi,
I am having problem withj double quotes being inserted automatically when i
am inserting data using a CSV file.I am using a C# program to insert the
values.
My coulmn is called whereClause and it is a varchar(50) e.g
'ISNULL(salary,2000)=2000'
but what gets inserted is "'ISNULL(sa... more >>
nonclustered index fields
Posted by Tristan at 4/5/2006 11:04:01 AM
Hi folks,
I was wondering if it should be taken as a rule of thumb to allways avoid
the us of the fields that conform the primary key when we are designing any
nonclustered index, as in reality they allready have this key in "their
inside".
For example, say we have a pk composed of the f... more >>
display values depending on a rule
Posted by Xavier at 4/5/2006 10:17:02 AM
hello,
i have a table with 3 fields
CustNr (int)
artikleNr (int)
pieces (int)
simple example - all customer have bueyed the article with the nr 11
101 11 8
102 11 3
101 11 4
102 11 20
103 11 3
104 11 15
104 11 25
i want to display a information in the following way
if cust... more >>
How to generate sequence?
Posted by Me at 4/5/2006 9:43:02 AM
I have a table with four key fields -
ContractNo, TrailNO, JOBNO, JOBSERIALNO.
When users enter the ContractNo -> the Trail No. should get populated with
the next running no. based on ContractNO. Assume that the contrano = 1, last
trailno =10, then when users want to add new record, after ... more >>
Triiger information to a different Database
Posted by pmud at 4/5/2006 9:04:01 AM
Hi,
I have created a triggers on my 2 tables in the database. When an order
comes into teh table then it kicks off that order infomation to another
table. Right now, I have implemented this in the same database. But I want to
kick off this information to a table on a different table.
How... more >>
Incorrect Date Format
Posted by Skip at 4/5/2006 8:53:41 AM
I am moving data from an Interbase DB to SQL Server 2005. The date
columns for whatever reason in Interbase are not valid dates and they
have vChar field types. This is how they are formatted
2006-03-13-00.02.04 notice the extra hyphen between the date and time.
I have created an SSIS package im... more >>
Date Comparison Question
Posted by Jav at 4/5/2006 8:44:01 AM
I have 9 datetime columns in a DataRow.
In a SELECT statement, I would like to have a Boolean return True if Date1
is later than every one of date2 thru date9, otherwise return False. Some
dates may be Null.
Is there a concise way to accomplish this?
TIA
Jav... more >>
HOW CAN I CREATE A LOOPING STORED PROC
Posted by heri at 4/5/2006 8:40:58 AM
I have a problem I need to get a loop of a record in a file I have
created a Stored Proc but it seems it does not loop in all the records
cause I only get one data
CREATE PROCEDURE x_newcombine
AS
DECLARE
@EmpNo INTEGER,
@Benefitcode VARCHAR(50),
@StartDate S... more >>
Looking for a method
Posted by Enric at 4/5/2006 7:48:01 AM
Dear all,
I'm struggling myself trying to obtain the total number of transactions
commited in a database in a specific period of time, for instance a month.
Using this query you obtain info based in .log file although dates not
appeared:
SELECT Operation, count(*) FROM ::fn_dblog(null,... more >>
Create temp table with unknown # of columns ahead of time - how ???
Posted by sydney.luu NO[at]SPAM gmail.com at 4/5/2006 7:28:31 AM
Hello,
I have a stored procedure that will return a resultset with known
number of columns
at runtime. I could have 1 column returned or 15 columns returned
based on parameters
passed into this stored procedure. With a fixed column resultset, that
I know how to
do but don't know how to do... more >>
CONVERT with char string... again ! :)
Posted by AlexT at 4/5/2006 5:53:21 AM
Folks
what's wrong with
CONVERT(DATETIME, '20060405 14:45:43', 102)
I get the error "Syntax error converting datetime from character
string."
I was under the impression that the syntax YYYYMMDD HH:MM:SS was not
SET DATEFORMAT dependent, not SET LANGUAGE dependent and language
neutral.... more >>
Builtin alternatives to UDF?
Posted by eox_conceptos NO[at]SPAM despammed.com at 4/5/2006 5:23:12 AM
I'm using some simple scalar UDFs in expressions that update sets of
around 500,000 rows, but have some worries about possible performance
hits. Question is, are there relativly simple ways of accomplishing the
same inline using the builtin functions?
create function dbo.f_MaxOf(@x1 float, @x2... more >>
How to get NTEXT data via SP to vb.net app?
Posted by Rafi at 4/5/2006 5:12:02 AM
i have a table with ntext field and i need to get some fields including the
ntext value to a vb.net application (vs2003)
i have this routine in vb:
Public Function GetMsgs2Email() As DataTable
Dim da As New SqlDataAdapter
Dim result As New DataTable
Try
... more >>
Full text search in image BLOB
Posted by novus at 4/5/2006 5:06:02 AM
We have a ASP.net 2.0 CMS in which the pages are saved in the database as a
BLOB in the table: ASPNET_PersonalizationAllUsers.
Is there a way to search in these BLOB? I have tried to search with FTS but
cannot find the needed iFilter.
Can you help?... more >>
Importing Excel file using DTS use of VB package
Posted by anand at 4/5/2006 4:24:09 AM
Dear All,
I had created a Package for importing a excel file.
while i created the package the data was ported.
and i had saved the package.
now when i try to port the data by executing the package.
the file is not ported.
what could be the problem.
help me........
Regards _Prem
... more >>
help
Posted by praveen garigipati at 4/5/2006 4:11:36 AM
what is the exact differnece char and varchar in inputwise means(which
one take alphabets and numerics)?
*** Sent via Developersdex http://www.developersdex.com ***... more >>
Insert dataset content into a local database table
Posted by Daniel at 4/5/2006 4:10:02 AM
Hi,
I faced problem in inserting > 10,000 records from a runtime dataset into a
local database table.
By using the each rows insertion method, the TPT increase (about 30 minutes).
So, i would like to learn on how to insert the whole runtime dataset table
into my local database table.
... more >>
XQuery vs OpenRowset
Posted by Shilpa at 4/5/2006 2:05:05 AM
Please let me know the advantages and disadvantages of XQuery vs
OpenRowSet in SQL Server 2005. Which would be better?
Regards,
Shilpa
... more >>
Send email from SQL Express SP
Posted by Mark at 4/5/2006 1:47:52 AM
Hi - I'm using asp.net2 and SQL 2005 Express, and also using Vale
Software express agent to schedule jobs.
I would like to write a stored procedure which runs as a scheduled job,
which does this:
1) selects information from the customers table based on the date their
invoice is due
2) cons... more >>
object_id function returns null
Posted by Jos G at 4/5/2006 1:32:01 AM
Hello,
I've been using object_id(object_name) function in some queries to retrieve
tables' ids without problems. However, those queries have started to fail
because object_id function returns null when the table name is like this one:
'MyPrefix.SampleTable'. I've checked sysobjects and the ... more >>
create table => system table
Posted by Cristian at 4/5/2006 12:00:00 AM
Hallo everybody,
when I create a table or a stored procedure it always becomes a system
object instead of a user object, who can I avoid this? I just want to create
user objects.
I'm using SQL Server 2000 and I have all the service packs installed, the
user I'm using to create the table is DB... more >>
Update Lock (Preventing deadlock)
Posted by Leila at 4/5/2006 12:00:00 AM
Hi,
How does the update lock (before obtaining exclusive lock) can prevent
deadlocks? In what situations?
This is what BOL says about this type of lock:
------------------------
If two transactions acquire shared-mode locks on a resource and then attempt
to update data concurrently, one tran... more >>
stored_procedure_name;1
Posted by Nikola Milic at 4/5/2006 12:00:00 AM
Hi,
My Access project application can see stored procedure on SQL server in
format "stored_procedure_name;1" . What does it mean?
I read somewhere that it is used to make different versions of stored
procedure with different parameters. But I couldn't find that article
anymore.
I use SS20... more >>
Manage SQL Server 2000 database from new workstation?
Posted by Noozer at 4/5/2006 12:00:00 AM
I'm currently using a new workstation and need to manage some databases on
my ISPs SQL 2000 server.
I've tried installing SSMSEE, but it won't install since I don't have
SQL2005 (or any SQL server) installed on this machine.
My host does not have a control panel that I can use to maintain ... more >>
|