sql-server-2005

Searching numeric strings with Full-Text Search in SQL 2005

I'm using the SQL Full-Text Search and have a stored proceedure that uses the FREETEXTTABLE function. This all works great, however, I have noticed that if I search for something such as 'Chapter 19' the 19 seems as if it is thrown away and the search only searches on 'Chapter'. Also if I search for just '19' I get no results. I know ...

SQL Server problems

I have installed SQL Server 2005 but there is no server, I have reinstalled it about 5 times and the same problem never changes. And here is the error message Cannot connect to .. ADDITIONAL INFORMATION: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server wa...

How to convert stored procedure's output to collection of anonymous class instances?

I have a lot of pre-linq C# 1.0 code which converts the output from a stored procedure (SQL 2005) into a collection of objects. It goes as follows: Declare a class with properties matching the columns in the output. using SqlDataReader, loop while there are rows to read For every row, add an object to a List return that list Although...

How to set a permission to let a SQL server user to access for certain tables

I just created two tables and they are named as tblA and tblB. I also created a user(Security/Login) who will be used for a remote insert/update. What is the best way to permit this user to access for only those two table out of 50 table. I have tried look for the way from (Security/Login) and (Database/Properties). Can I limit it fro...

optimize stored procedure

Hi All, I have one question on how to optimized my sp, actually it was a view but I decided to change to sp to make it faster, and it did work. First it took 27 seconds for a view to run and 16 sec for sp. So it is getting better but how to make it even better? Table that I am running my sp on is 600 records and I am returning around 80...

SQL CLR stored Procedure to query active directory

I need to obtain some information from the users in the database that is stored on Active Directory, I've a simple function to do this: using (DirectoryEntry de = new DirectoryEntry("LDAP://ANYGIVENDOMAIN")) { using (DirectorySearcher adSearch = new DirectorySearcher(de)) { adSearch.Filter = "(sAMAccountName=jdoe)"; ...

Using a variable in a SQL Server 2005 stored procedure with XQuery

I'm working with the following XML <AEDControl ControlGU="17fed98c-8128-4c6b-9b50-3dbe73889b9d" ControlLabel="Posting Status" TypeGU="6b4d08b1-6340-450c-beae-517b7d84e717" ControlDescription=""> <Elements> <Element ElementGU="2da346d1-2e05-4aa3-9bae-5aa9b3b75d5c" Label="Active" ...

SQL Procedure to get the count of child and child's childrens in SQL server 2005

Hi All, I have 4 tables Customers, Orders, Order details and Comments in my db. Customer can have many orders/Comments. Orders can have multiple OrderItems(OrderDetails). What I need is the SQL statement to return the following:- Customerid, CustomerName, TotalOrders, Total OrderItems and NoOfRecentComments. TotalOrders would be the t...

using results of multi-table SELECT to populate test database? (SQL Server 2005)

I was wondering if there were techniques or tools out there that would let me take a multi-table SELECT statement, complete with inner and outer joins, and determine after running it exactly which rows in each table are required to make the same SELECT return the identical rowset in a mini version of the database? The ideal would be to ...

Changes to a Query Based on Year

select datepart(month,s1.Timeperiod) as monthofaum, datepart(YEAR,s1.Timeperiod) as Yearofaum, ISNULL(s2.endingAum,0) as Starting_Aum, s1.endingAum as Ending_Aum from #temp_1 s1 left outer join (select * from #temp_1)s2 on month(s1.Timeperiod) = dateadd(D,1,month(s2.Timeperiod)) This w...

Use SQL instead of Delete and End from keyboard

Hi, I am running a simple statment below which gives the output as follow: select '''' + name + '''' + ',' as Emp_Names from dbo.employee Emp_Names 'Jason', 'Robert', 'Celia', 'Linda', 'David', 'James', 'Alison', 'Chris', 'Mary', Is there a way in SQL that can show my desired output as: Emp_Names 'Jason', 'Robert','Celia'...

SQL Server 2005 - SSIS validation error server-side only

Hi, I am deploying some integration services into a SQL Server 2005. On my computer, I don't have any validation error but I do on the server. It comes from an OLE DB connection manager: "Login failed for user 'rw_user'". Whereas I can fully run it on a client, the connection works perfectly. This is a connection to the server itself....

Parse search queries in sql 2005 FTS

Hi, In lucene, we can use QueryParser.Parse(query) to find out how the given query is interpreted by lucene. Its very helpful. I am looking for some kind of API or build in sys functions to identify how the FTS parses given search string. I found sys.dm_fts_parser procedure in sql 2008 does the same job, but currently am working on ms ...

Two datagridviews in one windows form = not possible to save data to the second datagridview

I create a winform I´m adding a datagridview by dragging a table from data sources the result: I´ve got a winform with a datagridview and a bindingnavigator I´m adding a second datagridview to the same winform by dragging another table from data sources the result: same as bullet 3, but now with two datagridviews; a second bindingnaviga...

edit data gridview

I had gridview which retrieve data from database .I did update statement in data ingridview I did my code but when I selected edit option in gridview this error apear (Procedure or Function 'Update_IntoModel' expects parameter '@Id', which was not supplied) . protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)...

Like query on Date Time

Hi friends,is this possible to fire like query on DateTime in SQL Server 2005. select cur.EvrIdent, cur.VrdTarih, cur.VrdModTim, cur.VrdNo, (select PmpKod from Bnz_Pompalar where PmpIdent=(select GunPmpId from Bnz_Tabancalar where GunIdent=TbdGunId)) as [Pump No], (select GunKod from Bnz_Tabancalar where GunIdent=TbdGunId) as [Nozzle No...

Storing array of integer values in SQL Server

Hi, i want to store an array of integer values in a SQL database table (SQLServer 2005), if possible by using a single column. The integer array will have a length of 7560 values. I am using a objectdatasource, the datatype should be compatible with the generated parameters of a tableadapter. thanks for helping :) ...

how to maintain database integrity for write operations in a website

A website to change add records delete etc website is not connected architecture, so i cant expect sql to refuse writes to a table being edit by some one else also. As data is only written when its sent back to server by the grid.. so is there a way using c# and asp.net, some code , by which i cant explicitly tell the sql server to...

Designing a database connection class in VS 2005

I am working on designing a SQL Server database connection class in VB.net 2005. The idea behind doing this will be so a developer can can call the class, pass it a stored procedure name along with the parameters, and get return values back (if any). My question is, how would I design the class so the stored proc parameters are dynamic?...

Reasons not to have a clustered index in SQL Server 2005

I've inherited some database creation scripts for a SQL SERVER 2005 database. One thing I've noticed is that all primary keys are created as NON CLUSTERED indexes as opposed to clustured. I know that you can only have one clustered index per table and that you may want to have it on a non primary key column for query perfoamce of searc...