sql-server

PDO FreeTDS error

I have just upgraded my server from php 5.2 to 5.3.3 and I am having a weird error in PDO (with DBLIB). I am connecting to an SQL Server 2005. I am having The error appears in any statement that prefixes a parameter with the "N" letter (to tell SQL Server that it's a unicode string). The query looks like this: INSERT INTO IPs (IP, Pos...

Return value from stored procedure

Hi I am using vs 2008 doing a winforms app in vb.net. I have a database with a single table, that has two columns, in it and a stored procedure. The stored procedure is supposed to take an input value, match that value against one column in the table and then return the corresponding value from the other column; except it doesnt.It retur...

SQL Server: Howto get foreign key reference from information_schema ?

In SQL Server, how can I get the referenced table + column name from a foreign key? Note: Not the table/column where the key is in, but the key it refers to. Example: When the key [FA_MDT_ID] in table [T_ALV_Ref_FilterDisplay]. refers to [T_AP_Ref_Customer].[MDT_ID] such as when creating a constraint like this: ALTER TABLE [dbo].[T_...

customer web site admin tool

How do you create your web site data admin for your customers. Do you do them programatically or do you use any specific tool? I have been using AspMaker and is not a bad option but I'm sure there are a few more options out there. I've seen that MS has a Web Data Administrator but for me it looks more than an sql server web admin tool r...

I'm getting SQL Server Error: 18456, Severity: 14, State: 5

I'm getting this error from my SQL Server log file summary. I know that a State 5 means invalid user Id but I haven't created anything that uses the userid 'root' that it errors on. Does anyone know how I'm to find out what app or page this user id "root" is coming from? ...

Turkish character problem in select query - SQL Server

SELECT [ID] ,[Name] ,[Markup] ,[Status] FROM [dbxyz].[dbo].[Block] WHERE Name = 'Hakkımızda' Linq2Sql sends this query to SQL Server 2005 but because of the character problem (ı) it does not get the right dataset as a response. No rows returns. I can not change the collation of database because it is a hosted service and I have ...

Intellisense and context help for sys stored procedures - bugs or by design ?

SQL Server 2008 R2 Dev Execution in SSMS of: 1) use AdventureWorksDW; GO; sp_cdc_enable_table 'dbo', 'FactInternetSales', @role_name=NULL, @supports_net_changes=0 succeeds. Why does execution of 2) sp_cdc_enable_table 'dbo', 'FactInternetSales' --, @role_name=NULL, @suppo...

What is the best way to generate dynamic advanced search queries that filter into xml columns in C#/TSQL

In our current set up we store client-specific data inside of an xml column in Sql Server instead of either creating client-specific columns or tables. This works fine except that it means we end up needing to use dynamic sql for queries that query into those values, passing into our sprocs a partial where clause generated in code. W...

SQL Search Statement like Google?

Is there some kind of SQL Statement that I can used to do a search on 1 Column in my table that is similar to what I am looking for. Like if I am looking for something to do with a "Car" but I spell it as "Kar" it must return items of "car". Or If I am looking for "My Company" and I spell it as "MyCompany" it must still retun "My Com...

Code in StreamInsight queries

I'm developing an algorithmic trading application using complex event processing and I'm looking into Microsoft StreamInsight as CEP processor. However I'm not sure if everything I want to do is possible within StreamInsight. Particularly, I would need to be able to dynamically create strategies that would then be inserted into the serv...

I need to write a sql query to display top 25 records with a catch

I need to write a query as follows which will be bound to a grid select top 25 * from ErrTable Order by DateErrorad Desc However, I need to write this query to return only 25 records at a time, but when a user clicks next it will display the next 25 most recent records from the db. How could I accomplish this? ...

How to just deploy the Visual Studio 2010 ASP.NET website example to a remote dedicated web 2008 server ?

I can't believe my eyes it's so hard to do just that ! Why can't I use MS Access instead of SQL Server Express ? So since I'm stucked with SQL Server Express, how can I make it work on my dedicated IIS 7 Server on Windows 2008 ? I have copied under the root directory of the server. The website works until I try to login then I get: ...

SQL : Why doesn't this ROWNUMBER function work?

SELECT DateErrored FROM (SELECT Category, ROW_NUMBER (Partition by dateerrored ORDER BY category DESC)AS Row FROM AspErrors) AS LogWithRowNumbers WHERE Row >= 1 AND Row <= 10 ...

sql server 2008 limit on exec statement

Hi, I just needed to double check if there is a limit of characters on EXEC command in t-sql? If I have a variable with varchar(max) and execute the command using EXEC, you reckon that would be ok? thanks ...

Querying for distinct data in XML Column in SqlServer 2005

I have some xml data stored in an XML Column in a table in sql server 2005. Record1 would have data for that column would look like this: <ArrayOfThings xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/SomeCompany"&gt; <Things> <Thing> <Name>Monkey</Name> </Thing> ...

SSIS 2005 - Export Data into an Excel 2007 Table

Hello ! I have an excel file (xlsx) containing a table : Once I launched my ssis task (successfully) to insert data in it, it is actually append after the table : My expected result: So I am looking for a way to insert into the table and expand it with the data. I hope someone could help me. Thank you ! ...

"An item with the same key has already been added" Error on SSRS When Trying to Set Dataset

When i try to set the Dataset in SSRS IDE, i get the error you see in the snapshot. The query works totally fine in SQL Server Management Studio, i wonder where did i go wrong?! The connection to DB is well established. OPTIONAL: In case you want to have a look at my query (its too long), i checked it very well. Nothing wrong in ...

Anyone can explain the meaning of session states in SQL Server, such as sleeping, suspended, running etc

Hi, I'm confused about the session states of SQL Server sessions. Anyone can explain it please? Thanks. ...

MS SQL 2008 - Create a copy of the database without the data

In MS SQL Server 2008 R2, how do i create a new database based on the schema of the old one, but without copying any of the data along with it? I am using SQL Server management studio. Sorry if this is a duplicate. I looked around and wasn't finding what i wanted. I assume this is pretty simple to do. ...

I Need to Discard Days of Month and Make Duplicate Months as Distinct

SELECT e.firstName,t.setDate, w.wageAmount FROM TimeSheet t INNER JOIN Employee e ON e.employeeID = t.employeeID INNER JOIN Salary s ON s.salaryID = t.salaryID INNER JOIN Wage w ON w.wageID = s.wageID INNER JOIN EmpHiringInfo ehf ON ehf.EmpHiringInfoID = s....