all groups > sql server programming > december 2006 > threads for monday december 4
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
Execute Variable
Posted by TBoon at 12/4/2006 10:21:00 PM
declare @vA varchar (50)
set @vA = 'select count(*) from Table1'
How can I execute the variable @vA in T-SQL?... more >>
IIF functionality
Posted by vanitha at 12/4/2006 9:21:01 PM
i want to achive the IIF functionality.
example
select
iff(employee.empid is not null,'sdfsdf',iif(employee.deptid is not
null,'dssdf','sdfsd')) as 'sdsd'
from employee
how to solve this.
thank you
vanitha
... more >>
no date values in parameter
Posted by ana9 via SQLMonster.com at 12/4/2006 7:36:21 PM
I am trying to give the user the option to query between dates. I have
enabled the Allow NULL value to let the user choose if they want to query
between dates or not but it's not working. Is there any way to allow blank
date fields?
--
Message posted via SQLMonster.com
http://www.sqlmonst... more >>
T-SQL SubQuery
Posted by Joe K. at 12/4/2006 5:21:00 PM
The University table has Students and Supervisor in the same table with
UserName as varchar format.
How would I write a query to extract the Student with their Username and
there corresponding supervisor with their username?
Thanks,
select ID,Student,Username,Supervisor From Un... more >>
SQL-DMO and multithreading
Posted by bertiew at 12/4/2006 4:29:00 PM
Is DMO thread safe if I initialize COM as
CoInitializeEx(NULL, COINIT_MULTITHREADED); ?
There is this note at the end of this kb which talks about DMO
threading(http://support.microsoft.com/default.aspx/kb/899556)
--------------------------------------------------------------
"When you use ... more >>
sql job backup and DBCC CHECKDB
Posted by JJ at 12/4/2006 4:25:11 PM
2 questions regarding sql server 2000
1. If you want to backup the scheduled jobs (jobs you see under
Management->SQL Server Agent->Jobs in enterprise manager), do I need to
backup msdb database?
2. When you want to check the integrity of the database, do you run DBCC
CHECKDB? What option... more >>
Subquery in the Select list - error message Invalid column name
Posted by gv at 12/4/2006 3:43:44 PM
Hi all,
I'm getting this error message. I'm trying to use subquery in the Select
list.
Error message is:
Server: Msg 207, Level 16, State 3, Line 14
Invalid column name 'Carrier ID'.
Server: Msg 207, Level 16, State 1, Line 14
Invalid column name 'Carrier ID'.
Server: Msg 207, Level 16,... more >>
Multiple search criteria performance issue, Take 2!
Posted by PMarino at 12/4/2006 3:38:01 PM
Ok, so I'm stupid and hit 'Tab', which caused the last message to post...let
me start again...
Hi - I have a question with something I'm seeing with using a technique for
multiple search critera. I've boiled it down to a simple case here.
I have a stored procedure that started out looking... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
SQL2K5 XQuery data types
Posted by Mike C# at 12/4/2006 3:24:03 PM
Hi all,
Re-posting this question from sqlserver.xml newsgroup, since no one there
seems to have an answer. Basically I'm trying to determine the value space
of the xs:float XQuery data type in SQL Server. It seems to be different
from both the SQL REAL data type and the W3C XQuery standar... more >>
How do we perform upper() , LTrim(), RTrim() on Text Datatype?
Posted by user at 12/4/2006 2:51:50 PM
Hi,
I have a storedproc which deals with insertion of text datatype. How am
I suppose to perform the above functions on them?
Also, is Text datatype backward compatible with SQL 2000 Server?
Im using SQL 2005 at the moment.
Please advise.
Thanks.
... more >>
joining a temporary ado datatable with database table?
Posted by jobs at 12/4/2006 1:07:20 PM
Is there any way to select join a huge database table with a temporary
ado datatable. I want to construct a select from the huge table that
only pulls rows with the same keys from the much smaller ado datatable.
I'm looking to avoid pushing up the datatable or pulling down the huge
database tabl... more >>
using s.p. returned table?
Posted by ChrisA at 12/4/2006 12:43:01 PM
I' have a stored proc that returns a single result set. I'd like to do a
Union of that with another Select, but can't find the syntax. Can this be
done??
Thanks... more >>
SQL subquery with multiple columns
Posted by Scudder at 12/4/2006 12:43:01 PM
I know it is not an option to return a SQL subquery with multiple columns. I
cannot seem to find a simple alternative. Here is a siimplified version of
what I'm trying to accomplish...
Return all records from table USERS even if they have nothing in the SALES
table. On the same line, ret... more >>
Make a Division in SQL Server
Posted by rguarnieri at 12/4/2006 12:37:32 PM
Hi my name is Ruben and I have a problem in my query, I can't see my
decimals in the result of a query in my sql server 2000 enterprise
manager.
Sample:
Select Value1, Value2, Value3
from myView
Result
Value1 Value2 Value3
5 45 435
40 45 435
so f... more >>
Upgrading From SQL 2000 A few questions.
Posted by Goofy at 12/4/2006 12:17:38 PM
Hi All,
Not sure if this is the most appropriate group to ask this, so appologies if
its in the wrong place, anyhow!
Currently, we are running VS2003, SQL Server 2003 and have implemented a
number of reports using the embedded Crystal Reports Version 9. Although
this works, we want to g... more >>
Avoid cursor loop and stored procedure?
Posted by Robert Klemme at 12/4/2006 11:59:48 AM
Hi,
I have attached a piece of SQL that is an abstraction of a situation I
am facing. Basically I have a fact table and a dimension table and want
to create dimension values on demand, i.e. whenever there is an insert
into the fact table for a dimension value that does not yet exist.
... more >>
VB6 project with SQL2000 and SQL2005
Posted by Esha at 12/4/2006 11:56:58 AM
I asked my question in VB groups and was suggested to ask here.
My question:
I have VB6 project working with SQL2000 database. I use ADO.
Is it going to work without any change with the same database attached to
SQL2005?
If NO, then what kind of changes are required to make it work?
Thank ... more >>
Min/Max Query Again?
Posted by Mark J at 12/4/2006 11:51:00 AM
i have the following query written;
SELECT TOP 1 TagName AS Tag, MAX([Value]) AS [Value],
CONVERT(varchar(15), DateTime, 108) AS [TimeStamp], DateTime
FROM AnalogHistory
GROUP BY TagName, CONVERT(varchar(15), DateTime, 108), DateTime,
wwRetrievalMode
HAVING (DateTime >= CO... more >>
normalization question
Posted by WalterWalt at 12/4/2006 11:37:24 AM
Given the below Table1 fields, since the Type1_Date and Type1_Amount fields
should be null unless Type1_Flag is true, and even though this is a 1 to 1
relationship, should the Type1 data be broken off into a separate table and
the flag could be determined by if the Type1_Id field is null? Than... more >>
Exclude HTML tags in my search criteria
Posted by yaser at 12/4/2006 11:30:39 AM
Hi all;
I would like to exclude HTML tags in my search criteria i.e. when I look
for body word I desire the search to include the body words which included
in the body field but I don't want to include <body>or </body>or <head>or
<meta--à knowing that the intended field in the database of ... more >>
Duplicating a database
Posted by Steve Blain at 12/4/2006 11:22:00 AM
I am trying to use the backup and restore T-Sql commands in order to
duplicate a database on the same server for test purposes. Our clients like
the option of trying out new things on a copy of the database before they go
live and our app supports multiple database names.
I am using code l... more >>
IF EXISTS & Indexes
Posted by Eric Humphrey at 12/4/2006 11:21:37 AM
Do indexes affect IF EXISTS? With the below example, would creating an
index on user_updating affect the performance of the IF EXISTS statement?
Example:
CREATE TABLE client (
client_id INT PRIMARY KEY IDENTITY,
user_creating INT,
user_updating INT
)
DECLARE @client_id INT, @us... more >>
Result with just one decimal point
Posted by Adrian Smith at 12/4/2006 10:27:08 AM
I want to return just the one decimal point using the following the
following:
SELECT ROUND((CAST(41 AS FLOAT)/CAST(129 AS FLOAT))* 100,1)
This returns 31.800000000000001, and I just want 38.1
It's got to be easy, but ....!
Thanks for any help.
Adrian
... more >>
Retrieving data from text file on Internet
Posted by Irvin McCoy at 12/4/2006 10:23:01 AM
I am needing to retreive a data feed text file from the Internet. The data is
updated every 2 minutes, so I need to read the data and get it into a table
before the next data is posted. I think this needs to be done in a stored
procedure, but I'm a beginner and I've never done stored procedure... more >>
List of Users on Database and there permissions
Posted by gv at 12/4/2006 9:59:56 AM
Hi all,
using SQL 2000
Trying to get a list of current users and permissions on a certain database
using
a query?
thanks for any help
gv
... more >>
"general" backup strategy
Posted by JJ at 12/4/2006 9:45:57 AM
I am curious about general DBA's backup strategy.
Do you backup directly to the network drive? or backup directly to the same
server that hosts sql server and have window or other 3rd party software
backup to a network drive or tape? When you do frequent log backups, how do
you back up the... more >>
Database Restore Problem SQL Server 2005
Posted by Nizham at 12/4/2006 9:45:12 AM
Hi
OS Windows server 2003 SP1
SQL Server 2005 Slandered Edition
We try to restore the backup from the bak file and it is giving the
following message
System.Data.SqlClient.SqlError : Restore Detected an error on page (0:0) in
database "Database_Name" as read from backup set (Microsoft.... more >>
SQL Server 2005 Hanging - Selecting uncommitted data
Posted by lh at 12/4/2006 9:39:17 AM
We have found an issue with using MSS 2005 with odbc connections, some of
our code inserts data, then reselects the data back with a select using a
different handle. This hasn't caused any issues before but in one customer
this causes a lock up. The timeout error doesn't occur as you would expe... more >>
Last Name and Then 1st Query
Posted by Lontae Jones at 12/4/2006 8:57:00 AM
Hello
I have a column that is called Contact varhcar 100. It stores names such as
John Smith. I would like a query to return Smith John.
TIA... more >>
Get the date of a file on the network using SQL CMDExec
Posted by Han at 12/4/2006 8:53:01 AM
Hi all,
Does anyone know how to use SQL Operating System Command CMDExec to get the
date time of a file on the network, then write the data and time in a
pre-existing table?
Thank a lot in advance for any help.
Han,... more >>
SQL encryption
Posted by shank at 12/4/2006 8:35:49 AM
I need a simple functon or scheme to encrypt two fields I will concatenate.
I don't want to get into full blown components etc.
Also, free is always better...
thanks!
... more >>
Creating a month by month lookup table from incomplete data.
Posted by philipbennett25 at 12/4/2006 8:24:56 AM
Hi, I hope someone has an idea how I might do this.
I have a table that shows goods recieved. Simplified it looks something
like this:
Part Date QTY Vendor
---------------------------------------------------------------------
12345 01/02/2006 ... more >>
Date Table vs Date Functions
Posted by BillyRogers at 12/4/2006 6:36:00 AM
I have lots of long scripts that I have to run every month. I've created
some date functions in order to avoid have to key in new dates every month.
I'm wondering if the scripts might run faster if I used a dates table
instead of date functions throughout the script.
--
Billy Rogers
... more >>
How change columns into rows...
Posted by mike at 12/4/2006 6:21:00 AM
Hello,
someones knows how display columns in rows this is,
Original Query to Transform:
FIELD_1 - FIELD_A - FIELD_B - FIELD_C - FIELD_D
X-2-4-6-8
Y-1-3-5-7
Z-3-7-11-15
Query Transformed (Target):
NEW_FIELD - FIELD_X - FIELD_Y - FIELD_Z
A-2-1-3
B-4-3-7
C-6-5-11
D-8-7-15
This ... more >>
Comma Seperated string
Posted by -pb- at 12/4/2006 5:59:57 AM
Hi,
I got a table which has 2 columns and few rows inside it as shown below
Column1 Column2
Z A
X B
Y C
W D
and so on...
Now I wanted to know whether it is possilbe to output above records in
one row wit... more >>
using bit fields
Posted by HSPoulsen at 12/4/2006 5:54:26 AM
I've be avoiding the bit field type, and used tinyint or integer
instead.
Now I've been challenged by a new colleague, as to why...
First of all, I've had difficulties understanding why it is possible
for MS SQL Server in one bit to store the values false, true and null.
Surely this takes two... more >>
SELECT. Need advice. How should I code this?
Posted by shapper at 12/4/2006 5:16:44 AM
Hello,
I need a procedure to return the value of field [ContentHtml] given
values for [ContentName] and [ContentCulture].
In theory only one record will be found so only one [ContentHtml] value
will be returned.
If multiple records are found I want to return "#MultipleFound#".
If no reco... more >>
SQL Server Express - Why Two Versions for SP1?
Posted by Scott at 12/4/2006 5:00:01 AM
All,
I had downloaded SQL Express SP1 a few months ago. The version for that
download was 2005.090.2040.00
However there is an new download link
//msdn.microsoft.com/vstudio/express/sql/download/
for SQL Express SP1 and it's version is 2005.090.2047.00
Does anyone know why these version... more >>
|