Archived Months
January 2003
March 2003
April 2003
May 2003
June 2003
July 2003
August 2003
September 2003
October 2003
November 2003
December 2003
January 2004
February 2004
March 2004
April 2004
May 2004
June 2004
July 2004
August 2004
September 2004
October 2004
November 2004
December 2004
January 2005
February 2005
March 2005
April 2005
May 2005
June 2005
July 2005
August 2005
September 2005
October 2005
November 2005
December 2005
January 2006
February 2006
March 2006
April 2006
May 2006
June 2006
July 2006
August 2006
September 2006
October 2006
November 2006
December 2006
January 2007
February 2007
March 2007
April 2007
May 2007
June 2007
July 2007
August 2007
September 2007
October 2007
November 2007
April 2008
all groups > sql server programming > october 2006 > threads for friday october 13

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

Using CREATE, DROP with T-SQL transactions
Posted by Dave at 10/13/2006 10:41:20 PM
Do T-SQL stored procedure transactions which include statements such as CREATE table and DROP table roll back effectively if an error occurs? i.e. will a transaction roll back even if a table has been deleted/dropped within that transaction? ...more >>


Case Statement Error
Posted by ccshine at 10/13/2006 10:35:54 PM
I'm attempting to use a Select statement to loop through a temporary table instead of using a cursor, but am experiencing difficulties with the Case statement that processes each record. The error is 'Incorrect syntax near the keyword CASE'. I've eliminated all of the unnecessary code for brevi...more >>

How to change the 'sa' password
Posted by Mark Findlay at 10/13/2006 5:59:44 PM
Is it possible to change the 'sa' password? I looked in the "Users and Groups' area and don't see it so I assume it's internal to SQL Server? I am running SQL 2000. Thanks! Mark ...more >>

UnknownSqlServerError in vb.net querying SQL ENDPOINT
Posted by disweij at 10/13/2006 5:34:01 PM
Example 1 works fine ------------------------ In SQLServer-2005 created and tested successfully: STORED PROCEDURE theProcedure ENDPOINT theEndPoint pointing to theProcedure GRANT CONNECT ON ENDPOINT:: theEndPoint TO theUser In VB.NET 2005: Added WEBREFERENC...more >>

Variable number of parameters for a query
Posted by Robert Neal at 10/13/2006 4:49:21 PM
I have a table that has ten columns. The user would like to select row based on 1 to 5 of the columns. For example, the user would like to enter 'State' = 'FL' and 'City' = 'Miami' and 'Class' = '05' and not enter the other two parameters. If I pass a null, the query does not work. How can...more >>

Please take a look at this query and its error message
Posted by Keithb at 10/13/2006 4:31:55 PM
This query was generate by Microsoft SQL Server Management Studio by right clicking a table and selecting script to. When I run the query against a different database (2k), I get the following error message: Msg 170, Level 15, State 1, Line 8 Line 8: Incorrect syntax near '('. Below ...more >>

If statement
Posted by Lee Grissom at 10/13/2006 3:56:42 PM
I guess I don't understand how to use the "if" statement. Consider the following which does not work as expected. The select statement always executes even if the current login does not have permission. What am I doing wrong? if (Has_DBAccess('msdb') = 1) begin select max(backup_fini...more >>

Sql injection prevention
Posted by Doug at 10/13/2006 3:43:58 PM
Hi, I have a question on sql injection attacks. I am building a tool that will be used exclusively by our other developers and will generate stored procs for them dynamically based off input from them. I wanted to add a "parser" functionality where based off the table and where clause they ...more >>



Query Performance Tips
Posted by mark at 10/13/2006 3:23:04 PM
Recently created a database, in which one table has 28million rows, a query ran on this database takes about 3 mins to run, is there anyway/tips to increase performance ? I ran the query through the tuning advisor and there was no recommendations, currently running a trace on it at the mo. S...more >>

Render response problem during axis call
Posted by Vinay at 10/13/2006 3:08:34 PM
Hi Group, I have tried in rendering report from MS reporting services through generated stub class using Axis2-nightly build. And the Axis2 generated class not parsed the rendered result( in soap xml response). I had checked the soap response using tcpmon and it seems response has rendered re...more >>

Profiler help
Posted by Carl Henthorn at 10/13/2006 2:20:02 PM
I want to create a tool that traces sql statements like profiler does, but is used within a web app to troubleshoot issues. I have too many users to just start a profile and hope I find my own spid. I am curious to know where Profiler gets its data from. Is it Sysprocess table only? are ther...more >>

How does Profiler collect data?
Posted by Carl Henthorn at 10/13/2006 2:20:01 PM
I want to create a tool that traces sql statements like profiler does, but is used within a web app to troubleshoot issues. I have too many users to just start a profile and hope I find my own spid. I am curious to know where Profiler gets its data from. Is it Sysprocess table only? are ther...more >>

SQL Sentence count disctint
Posted by Alejandro at 10/13/2006 1:25:27 PM
Hi I have 1 app that always make SELECT count(DISTINCT cedula) FROM(matrix_odontograma) This is very slow in 1 MB of record, exist any way to make this more efficient ? ...more >>

Change DATA TYPE of column without lost information: INT to BIGTIN ( SQL 2005 SP1)
Posted by retf at 10/13/2006 1:19:20 PM
Hi all, I have one table with many rows, and now I need change data type of one = column (nosso_numero INT), the type is INT and I need change it to = BIGINT, but I can't lost old rows. Have any way to do this? HOW? CREATE TABLE documentos_clientes_banco ( .... nosso_numero INT...more >>

Stored Procedure Question
Posted by Loren Z at 10/13/2006 1:00:31 PM
In SQL Server 2005, I have created a stored procedure and run it in master so that it can be used universally from any database. The stored procedure displays database roles, objects, and permissions. The problem is that when I run it in master SSMS automaticall adds the line "USE MASTER" a...more >>

Date In Query Using VB6 & SQL 2005 !
Posted by toofaani NO[at]SPAM yahoo.com at 10/13/2006 12:57:49 PM
Hi, Using this string I get the error Run-time error ';214217900 line1: incorrect syntax new '01' Set rdset = CONN.Execute("Select Name From TimeTable Where City=0 AND RDate=#" & Format$(scheduledtime_date.Text, "mm/dd/yyyy") & " " & Format$(scheduledtime_time, "HH:MM") & "#") I was us...more >>

Long Running Process / Other Requests Time Out
Posted by chezrolez NO[at]SPAM gmail.com at 10/13/2006 12:13:58 PM
Hello All - I have written a process that allows a client to setup (in a queue) some emails which need to get blasted out to their users. They can use the interface to create these "blasts" at any time, however, using SQL Scheduled Jobs, a process runs every 15 minutes that checks for data in...more >>

Zip Code File into SQL Table
Posted by Colette at 10/13/2006 12:05:02 PM
I need to derive address information from the zip code. I have a zip code file that I need to put into a SQL table. What's the best way to do this?...more >>

Zip Code File into SQL Table
Posted by Colette at 10/13/2006 12:04:02 PM
I need to derive address information from the zip code. I have a zip code file that I need to put into a SQL table. What's the best way to do this?...more >>

Zip Code File into SQL Database
Posted by Colette at 10/13/2006 12:02:01 PM
I need to derive address information from the zip code. I have a zip code file that I need to put into a SQL table. What's the best way? ...more >>

SQL query problem
Posted by Jun at 10/13/2006 10:37:01 AM
I try to write a SQL query to return top sales companies in two years. The subquery returns that the top 10 companies in each year. But I get the error message as follows. Server: Msg 116, Level 16, State 1, Line 1 Only one expression can be specified in the select list when the subquery is ...more >>

Why create Web Services from 2005 SQL server, instead from IIS
Posted by Peter at 10/13/2006 10:10:02 AM
Hi folks, What is the main reasons to create the web services from 2005 SQL server, instead from IIS ? Except the following two reason: 1. no need IIS 2. the content of developing work Please advise. Thanks. Peter...more >>

xp_cmdshell with multiple statements
Posted by john conwell at 10/13/2006 10:01:02 AM
I want to run a bat file from xp_cmdshell. The problem is the bat file executes many file commands using relitive paths (and changing that is not an option). xp_cmdshell executes from "C:\WINDOWS\system32", so when I run the bat file from xp_cmdshell, it cant find any of the files the ba...more >>

Return percentages in the query.
Posted by sqlservernewbie NO[at]SPAM yahoo.com at 10/13/2006 9:27:49 AM
Hello, I'm trying to something that just works in Oracle, but does not in Sql Server. How can I get the percentage of two counts to be returned on each row of the query? select count(sid), /* all not the not null */ count(*), (count(sid) / count(*) ) as percent_not_null, 4 as four...more >>

Size of query data
Posted by Sammy at 10/13/2006 9:13:02 AM
Does anyone know how to measure or how to investigate (specifically when a large query is generated) how much data is transferred along the network for a small office network. Clients use Access front end to bring back reports. thanks for any help Sammy...more >>

Employee scheduling database
Posted by Dirk at 10/13/2006 9:08:02 AM
Does any one have any good references or books that would direct me as to how to set up an employee scheduling databse? Or example diagrams, tables, etc... I am in charge of creating such a databae and dont know where to begin. I have tried creating multiple tables and getting something ...more >>

How to pass an integer array to a function
Posted by le_mo_mo NO[at]SPAM yahoo.com at 10/13/2006 8:59:47 AM
Hi, I have a function that is declared as CREATE FUNCTION Get_Items ( @ItemList VarChar(400) ) RETURNS TABLE AS RETURN ( SELECT * FROM Items WHERE (ID IN (@ItemList)) ) my @itemlist is '1','2','3' so when I say Select * from Get_Items('1','2','3') it does not execute I do no...more >>

Use/Not Use of AddDate()
Posted by Arnie Rowland at 10/13/2006 8:49:43 AM
A poster in another forum has asked what are the ramifications of just adding 1 to a date (e.g., getdate() + 1) vs. using adddate(). While I clearly advise using adddate(), I realize that I don't have a good response to the question of "what's the diff?" Suggestions? -- Arnie Rowland,...more >>

Migrating From Access 2000 From SQL 2005 !
Posted by lovely_angel_for_you NO[at]SPAM yahoo.com at 10/13/2006 8:34:23 AM
I used to use this string in VB6 while connecting to MS Access 2000 1) Dim conn As ADODB.Connection Dim rdset As ADODB.Recordset Set conn = New ADODB.Connection FilePath = App.Path & "\data.mdb" With conn .Provider = "Microsoft.Jet.OLEDB.4.0" .ConnectionStri...more >>

While Loop
Posted by Dirk at 10/13/2006 7:21:03 AM
That was very helpful. This is my first attempts at this kind of stuff so I appreciate the help. Your example does seem do address the problem in a much more efficient way. I have been banging my head against a wall trying to figure this out. It seems simple enough, but I just dont think...more >>

What else is needed to do reports in 2005 Express?
Posted by iano at 10/13/2006 6:10:38 AM
So far I have downloaded and installed: SqlServer2K5_BOL_Jul2006.msi SQL2005RPSPS.msi which I probably did not need SQL2005RPFIN.msi SQL2000SampleDb.msi SQLEXPR_ADV.EXE Stopped. It said everything was already installed AdventureWorksDBCI.msi SqlServerSamples.msi ...more >>

macro-substituicion or list of sysobjects for all databases
Posted by Ulysses Stancati at 10/13/2006 5:30:01 AM
I am don't speake english but I to try write my problem... I want comparing the objects (tables, views, etc) from databases, but don't obtain the list of objects of all databases and not obtain the correctly way of execute the macro Example: Set @ExecSQL = 'Select * from sysObjects Whe...more >>

Table name as variable
Posted by Jason at 10/13/2006 5:16:02 AM
In Transact SQL, how can I make variable a table name ( or possibly a column name ...... ) ? For instance, in 'Select * from TableName', the name of the table is variable and known only when running. I wish to do that "inside" Transact SQL. I searched, and did not found ... Thanks for help....more >>

Table name as variable
Posted by Jason at 10/13/2006 5:09:01 AM
In Transact SQL, how can I make variable a table name (or possibly a column name ......) ? For instance, in : 'Select * from TableName', the name of the table is variable and known only when running. I wish to do that "inside" Transact SQL. I searched, and did not found ... Thanks for help....more >>

Preventing mismatches in a linking table.
Posted by JimLad at 10/13/2006 5:04:09 AM
Hi, This is a question that occasionally pops up but that I haven't come up with a good answer to. Table 1 is linked to Table2 in a many to many relationship through Table12. Table1 and Table 2 both have FKs to Table 4. They should only be linked if this FK is the same in both tables. So wh...more >>

OPENROWSET Excel import failing on production machine
Posted by gvanberkel NO[at]SPAM gmail.com at 10/13/2006 1:50:20 AM
Hi all. I have some sql like SELECT * FROM OPENROWSET('MSDASQL', 'Driver=Microsoft Excel Driver (*.xls);DBQ=C:\aaa.xls;', 'SELECT * FROM [Sheet1$]') Which works perfectly on our development machines (Windows 2003, SQL Server 2005 SP1). When I take it across to our production machines a...more >>

SQL Agent Job got stuck
Posted by ArchieM at 10/13/2006 1:12:25 AM
I have a SQL Agent job scheduled to run once per day, but it takes more time to complete than one day . So, what happens is that after onday it used to hang the DB . It does not do anything. Is there any way to get out of it ? Is it happening because of the Schedule or is there anything like ...more >>

column name query
Posted by soc at 10/13/2006 12:00:00 AM
Can anyone advise how to select the names of columns of a table? Thanks Soc. ...more >>

Insert issues using c#?!
Posted by Rob Pollard at 10/13/2006 12:00:00 AM
Hi All, I'm pretty new to using these technologies so bear with me. I have created a c# app which communicates with sql-server express 2005. When I run an insert on a table via the SqlCommand class nothing seems to happen! No errors are apparent either. If I check the table contents in the ...more >>

Query - pulling results from several fields even if some fields are not present
Posted by Pete at 10/13/2006 12:00:00 AM
I'm trying to construct a query to pull the results (itemcount) from a dynamically-populated table (acheck_54_1) based on the values of a specific field - checkid. However, if there isn't a specific checkid in the table, the query will return nothing, including nothing for the checkids that are ...more >>


DevelopmentNow Blog