all groups > sql server programming > september 2005 > threads for tuesday september 6
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
SS2005 - ANSI Compliance Level
Posted by Garth Wells at 9/6/2005 11:37:43 PM
I posted this in the CTP newsgroups, but didn't get a response...anyone know
the
answer?
--
When I researched SQL Server 2000, I was told (I believe by Hal Berenson)
that
it was entry-level compliant with SQL-92, but the next version was going to
be
compliant with SQL-99. I haven't been ab... more >>
Error on Select Statement when Using IIF
Posted by Shariq at 9/6/2005 8:04:04 PM
What's wrong with this query? I get an error at ">" sign.
SELECT MyCol1, MyCol2, MyCol3Balance,
IIf(MyCol3Balance > 1, "Past", "No") as MyBalance
from MyTable
... more >>
CPU Time required for acessing the sql server database from VC++ application
Posted by vanisathish NO[at]SPAM gmail.com at 9/6/2005 7:47:06 PM
Hi All,
I am not sure whether i can post this qn. in this sql server forum.
I am accessing the sql server database from a VC++ application. I saw
that when the below statements are taking a CPU time of anywhere
between 5 to 15 %. I think some thing is wrong here..
myRecordSet.Open() //This ... more >>
ntext display
Posted by Rich at 9/6/2005 5:20:37 PM
Hello Community,
does anyone know why when I view a table that has an ntext field type in the
EM, it will display differently in the .NET Studio? When you look at this
field in the EM, I see this " <Long Text> ". The same field in the .NET
Studio maybe null, have text in it or it may ev... more >>
Writting CheckDB to a table or file
Posted by PP at 9/6/2005 5:20:15 PM
Greetings,
Does anybody know how can one send the results of DBCC CheckDB to a table or
file?
I'm trying to do that so I can more easily check DBs for corruption.
Thanks a lot
Pab... more >>
Naming my tables in a stored procecure which returns many results
Posted by John Rossitter at 9/6/2005 5:18:41 PM
Hi all,
This is probably a no-brainer, but I'm having a heck of a time trying to
form my question the right way for the search engines to return anything
meaningful.
I'm working with SQL Server 2000 and C# on .NET 1.1.
I have a stored procedure which looks like this
CREATE PROCED... more >>
Transaction Concurrency
Posted by Mike Labosh at 9/6/2005 4:52:55 PM
Suppose I have a stored procedure like this:
CREATE PROCEDURE dbo.BigFatBatch (
@sampleSourceKey INT
) AS
BEGIN TRANSACTION colocUpdates
DECLARE @retVal INT
EXEC @retVal = DoThisBatch @sampleSourceKey
IF @retVal < 0 -- error condition
BEGIN
... more >>
[OT] BWA HA HA HA HA!!!!!
Posted by Mike Labosh at 9/6/2005 4:27:05 PM
So I'm sniffing through the JobTitle table verifying that some weekend
cleanup batches completed properly. This table is what stores Contact Job
Descriptions; stuff like 'CEO', 'IT Manager', etc...
So I stumble across this guy:
FirstName = 'Bill'
LastName = 'Hilbert'
JobTitle = '(DECEAS... more >>
Don't see what you're looking for? Search DevelopmentNow.com.
table size
Posted by js at 9/6/2005 3:57:39 PM
hi,
sp_helpdb -> I know how big the database
how to know table size? Thanks.
... more >>
VSS in Sync with DB
Posted by Joe at 9/6/2005 2:31:20 PM
We use Red-Gate SQL Compare for keeping our DB in sync as we move up from
dev to test to pre-prod and finally production.
Now the developers aren't keeping VSS in Sync - is there an easy way to
compare VSS with our Dev environment?
As far as I can tell - Getting all the Objects from VSS an... more >>
triggers
Posted by greg at 9/6/2005 2:26:38 PM
hello,
i am creaing a trigger. on the table i do this: select >> all tasks >
manage triggers.
on a new row adding, i would like to grab the new row and add into column X
some text "y"
i think it something like this:
CREATE TRIGGER trig_XXX
ON my_table
FOR INSERT
AS
but not sure how to... more >>
Create temporary table in stored procedure
Posted by Skysurfer at 9/6/2005 1:13:40 PM
Hi all.
In a Stored Procedure if i write this:
SET @keyssql = 'SELECT DISTINCT MyTable.IdTipo'
SET @keyssql = @keyssql + ', NULL AS Descr INTO #keys FROM MyTable'
EXEC (@keyssql)
SELECT * FROM #keys
I get an error saying the table #keys does not exists.
But if I write this:
SELECT DISTIN... more >>
TableTextInRowLimit table property set to NULL?
Posted by peja at 9/6/2005 1:10:07 PM
Hi,
We have huge table (300GB) which has few text data type columns. In order to
decrease size of the table, we're considering turning TableTextInRowLimit to
ON.
However, current value is set to NULL! This value should be 0 if this option
is disabled, or size of the limit if this option is enab... more >>
Using SQL to extract unique values
Posted by Chris Asaipillai at 9/6/2005 1:02:25 PM
Im using the following query but not with the desired result
SELECT Computer AS Expr3, Drive AS Expr4, MAX(DiskSize)
AS Expr5, MAX(FreeSpace) AS Expr6, MAX(Percentage)
AS Expr2, Date AS Expr1
FROM tblFreeSpace
GROUP BY Date, Computer, Drive
ORDER BY Computer, Drive
Computer ... more >>
SQL Server 2005 User defined aggregation
Posted by B.M at 9/6/2005 11:45:49 AM
Hi,
Could some one please point me to some resource or simple example on how to
create SQL Server 2005 user defined aggregation with C#.
Thank you
... more >>
restore
Posted by js at 9/6/2005 10:03:05 AM
Hi,
When I run the sql:
RESTORE DATABASE mydb
FROM DISK='\\myserver\mydb.bak'
Got error:
Msg 3201, Level 16, State 2, XXXDELL, Line 2
Cannot open backup device
\\myserver\mydb.bak' . Device
error or device off-line. See the SQL Server error log for more
details.
Msg 3013, Level 16, Sta... more >>
urldecode udf
Posted by Joe Gass at 9/6/2005 9:21:20 AM
urldecode udf?
anyone got any pointers, or is there a better way for me to urldecode a
column?
Thanks
... more >>
how to use if...else
Posted by Abraham Luna at 9/6/2005 9:04:20 AM
i have 4 columns that hold phone numbers. at least one has to be filled in.
how could i select the first one with a value in it
i tried:
SELECT (IF PhoneWork != '' BEGIN (SELECT CAST(PhoneWork AS bigint)) END ELSE
(SELECT CAST('0' AS bigint))) AS PhoneWork FROM Customers
but that isnt w... more >>
How to re-raise an exception to the client
Posted by Jaime Stuardo at 9/6/2005 9:00:09 AM
Hi all..
I have a stored procedure in SQL Server 2000 with several UPDATE and INSERT
statements.
I'm using BEGIN TRAN before the first statement in the procedure, and after
each statement I'm testing @@ERROR variable to see if an error occures.
If it occures, I rollback and then return... more >>
plz guide me
Posted by varun malhotra at 9/6/2005 8:55:35 AM
i want to know which book is better for sql server programming. (t-sql)
(those books are available in india)... more >>
How do I take rows of data and insert into two tables?
Posted by Kevini at 9/6/2005 8:48:45 AM
I have a large amount of data in an excel spreadsheet and the data in each
row needs to be put into our database but split between 2 different tables.
In this possible? A relatively new newbie :-)... more >>
Query for multiple values
Posted by 2retread NO[at]SPAM gmail.com at 9/6/2005 8:44:19 AM
I was able to create a query that returns data based on a single order
number. Now I need to create a query that returns data based on
multiple order numbers. Obviously, when I run this query, it prompts me
for an order number. How do I change this so I can enter multiple order
numbers?
SELEC... more >>
Select Statement Error
Posted by Shariq at 9/6/2005 8:27:13 AM
Could someone please help me fix this SQL statement; it gives me
Line 57: Incorrect syntax near 'qti' where I've marked it with /*****/
SELECT qti.CUSTNMBR,sum(qti.TRXAMT) as amnt
FROM
(
SELECT DISTINCT rtrim(gl5.actnumbr_1)+'-'+ rtrim(gl5.actnumbr_2) AS
STATE_JOB,c.CUSTNMBR--,
FROM c... more >>
sp_dboption
Posted by JMNUSS at 9/6/2005 8:23:02 AM
What is the correct syntax for setting a database recovery mode to "simple"?
TIA, Jordan... more >>
whats wrong with this
Posted by Jose G. de Jesus Jr MCP, MCDBA at 9/6/2005 7:55:08 AM
It says
Incorrect syntax near the keyword 'inner'.
===================================
delete from
calls_split_cst_daily_fact
inner JOIN
cst_time_daily
ON
calls_split_cst_daily_fact.cst_day_key
= cst_time_daily.cst_day_key
where cst_time_daily.cst_day_key=1
... more >>
select with a linenumber - field
Posted by Xavier at 9/6/2005 7:40:04 AM
hello,
how can i make a Trasact-Select command wirh a autolinenumber.
example:
select field1 from mytable
1 val1
2 val2
3 val3
.....
n valn
where 1,2,3 .... is the autolinnr which i want to get ....
thanks
... more >>
Updating field
Posted by Emma at 9/6/2005 6:46:15 AM
I have a field in a table being updated by an application, stored procedure
or something, but nobody knows where the update is coming from. Is there a
way I can trace what is updating the field using EM or some other tool?
Thanks
Emma
... more >>
Cannot display/return SQL Query Output from a Variable in DTS
Posted by SJM at 9/6/2005 6:36:39 AM
I have been having a very difficult time trying to get the output of a
sql query that is in a dts global variable to return either into a
msgbox or for populating a portion of the body of a mail task.
I created an Execute SQL task with the query I wish to use. The query
has been tested in Quer... more >>
advance subquery question
Posted by joeydj at 9/6/2005 5:35:04 AM
i wanT a sql select statement like this
select a,b,c from table 1
where x= alias.x and y=alias.y
(select x,y from table2 ) as alias
dont wanna use cursor
thanks
... more >>
xp_cmdshell runs command indefinitely [BUG]?
Posted by marcmc at 9/6/2005 5:03:04 AM
Does this api work? Has anyone reported bugs on it?
EXEC xp_cmdshell 'c:\foo.bat' ;
where foo.bat contains
C:
CD\
CD C:\WINNT\
CLS
Notepad.exe
... more >>
xp_cmdshell
Posted by marcmc at 9/6/2005 3:58:02 AM
Good Morning All,
EXEC xp_cmdshell 'dir *.exe' shows me all the files I can execute within
system32 (the supposed default directory to quote books on line), notepad
exists here.
I am trying to execute notepad.exe from query analyser as follows but all 3
commands just run indefinitely an... more >>
raiserror
Posted by LeSurfer at 9/6/2005 3:25:02 AM
Hi
I want to make a trigger that prevent users from deleting rows that they
didnt insert and make en raiseror that tells them why the couldnt remove the
row, the table contains a column that says what sql login made the insert??
does anyone have an idea?... more >>
Get Page Count of Crystal Report in C#
Posted by CodeRazor at 9/6/2005 1:49:06 AM
Hi,
I am displaying my crystal report in a Crystal Report Viewer.
How can I get the value of the number of pages in the Crystal Report?
thank you.
CR... more >>
Local Temp tables versus Global
Posted by SalamElias at 9/6/2005 1:08:02 AM
I have a SP that dynamicly constructs a sql phrase that is executed with the
execute keyword correctly.
One of the variables is the name of a Global temporary table created on the
fly as follows
Select @strUniqueTable = Cast(DATEPART (second , getdate()) as varchar(2) )
+ Cast(DATEPART ... more >>
Execution time of outer join versus inner
Posted by Lucvdv at 9/6/2005 12:00:00 AM
I've got two "heavy" queries here below, that I think should give the same
result.
I expected the first to be slower, and Query Analyzer agrees with me in the
estimated cost in the execution plans it generates for the two queries, but
in reality it's quite the opposite - now I'd like to know w... more >>
Identity Field plus leading characters
Posted by Dooza at 9/6/2005 12:00:00 AM
I was wondering if the identity collumn of a table can include the same
first 3 characters. All I want to do is add DMC to the front. If I cant
do this in the database, I guess I could just append it to the data when
displaying it. But if this is possible I could really do with using it.
Th... more >>
Problems with records returned from Stored Proc
Posted by CJM at 9/6/2005 12:00:00 AM
I've created a Stored Procedure which adds a new record and updates some
more records and then returns the primary key for the added record.
The SP seems to work OK, but I'm having problems getting at the returned key
in my ASP code:
"Item cannot be found in the collection corresponding to... more >>
system tables
Posted by at 9/6/2005 12:00:00 AM
How can I query the system tables (eg sysobjects, syscolumns) to determine
which column in a table is a primary key and which column is a foreign key?
... more >>
bulk insert optimization
Posted by Ajey at 9/6/2005 12:00:00 AM
Hi,
I need to use the BULK INSERT for pushing data into two of the tables
(PK=datetime + int + int). I had read about the optimizations that can be
done for this. But since my tables will keep growing with every inserts (in
GBs), droping & creating the indexes (clustered and non-cluster... more >>
Audit table
Posted by Michal at 9/6/2005 12:00:00 AM
Hi All
I'm looking for some code which create audit table and build triggers which
register all changes on table.
Maybe someone from you know where can I find it?
Regards
Michal
... more >>
Relational ACL
Posted by Ian Evitable at 9/6/2005 12:00:00 AM
Hi
Does anyone have any good links on implementing a relational ACL. I can
think of some fairly obvious implementations but i'd like to know...what i
dont know.
All the links i can find are all Netware/File System relevant. Many of the
principals carry over but i'd still like further info.
... more >>
Most optimized way?
Posted by Kirsten at 9/6/2005 12:00:00 AM
TABLE_A stores item's data. TABLE_B stores some quantities related to this
items.
Eg:
TABLEA
___________
ID NAME
1 XXX
2 YYY
3 CCC
4 JJJ
TABLEB
_____________
ITEM QUANTITY
1 100
1 200
2 30
3 40
3 60
3 90
... more >>
Execute a procedure which gives blocking call to SQL Server
Posted by Pushkar at 9/6/2005 12:00:00 AM
I have a requirement in which through my application which is written in =
VC++, I want to initiate the execution of a procedure.
But the behaviour of this procedure is that, it runs continously on the =
server and collect some data from the server and store in some table on =
that server.
So o... more >>
|