all groups > sql server programming > september 2007 > threads for monday september 24
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
Multiple databases or single database, that is the question
Posted by Michael MacGregor at 9/24/2007 11:01:18 PM
I have worked on various systems where there are multiple customers and the
system is configured such that for each customer there is a separate
database. I have also worked on systems where there are multiple customers
and only one database.
My particular preference would be for a database... more >>
query question
Posted by Guy Cohen at 9/24/2007 9:40:36 PM
Hi all
I hope this is the right place to ask.........:)
I have this case -
I have a list of employees that should get a letter this month (e.g. happy
birthday), also their 'rank A' manager should get a letter.
These are the tables:
Table1 =tblBirthdayList = The table with the list of ... more >>
How to get a total sum
Posted by zwieback89 via SQLMonster.com at 9/24/2007 8:17:28 PM
Hi,
I have a query that shows a total number of hits for each day. The query is:
SELECT DateAccessed, COUNT(IPAddress) AS Hits
FROM Hits_ThirdQuarterVideo
GROUP BY DateAccessed
My question now is how to get the total sum of all the counts per day? Is
this possible to do so in... more >>
OPENROWSET error and SQL service restart
Posted by Keith at 9/24/2007 7:40:42 PM
The problem is as follows:
When I execute queries that utilize the OPENROWSET command they fail
on both our Production and Test servers (they are identical installs
of OS and SQL server 2005 sp2). Checked permissions, file is on local
drive, connection string is correct, etc. If I restart ... more >>
Does anyone know any available tool used for viewing the impact on database and stored procs from changes
Posted by chenyuxue1979 NO[at]SPAM gmail.com at 9/24/2007 7:25:15 PM
Hey guys,
Does anyone know any available tool which can be used to view the
impact on database and stored procs when some changes have been made
on the database. For example, changing the name of a column in a
table, changing the data type of a column from uniqueidentifier to
34-
byte int, c... more >>
FOR XML AUTO query doesn't work on 2005
Posted by A X L V at 9/24/2007 6:31:30 PM
Hello,
Need help, I am trying to make a code in this example work on SQL Server
2005 and classic asp (vbscript):
http://msdn2.microsoft.com/en-us/library/ms180838.aspx
We have a very similar code that works on SQL Server 2000, it returns XML. I
am using OLEDB provider. I've also been usin... more >>
SQLCMD rows affected
Posted by at 9/24/2007 5:28:14 PM
Necesito exportar los datos de una tabla a un archivo de datos
planos.
Estoy utilizando la utilidad SQLCMD de la siguiente forma:
sqlcmd -S myServer -o plain.txt -U username -P password -d dbName -Q
"SELECT * FROM tabla " -h-1 -s ","
El resultado es correcto, sin embargo no encuentro la fo... more >>
GetDate() - 93 OK to use?
Posted by John Kotuby at 9/24/2007 5:07:38 PM
Hi all,
I was looking a some of my stored procedures to optimize. I notice that when
a user selects to "Browse All" Invoices, to restrict the number of records
returned (possibly millions), for that option I just return the last 3
months invoices.
I was using the filter "where INV_DATE > ... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
Linking Tables on a Calculated Field
Posted by Cindy Mikeworth at 9/24/2007 4:18:19 PM
I am attempting to create a SQL view for a client that pulls data together
from multiple tables into one view. There are four tables involved,
simplified as follows:
EMPLOYEE TABLE:
Employee_ID : 00001
Last_Name: Doe
First_Name: John
Division: FNNE
Postion: DENHYG
SKILL SET SETUP TAB... more >>
using numeric/decimal types in stored procedures
Posted by dd12345 NO[at]SPAM comcast.net at 9/24/2007 3:17:13 PM
I am having a problem with some stored procedure parameters of type
decimal (or numeric).
I get errors like the following:
Error converting data type varchar to numeric
I tried changing certain parts of it (i.e., using decimal types rather
than numeric, changing the size, the sc... more >>
t-sql for alter table to change field to identity
Posted by mcnewsxp at 9/24/2007 2:29:47 PM
what is the syntax for changing a column to an identity data type?
tia,
mcnewsxp
... more >>
pivot
Posted by arkiboys2 at 9/24/2007 1:50:06 PM
Hi,
I would like to write a sql query in sql server 2005 to derive a table
called tblResult from tblData as follows:
I think I should use unpivot.
tblData
Notice the dates are fields
surname 26 Dec 27 Dec 28 Dec 02 Jan 04 Jan 05 Jan
Brown 100.2 12.65 43.76 3.54 98.12 56.76
Jackson 3... more >>
Query question
Posted by JohnnyC at 9/24/2007 1:15:40 PM
Hello,
I am trying to create a query to count records based on a comparision a
substring of a value in the table to a variable that is passed to the query,
but if the passed variable is in the table, flagged as 1, then do not count
it.
DDL
CREATE TABLE [dbo].[IPBlock](
[rowid] [int] I... more >>
Question about optimization
Posted by Mark Goldin at 9/24/2007 1:01:01 PM
If I have a statement that looks like this:
select f1 from udf_tablefunction()
union
select f2 from udf_tablefunction()
union
select f3 from udf_tablefunction()
union
select f4 from udf_tablefunction()
then udf_tablefunction() will be executed 4 times. Is that correct or the
statement wi... more >>
SELECT query
Posted by Lubomir at 9/24/2007 12:24:01 PM
Hi,
I have a simple query fro 2 tables but it seems to be not working as
expected in certain situation.
If both tables contains any records, query works properly. If one of the
tables is empty, I don't get back any records, even I expected to get the
records from table which contains any... more >>
DECLARE question
Posted by Mark Goldin at 9/24/2007 12:23:34 PM
Can I use DECLARE keyword in a table-valued function?
Thanks
... more >>
Complex Query for Stock quote
Posted by stevenleongusa NO[at]SPAM gmail.com at 9/24/2007 11:54:54 AM
I have given the following question. I need help on this.
Given a schema for a stock trades table that looks like:
*stocktrades (*
* symbol string, -- stock symbol*
* shares integer, -- number of shares traded*
* price float, -- price of the stock for this trade*
* timest... more >>
Question regarding "HAVING COUNT(*) = 0"
Posted by Curious at 9/24/2007 11:10:28 AM
I have an SQL statement:
INSERT INTO Environment
(
EnvironmentName,
ReadOnly
)
SELECT
'Retired environment',
0
FROM
Environment
WHERE
EnvironmentName = 'Retired environment'
HAVING
COUNT(*) = 0
Is there any difference between this SQL statement and the following
SQL statem... more >>
Multiple Matching Rows Problem - how to avoid a cursor
Posted by acmsdad NO[at]SPAM gmail.com at 9/24/2007 10:15:42 AM
Given the following sample table and data, is it possible to produce
the desired results using a set based solution? (i.e. no cursor)
DECLARE @temp_tb TABLE
(
quantity INT,
uti INT,
matchquantity INT NULL,
matchuti INT NULL
)
INSERT INTO @temp_tb SELECT 100, 1, NULL... more >>
Select
Posted by shapper at 9/24/2007 8:43:56 AM
Hello,
I have 2 related tables:
[A] > Aid (PK), Title, Name, ...
[B] > Bid (PK), Aid (FK), B
I use the input parameterd@Aid
> Select the record in A where Aid = @Aid
> Select all the records in B where Aid = @AId
In my C# code I have a class named A with the properties:
Title (String)
... more >>
Object already in database.
Posted by Jaco at 9/24/2007 5:54:01 AM
Hi,
can anyone see the obvious why I get an error :
"Msg 2714, Level 16, State 1, Line 18
There is already an object named '#tmpIS' in the database."
running this code?
IF exists (select Table_Name from AuditSelectedColumns where Table_Name =
'table1')
begin
select SC.AuditSelected... more >>
Performance Issue
Posted by Rahul at 9/24/2007 5:36:02 AM
Hi,
I have performance Issue.
I have a bunch of DTS packages, execute in a sequence.
Every thng is fine, but one problem is there and i have not any idea
about that.
the problem is :
When i execute this package and fire some other sql statements during
execution with nolock on tables, t... more >>
Simple query question
Posted by calderara at 9/24/2007 2:12:01 AM
Dear all,
I have a querry which is suppose to collect infomration from an other
database how to do it ?
in fact I need to select data from DATABASE1.TABLE 1 and insert them in
DATABASE2.Table1
How to play with 2 DB ?
regards
serge... more >>
BOL
Posted by Paddy at 9/24/2007 12:00:00 AM
Am I missing something really obvious, but is BOL for 2005 a lot lot
worse than BOL 2000?
I have set my options to look at msdn first from now on. The local
help seems in general to be pretty poor.
a search for sp_executesql returns nothing from local help. I have the
most recent version in... more >>
Best method to Query an (ItemA, ItemB, MixResultC) table where...
Posted by A Ratcliffe at 9/24/2007 12:00:00 AM
Not the best way to describe the problem but...
The situation I'm dealing with a is a table of blends/crosses.With a table
as follows:-
ItemA: bigint (non-NULL)
ItemB: bigint (non-NULL)
ItemResult: bigint (non-NULL)
Items A, B, and Result are bigint keys back i... more >>
How to use - exec sp_repladdcolumn
Posted by SOHO at 9/24/2007 12:00:00 AM
please help me.
exec sp_repladdcolumn @source_object = 'name1'
, @column = 'col1'
, @typetext = char(20)
--------------------------------------------------
°T®§ 170¡A¼h¯Å 15¡Aª¬ºA 1¡A¦æ 3
Line 3: Incorrect syntax near '20'.
--
Thanks!
... more >>
Basic Question
Posted by Mark Blackall at 9/24/2007 12:00:00 AM
Hi all,
I am trying to modify the first character of the column stockitem but I don't seem to be able to get the correct syntax. Any ideas?
UPDATE stockitem
SET substr(code, 1, 1) = '7'
WHERE Code LIKE '[0]%'
Any help gratefully received.
Mark
... more >>
|