all groups > sql server programming > july 2004 > threads for monday july 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 31
If a column value is NULl....
Posted by Anubis at 7/5/2004 11:22:23 PM
Hello All,
I have what may seem a stupid question...
If a column value is null, does it still take the same amount of space as
the column data type specifies?
Thanks
-Steve
... more >>
SQL Between
Posted by Gary Whittle at 7/5/2004 9:37:20 PM
Hello,
I want to try and create a fairly simple SQL query without referring to a
calander table:
This is not real code, how I imagine it will roughly look:
SELECT (*)
FROM tblEnquiries
WHERE cmnEnquiry BETWEEN (LAST MONDAY) and (THIS FRIDAY)
Basically I want my SQL query to be able t... more >>
sp_attach_single_file_db
Posted by Frank Dulk at 7/5/2004 9:18:02 PM
It is possible atachar the file.MDF in another instance of SQL through the
command sp_attach_single_file_db in Query Analyser. This command creates a
new file of zeroed log and atacha the database with success, but would like
to know the consequences of that.
... more >>
Update table onw based on table two
Posted by Martin at 7/5/2004 6:47:06 PM
Hi,
I am having a problem deriving an update statement that update one table
based on the content of an Identical table.
I would appreciate some help on this. I have included DDL below.
What I would like to do is this,
TBL_ONE and TBL_TWO have identical structure, I would like an sql statem... more >>
Authentication issues
Posted by Paul King at 7/5/2004 6:41:06 PM
Hi all,
Im trying to connect to my SQL (local) database using an ASPX page by using
a connection string.
Intially I got this working by using the SA account, but I was told this is
a potential security threat so I changed it to Windows Authentication.
However I have created a user in the DB... more >>
Creating System SPROC
Posted by Scott at 7/5/2004 6:23:40 PM
I have a simple SPROC below that I use inside a database. I pass a table and
field and it returns the max date in the table.
I'd like to put it in my MASTER database, so I can call it to return max
dates in several databses on my server. I know I need to add a variable for
the database name. I... more >>
Stored Procedures/Result Sets
Posted by José Araujo at 7/5/2004 6:21:24 PM
Hi,
I am trying to accomplish something that should be easy, but i haven't found
a way of doing it.
I have two stored procedures, the first one returns a dataset (rows), the
second one is supposed to cycle through the returning rows.
More specific: i am trying to use sp_helptext to get th... more >>
master
Posted by JIMMIE WHITAKER at 7/5/2004 5:33:02 PM
In a master access database, when you see the linked tables with the globe
next to them, does that mean the tables are in the main server, but
everything else is on client computer? If this is the case, can you
manipulate the data (tables) as though they were on client computer? In
other words ... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Diff between xxx_data.mdf and xxx.mdf files
Posted by Ashish Kanoongo at 7/5/2004 5:24:30 PM
What is difference between "xxx_data.mdf" and "xxxx.mdf"? IN Sql2k, I =
created, attach and detach database manytimes. SOme time its shows the =
database file name as "xxx_data.mdb and xxx_log.mdb" and sometimes it =
only shows file name as "xxx.mdf and xxx.ldf", why? However in =
Enterprise man... more >>
Reading rtf from an image field
Posted by Gareth Thackeray at 7/5/2004 5:16:20 PM
Hi,
Tasks in a MS Project SQL Server database have an image field called
TASK_RTF_NOTES. It contains text in RTF format. We would like to convert
this within a standard SQL statement into plain text.
I suspect this is not possible without some sort of bolt-on, or at the very
least using T... more >>
export
Posted by marc at 7/5/2004 4:28:06 PM
Hi
isn't there an easy (and faster) way to export results of a stored procedure
to a file without the bcp command or defining a DTP package?
Thx
Marc
... more >>
Enterprise Manager changes table's ID in sysobjects
Posted by Neil W at 7/5/2004 4:21:33 PM
Has anyone noticed that if you modify a table definition (e.g., add a new
column) using Enterprise Manager, the table Id in sysobject changes!
However, if you change the table definition with ALTER, the table Id remains
the same.
Does that mean that EM should not be used to modify table defini... more >>
Handle quote in data
Posted by Simon Jefferies at 7/5/2004 2:42:02 PM
Hello,
How do I handle a quote in the following SQL statement?
SELECT * FROM Person WHERE Name = 'Bob's'
I've tried wrapping the word "Bob's" in speech marks but this doesn't work
either.
Any help is appreciated?
Simon
... more >>
utility for generating format files for bulk insert?
Posted by Alexander Nenashev at 7/5/2004 1:28:54 PM
yes, there's one in dts bulk insert task
but it requires the same number of cols for source & destination.
are there any other alternatives on the market?
... more >>
General Troubleshooting Needed
Posted by rekcah NO[at]SPAM freeshell.org at 7/5/2004 12:57:28 PM
We have a database in SQL Server 2000. To write to this database I'm
using Coldfusion. We've come accross a problem with the database and
I can't pin down what the issue is. I was hoping that someone could
give me some more generalized troubleshooting to help me solve the
problem.
Basicall... more >>
select during transaction**
Posted by RM at 7/5/2004 12:26:05 PM
Hi
I'm working with SQL server 2000 and have
following problrm:
in query analyzer I want to update
one row of my table called 'books' in
a transaction
my table structure and data 'book' is :
book_id(PK) book_desc
---------- ------------
1 physics
2 test
3 psychology
4 culture
... more >>
Troubles truncating floats to a fixed precision...
Posted by faustino Dina at 7/5/2004 12:16:03 PM
Hi,
I'm having troubles with truncating float variables. I need to convert a
float to 6 digit precision after some div operation. The division operation
causes the result to have very long number of digits. I need this value to
be truncated to 6 digits precison. I've tryed by using
Round(@f... more >>
transaction log
Posted by taha at 7/5/2004 12:15:30 PM
Hi All
how Can i Restore Data From transaction log File
tankes
... more >>
encription issue
Posted by Enric at 7/5/2004 11:38:01 AM
fellows,
I would like to create two functions in order to encrypt tables data (all of them of any db). First one would be for instance:
encrypt() and the second one outencrypt() using any formula and UNICODE function.
Any idea or suggestion will be well welcomed,
Cheers... more >>
Error 8114 on big query - how to hone it down?
Posted by Mark G. Meyers at 7/5/2004 11:11:49 AM
I have a big select into statement I'm running from QA (on the same machine
where the DB is). I've used it in the past, and it worked then. It's with
the NBI (National Bridge Inventory), trying to convert some data types, so
there are over 600,000 records with 120 or so fields each. It runs fo... more >>
System vs User Databases
Posted by JulietaI at 7/5/2004 10:56:02 AM
Hi! I´m trying to get a list of user databases and cannot find any better way than:
select name from master.dbo.sysdatabases
where name not in ('master', 'tempdb', 'model', 'msdb')
or
select * from master.dbo.sysdatabases
where dbid > 4
order by dbid
Is there any table/view which i... more >>
Password Retrieval System
Posted by Iain West at 7/5/2004 10:55:38 AM
Apologies if this should be posted else where but I am not sure where to
start.
I have a sql database and one of the tables (user) contains three fields,
usercode, userpassword, useremail.
I want to be able to have an e-mail sent to an address eg
password@mydomain.com and an automated rep... more >>
SQL Profiler doesn't filter
Posted by A.M at 7/5/2004 10:48:34 AM
Hi,
Using SQL Profiler, I can not filter events by criterias which use "Like"!
Equals filters (like SPID) work fine.
For example if I put "rpt" as "application name like" filter, still it shows
all applications that are not even similar to the name "rpt". That means the
fiter doesn't work!
... more >>
Data encryption
Posted by Enric at 7/5/2004 10:20:01 AM
fellows,
I would like to create two functions in order to encrypt tables data (all of them of any db). First one would be for instance:
encrypt() and the second one outencrypt() using any formula and UNICODE function.
Any idea or suggestion will be well welcomed,
Cheers... more >>
Queries
Posted by Enric at 7/5/2004 10:14:01 AM
Hi again,
Which these methods faster is? I have heard lots of histories and legends about it. Could you please anyone explain me?
Select * from t1 inner join t on t1.id = t.id
Select * from t1, t where t1.id = t.id
Thanks for that,
... more >>
Do I need more integrity on my DB?
Posted by gazawaymy at 7/5/2004 9:59:01 AM
I am not sure I need more integrity on my DB. My DDL are down below.
create table person(
personId int identity(1,1) primary key,
fName varchar(25) not null,
mI char(1) null,
lName varchar(25) not null
);
create table student(
studentId char(4) not null primary key,
personId int not ... more >>
Improving autocontained query
Posted by Enric at 7/5/2004 9:51:01 AM
Hi fellows,
This one works properly:
select 'select * into '+ name + replace(substring(cast(getdate() as varchar(15)),1,12),' ','') + ' from '+name +''
from sysobjects where xType = 'U'
As a result, for example:
"select * into tbl_EI_Export_GoodDataJul52004 from tbl_EI_Export_GoodData... more >>
How Can I Do This
Posted by taha at 7/5/2004 9:41:30 AM
Hi All
I Have Tow Tables One Main for Main Information And 2 Child For Loan Values
I Need TRIGGER Do Balance in Loan Table Whene I Insert New REcord In Main
Table
like This
CREATE TRIGGER [monthly_Action _insert] ON monthly_Action
FOR Insert
AS
Declare @NewM Money,
@NewA Money,
@N... more >>
Temporary table and procedure - resources
Posted by Miroo_news at 7/5/2004 9:35:04 AM
Hi
What take less resources, global temporary table
or global temporary procedure? Tables and procedures
will be empty, I'll be using their names only.
How many such objects can cause problems in cheap system
(Windows XP Home, Celeron 1.2, 256MB RAM)?
I'd like to use it to keep information w... more >>
SQL Server 2005 Express Beta messes up your SQL Server 2000, BEWARE
Posted by ik at 7/5/2004 9:06:51 AM
ERROR after uninstalling SQL Server 2005 Express
I get this message,
SQLDMO has not been registered. Please re-run your setupand contact your
system administrator.
GREAT!!! ReInstalled SQL SERVER 2000 after playing around with SQL Server
2005...
Snap In Failed to Initialize,
Name: Sql... more >>
Customizing Duplicates in Returned Dataset
Posted by Jackie42 at 7/5/2004 8:37:01 AM
With the following 2 tables linked on Emp_ID:
Emp_ID F_Name L_Name
1 John Lassiter
2 Doris Clarkson
3 William Finley
AND
Emp_ID F_Name Relationship
3 Janet Spouse
2 ... more >>
Dynamic Group by Clause based on User Inputs
Posted by hgeraght NO[at]SPAM yahoo.co.uk at 7/5/2004 8:21:25 AM
To avoid me having to write numerous stored procedures. Does anybody
have a nice way of creating a dynamic group by clause that is based on
columns select by the user and performs well, preferably not using
dynamic SQL?... more >>
Image
Posted by x-rays at 7/5/2004 8:16:01 AM
Hello Experts,
I'm a little bit confused about how to store an Image in
a column.
Do I have to use the WRITETEXT CLAUSE in order to store
an image? why?
I tried a simple insert query, which table has an image
column and Inserted binary data to it. It worked.
Do I have to "play" with ... more >>
Specifying collations on the fly
Posted by thomas.widmann NO[at]SPAM harpercollins.co.uk at 7/5/2004 7:50:25 AM
Hi,
I'd like to be able to sort according to a collation specified
in another table.
To be specific, I'd like to extend the following (working code):
select en.sortkey
from entry as en
join dataset as ds on ds.id = en.datasetid
order by en.sortkey collate SQL_Latin1_General_CP... more >>
Deletin db
Posted by eNerGiZer1010 at 7/5/2004 7:49:02 AM
G'day,
What I want to do is delete all data found in jobs table
because I need to update it by running a script on a log
file.
When i wrote the function it gave me a script error
the syntax in near '<'. Here's what i re-wrote:
FROM Jobs alter_database < Jobs >
SET s... more >>
a field which contains an enter
Posted by mr.may at 7/5/2004 7:25:01 AM
I have a varchar field in my table, which is represented by a textarea in the update screen. as you understand, the user can type ENTER to get a new line in this field.
How can i find all the values which contains a new line sign in it?
i tried:
SELECT CLT_info
FROM clients
WHERE CLT_info
l... more >>
a field which contains an enter
Posted by mr.may at 7/5/2004 7:11:01 AM
I have a varchar field in my table, which is represented by a textarea in the update screen. as you understand, the user can type ENTER to get a new line in this field.
How can i find all the values which contains a new line sign in it?
i tried:
SELECT CLT_info
FROM clients
WHERE CLT_info
l... more >>
How to get all SQL servers and System DSNs????
Posted by (rahim_momin NO[at]SPAM yahoo.com) at 7/5/2004 6:21:50 AM
Hello All, I am delveoping a wizard application in VC++. one of the taks it is supposed to do is Creating a new DSN, if one is not already setup on a local computer. For that matter I need to get all SQL severs over the network. Also I need a code snippet that can get all System DSN that are already... more >>
Getting contents of index in a MS SQLTable
Posted by AL at 7/5/2004 5:40:01 AM
Hello all together
I am a developper with many experiences in database programming, but not in SQL Databases, and not in MS SQL 7. 0. Now I'm writing a program in VB with forms which contain a combobox for every field in each table. But the associated list should show the index of the Field while p... more >>
Alter tables and retain data is this possible with SQLDMO?
Posted by chris.lawrence NO[at]SPAM hughsymons.com at 7/5/2004 5:04:55 AM
I am attempting to copy tables from sql server 2000 database to
another using the SQLDMO object using c#.
I really need to find a way to copy a table(s) from source to target
database but retaining the data already in the target database.
e.g. Two new columns are added to a table in the sour... more >>
Please help...am I hacked?
Posted by joker197cinque NO[at]SPAM yahoo.it at 7/5/2004 3:30:49 AM
I'm pretty sure that I'm under a sort of attack towards my w2k server
sp4/Sql server 2ksp3a box machine.
I run a web server with IIS5 and Sql 2k together.
- 1433/1434 closed by firewall.
- Virus free
- All patched
I usually monitor proc activity (and some other stuff) from windows
perfm... more >>
selecting top rows of ordered values
Posted by roger at 7/5/2004 12:28:34 AM
Here's one I can't quite figure...
For a query that returns rows that are ordered
by a columns A,B eg:
A B
---
0 1
0 2
0 3
1 2
1 3
1 4
2 3
2 4
2 5
....
How does one select the top N rows from each batch
of identical values of column A?
Thanks
... more >>
Help! real field problem!
Posted by Ann at 7/5/2004 12:04:52 AM
Dear all,
I have a critical problem. The problem is, I have a field
type "real". I need to insert a record which is
1212121212, after inserted the record and select the
record, the result is 1212121216! I know that this may
come from real type field problem. But I cannot change the
fiel... more >>
|