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 > april 2006 > threads for tuesday april 25

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

Can SQL Server run in Linux?
Posted by Bpk. Adi Wira Kusuma at 4/25/2006 11:45:48 PM
Can SQL Server run in Linux? ...more >>


VS CLR SQL Templates missing (File - New - Project -> Database -> SQL Server)
Posted by job NO[at]SPAM bla.com at 4/25/2006 11:02:23 PM
Hmmm... I wanted to play a little with clr and sql in vs 2005. However, the project templates referred to in this article (Project -> Database -> SQL Server) do not apoear... http://www.sqlservercentral.com/columnists/aAnajwala/simplesqlclrintegration.asp Can I somehow manually install them...more >>

best practice - building trees
Posted by Robert Bravery at 4/25/2006 10:02:22 PM
HI all, I have created a table that store company group hierachy structure. I have used a combination of the adhjacency model amd materlialised paths with depth info and a few other things. ANyway, My question is hwat is the best method for building the tree that will fit into a treeview object ...more >>

SQL Server oddity
Posted by Robert Chafer at 4/25/2006 9:46:43 PM
I ran across this yesterday whilst trying to figure out why my search results were wrong: ---------------- create table #product ( datecreated datetime ) insert into #product (datecreated ) values (getdate()) insert into #product (datecreated ) values ('20050901') insert into #product (datec...more >>

Security Roles
Posted by scott at 4/25/2006 8:23:30 PM
Instead of using the sa account in my asp intranet pages, I'm trying to create a sql login account for our intranet users. The asp pages will have forms so users can add/edit records to the sql database. Which "Server Roles" should I grant the account? In SQL Logins, under the "Database Ac...more >>

Optimizing SQL Query performance
Posted by Pushkar at 4/25/2006 7:51:45 PM
Hi, I have collected SQL Trace events into a trace table by exporting the trace into a table. I have a table Trace1 with following columns: -RowNumber -ApplicationName -DatabaseName .. .. .. -StartTime -EndTime Clustered Index on RowNumber Column. NonClustered Index on StartTime Co...more >>

VS2003 and SQL Server 2005
Posted by Gary Coutts at 4/25/2006 7:28:29 PM
Hi, I currently have a website that was developed using Visual Studio 2003/ASP1.1 and SQL Server 2000. My hosting company is moving to SQL Server 2005 and I want to make sure that there is no impact on the website. Can I use SQL Server 2005 and Visual Studio 2003? I believe they use di...more >>

Stored procedures using C# code?
Posted by Rene at 4/25/2006 7:16:12 PM
I remember reading somewhere that with the new SQL Server 2005, you could do the stored procedures logic using a .Net language instead of the Transact (at least I think thats what its called) SQL thing. If this true, could someone post a link where it talks about this new feature? Thanks...more >>



SQL SIMPLE result sent in Oracle stored procedure
Posted by gary.goodwin NO[at]SPAM gmail.com at 4/25/2006 6:52:56 PM
I am new to Oracle. If I have a simple Table lets say Employee withe EmployeeKey, EmployeeCode and I want to return this in a SQL server Stored Procedure I can just do this: CREATE PROCEDURE EmployeeSel AS Select EmployeeKey, EmployeeCode from Employees now that is very simple. Ple...more >>

Datetime string
Posted by hon123456 at 4/25/2006 6:52:33 PM
Dear all, I got a fieldA which is datetime , when I check the value in query analyzer, the value returned is: 2003-10-27 10:55:00.000. When I get this field to a ADODB.recordset named rs_A, rs_A returns : 2006/4/26 =A4W=A4=C8 09:24:17 ,which is date time s...more >>

sql2000 - multiple update calling SP only once
Posted by kevanbulmer NO[at]SPAM gmail.com at 4/25/2006 4:48:50 PM
ASP.NET C#, SQL Server 2000 i have a webform that contains several DB rows from a single table that i can edit, how do i do a multiple update on these rows, ideally with a single call to a SP ...more >>

Columns to Rows - Group By count
Posted by Yog at 4/25/2006 4:14:01 PM
I have a table which has many columns but need to query it as rows. The UNION ALL does the trick My question is when we do a GROUP BY, is there a way we can generate a sequence number automatically for columns that are grouped by. Please see query below. i.e. If there are many rows f...more >>

Menu Hierarchy Display Order (Recursion)
Posted by Brian Patrick at 4/25/2006 3:56:07 PM
Hi - I'm using the following Table and Stored Procedure below, to store and access a menu hierarchy. The recursive stored procedure is working perfectly and returns a text string outlining my current menu hierarchy. Currently the stored procedure returns the hiearchy in the order that the ...more >>

What are minimal permissions required to create database and ...
Posted by Marcus at 4/25/2006 3:48:00 PM
I want to create a user on SQL Server 2005 that needs to be able to create databases, logins, and users, as well as create stored procs, triggers, tables, etc. This user will be accessed from a vb.net application. Is there anything less powerful than the 'sa' user that will do the trick, or some...more >>

How to script permissions?
Posted by brett at 4/25/2006 2:51:27 PM
I'm using SQL Server 2000. I have an application that uses three databases. Currently, when a new user is added (Windows Integration), I go to each database, create the login then go to each spoc and give that user rights. Is there a faster more efficient way to do this? For example, I have...more >>

Retuning rows as a single string
Posted by Brian Henry at 4/25/2006 2:24:14 PM
Is there any way to do this? Say I have SELECT MyCol FROM MyTable MyCol is a nvarchar field, but instead of coming back like this in a table ItemA ItemB ItemC I want it to come back as a stingle string like this ItemA, ItemB, ItemC is this possible in T-SQL? thanks! ...more >>

Textcopy and nText problems
Posted by Jerry at 4/25/2006 12:59:14 PM
I'm trying to save images stored in our SQL Server database as image files (jpg, gif). I posted a question last week and was told to try textcopy.exe. I installed the full version of SQL Server and tried textcopy but received the following error: SQL Server '<server name>' Message 4004: Unicod...more >>

Executing a SPROC from a View
Posted by Scott at 4/25/2006 12:55:46 PM
Is it possible to execute a SPROC from within a view? If so, will the query slow the SPROC any lower than it normally would run? I use excel pivot charts based on sql views a good bit. As far as I know, I don't think pivot charts can be based on SPROC's. I've run into a database that is ver...more >>

Joining Question
Posted by Daniel Regalia at 4/25/2006 12:02:02 PM
Just a Quick Question.. I have a query that is similar to this Select colA , colB , colC , colB + colC as ColD From myTable Say I wanted to Join 'ColD' to 'myOtherTable' to a column called myOColA Is that possible? I'm not sure how to Reference ColD at all in a query.. I'v...more >>

How to determine columns that are part of an index.
Posted by CSHARPITPRO at 4/25/2006 11:50:02 AM
Hello, How can I use SQL-DMO to get list of all the columns that are part of an index? I am able to determine if the column is primay key. Thanks...more >>

Rand
Posted by Willie Bodger at 4/25/2006 11:48:09 AM
So, I use the rand function to generate some strings and it works great, but I would like a way to do alpha-numeric instead of just numeric. So, does anybody know of a function to do alpha-numeric random string generation or some way to get that functionality out of the built-in functions? Tha...more >>

Multiple column unique constraint
Posted by danielhoin at 4/25/2006 11:36:16 AM
I am new to 05 and I am searching for a way to add uniqueness to two fields that are not the PK. I am searching for a built in way to add uniquness that doesn't require writing a trigger or use the primary key. ...more >>

How to performance case-insensitive search on XML data type in SQLServer 2005?
Posted by John at 4/25/2006 11:26:35 AM
Does anyone know how to how to performance case-insensitive search on XML data type in SQLServer 2005? Or I have to convert all the xml data to lower case before I store it? Thanks in advance. John ...more >>

Place count in variable
Posted by Robert at 4/25/2006 10:43:03 AM
Would like to know if this is even possible to do - using SQL Server 2000. I am creating a procedure that truncates a table then inserts one row of data. In the third field I need to insert the count of another table. I thought that this would work: @DetCount int = SELECT Count(*) FROM Table...more >>

URGENT!! I need to attach a db...
Posted by Eric at 4/25/2006 10:31:02 AM
that I just detached. But, now I can't access EM because of the logins that are associated w/the detached db. Please help! ...more >>

Error Reporting from Stored Procedures
Posted by Swami at 4/25/2006 9:43:02 AM
How do you report errors from a stored procedure? For example, if the stored procedure is trying to insert something into a table and the database is full, how can the stored procedure return an error string to the caller? ...more >>

How to page SQL query result returned from FOR XML statement?
Posted by John at 4/25/2006 9:40:57 AM
Gurus. I do not know if it is possible, but here is what I want to do. I want to allow user to page the SQL result, so he could decides to return from row 10 to row 20, or row 100 to 200, without returns the whole resultset. Every time he sends another request, I do not mind to hit the database...more >>

ORDER BY CASE
Posted by Justin at 4/25/2006 9:37:18 AM
Here is my ORDER BY Clause, and based on the @Option parameter, I do different order by. This works fine since the order is set from just one column. ORDER BY CASE @Option WHEN '1' THEN IsApproved ASC WHEN '2' THEN CompletedDate WHEN '3' THEN Priority END The problem is tha...more >>

Database or Server?
Posted by Swami at 4/25/2006 9:31:01 AM
I am creating a site where users can create blogs and upload photos etc...I just realized that my hosting account with GoDaddy has a 100 MB limit on the SQL Server database...due to that I decided to store all photos on the server and just store the file path in the database...is that a good i...more >>

undating tables
Posted by Chris at 4/25/2006 8:03:02 AM
Hi all, I need some help with the following ---- In my db I have two tables – 1. Current data - 2. Previous data my goal is to do two things First I would like to update the current data table with data from the Previous data table. Second I would like to do a calculation on the...more >>

ALL STORED PROCS RETURNING NOTHING BUT NULLS IN OUTPUT PARAMETERS
Posted by bradley.jones NO[at]SPAM gmail.com at 4/25/2006 7:58:43 AM
I think my hosting company changed something on SQL Server, but I don't know what. Suddenly, all OUTPUT parameters from ANY SPROC return NULL. The funny thing is, the values are in the variables within the SPROCS (see the PRINT results on the SPROC example below) The behavior is the same in Qu...more >>

ignore duplicate key
Posted by Panos Stavroulis. at 4/25/2006 7:38:03 AM
Hi, In terms of performance what's more preferable using ignore duplicate key on the table index to ignore any duplicate rows that are being inserted, OR before you insert into the table you check that you are not inserting any duplicate rows. The ideal is if you know your data are not ...more >>

Syntax error calling udf
Posted by Phill at 4/25/2006 7:36:01 AM
I have a udf that takes a zipcode and a miles parameter. It returns a table containing all of the zipcodes within that range. I am calling this function from a sp but am getting an error: Msg 245, Level 16, State 1, Procedure proc_PublicSearchPeople, Line 76 Conversion failed when conver...more >>

Delete trigger capturing text data
Posted by Tracey at 4/25/2006 7:03:02 AM
I am trying to use a trigger to capture text data that is being deleted and put it into an audittrail table. I use the same logic for the insert trigger(using inserted instead of deleted) and it functions as it should, however when I do a delete, this trigger seems to be overlooked as no ins...more >>

Query to show column dependencies
Posted by JasonDWilson at 4/25/2006 5:58:01 AM
I am trying to write a query to show column dependencies. I want to write a query that will show me everything effected by changing a column in a table. I want something where I can give it a table and column name and it will show me which tables/views and the columns that are dependent on t...more >>

Reg: SqlServer Data Type
Posted by SivaprakashShanmugam at 4/25/2006 4:19:01 AM
Hi Can you please explain the difference between Text and nText data type in SqlServer and at what situation we have to use this. Siva....more >>

SQL Server 2005 : Database settings
Posted by karthi.net NO[at]SPAM gmail.com at 4/25/2006 4:18:53 AM
Hi all, What settings has to be made in (SQL Server 2005) Server level & Database level to accept UNICODE characters ? Thanks, Karthik ...more >>

Output file size changes when date format reduced
Posted by hals_left at 4/25/2006 2:57:45 AM
I am using this code to output data to file DECLARE @cmd VARCHAR(2048) SET @cmd = 'bcp "EXEC database.dbo.spname ''20060101 00:00:00'',''20060331 23:59:00''" queryout' + ' c:\outfile.csv -c -t' + ' -SLOCALHOST -E ' EXEC master..xp_cmdshell @cmd The data is 59K rows an...more >>

How to insert the date
Posted by hon123456 at 4/25/2006 2:46:29 AM
Dear all, I got a fieldA as datetime (length 8). When I select in query analyzer, it shows the following value : 2003-10-27 11:36:27.640 now I get fieldA into a ADODB.recordset in VB with fields rs_A("fieldA") And I try to update another table w...more >>

How to filter out unwanted data
Posted by Dave dcartford at 4/25/2006 1:21:45 AM
I have the following fields in table A: Date | Descrip | Amt Dr ---------------------------------- 01/02/2006 | 740240 |(2,400.00) 14/02/2006 | 740241 |(3,000.00) 15/02/2006 | 41142 | 1,800.00 20/02/2006 | 41142 | 2,700.00 25/02/2006 | 740245 | 5,200.00 ...more >>

how to insert a NULL in a table
Posted by Xavier at 4/25/2006 12:39:02 AM
hello, in a table i have a field of type bit which allows NULL. if a new record is created and the field is not set a NULL value is created. Now my question: if the field was set to the value 0 or 1 how can i reset that field manualy to NULL. Can i use some key STRG + ....? thanks ...more >>

sqlxml problem
Posted by mm at 4/25/2006 12:00:00 AM
I have this sql select statement SELECT 'http://PartnerLink.Artifacts.StockMovement.Schemas.StockMovement_BTSQL' As [StockMovement!1!xmlns], Delivery.DeliveryID, DeliveryType, DeliveryDate, DeliveryInfo, ReceiveStore, ReceiveCountry, ReceiveCurrency, SenderStore, SenderCountry, SenderCurre...more >>

COLUMNS_UPDATED()
Posted by prefect at 4/25/2006 12:00:00 AM
SQL Server 2000 BOL says: The COLUMNS_UPDATED function returns the bits in order from left to right, with the least significant bit being the leftmost. The leftmost bit represents the first column in the table; the next bit to the right represents the second column, and so on. But in ...more >>


DevelopmentNow Blog