sql-server-2008

Troubleshooting SQL Server Memory Issues

Currently an active database continues to use more memory until it reaches about 5.8GB and then starts throwing frequent connection timeout errors. I understand that SQL Server is designed to use as much memory as possible, but It shouldn't be throwing those errors. In particular, something seems to run which causes the memory to grow by...

Is There any way to share SQL Server 2008 Diagrams

Is there any way we can share the SQL Server 2008 database Diagram (Other then capturing the jpeg). ...

sql server 2008 timeing related

I want to find out what will be the time in India when clock tick to 1Am mid night in any other country.. How i will find out that through any means plz help me to find out this this is to fire birthbay mails at 1AM midnight of that resp country... so i did following DECLARE @indianTime DATETIME --= SYSDATETIMEOFFSET() DECLARE @timeZon...

Search using FTS Word Documents for exctact word or phrase

Hi, I am trying to search against a Database with MS Word Documents as BLOBS, full-text indexed (neutral language) an exact word or phrase contains dashes (for example : "-c-erb-B2"). The problem is that FTS works in a different way and break it, at "erb" and "B2" and results include additional records that documents include erb or B2....

SQL Server: row present in one query, missing in another

Ok so I think I must be misunderstanding something about SQL queries. This is a pretty wordy question, so thanks for taking the time to read it (my problem is right at the end, everything else is just context). I am writing an accounting system that works on the double-entry principal -- money always moves between accounts, a transacti...

Check constraint to validate IP address field.

Hi everyone, I'm working on a project involving C# and a SQL Server 2008 database. In one of the tables, I have a field (nvarchar(15)) which will contain an IP address. I'd like to add a check constraint which will validate that the input value is actually an IP address. I wanted to use a regex to do that, but it seems that this featu...

How do you use GetSchema(), ReportSchema() or SMO to determine the method a constraint was created in Sql Server 2008?

In this previous question I asked I found that constraints created with Create Index do not exist in sys.objects. I'm already using ReportSchema() and looping through Indexes and IndexColumns collections. Is there a way to determine the method a constraint was created by using the collections available to GetSchema() or ReportSchema()...

MySQL as Linked Server on SQL Server 2008 - Data Length Mismatch

I am trying to set up a third party MySQL as a Linked Server on SQL Server 2008. When I try to access the data via a simple OpenQuery below I get an error. SELECT * FROM OpenQuery(SERVERNAME, 'SELECT * FROM table') The error message: OLE DB provider 'MSDASQL' for linked server 'SERVERNAME' returned data that does not match expected...

Select first n records for each distinct ID in SQL Server 2008

I'm trying to create a query that will pull the first 10 records of each id in a table. Something like this sounds: select distinct top 2 id, column1 from table group by id, column1 ID Column1 1 ab 1 ac 1 ad 2 df 2 gf 2 dfdf 2 hgf 3 wa 3 hgh 3 dfg...

Password not accepted for newly created user under SQL Server 2008 R2 Enterprise

I understand the limitation of a strong password choice under SQL Server 2008 R2 Enterprise. I have a software that must use a specific password, which works on the Standard version of SQL Server; however, Enterprise is refusing to add the user because the password is weak and not fulfilling the requirements. Is there any workaround for...

SQL Server - Automatically Calculate total every day

I need to keep a daily statistic of the count of records in a table. Is there a way to automate counting the records daily and writing the result into another table? Maybe using a SQL Agent Job or something like that? I'm using SQL Server 2008. Thank you! Edit: If I delete today all records from 1/1/2010, the statistic still needs t...

SQL Server - Logical Question

I have the following table: Id INT/PK UserId INT/FK CreatedDate DATETIME ActivityMarker INT/FK The table can be written to (incl. record updates) and deleted from (e.g. today I can delete a record from 1/1/2010). The CreatedDate contains the date the record was created. ActivityMarker and UserId can be updated. What I need to do is k...

SQL script to get ALL SQL dependencies on a SQL object

Hello, I have a HUMONGOUS legacy databases with thousands of objects. I really want to delete 113 tables, but I need to get a comprehensive list of the dependencies that would need to either modified or removed as well. Is there any way to do this? The "view dependencies" UI in SSMS is going to take way too long. What I am thinking ...

PATINDEX in Sql 2005 with a CASE

Hello, im using the PATINDEX sentence into a case sentence: select Choosed1= CASE PATINDEX('%1|%',field1) //Here im getting an error: WHEN >0 THEN 'X' END from testtable How could i put the >0 condition to avoid the error? Thanks in advance Best Regards. Jose ...

SQL Server Query or Tool to show Hierarchical Data

We have a general organizational table structure, think of it s a Tree or Pyramid Hierarchy. We basically have multiple "trees" we want to show. On for one company, one for another ETC. Does anyone know of a good way to display this data? SQL Query would be nice, doubt it would be possible, but I wouldn't be against using some...

FileStream: T-SQL vs Win32

One of our teams is building a database (and application) that will use the FileStream feature of SQL 2008 to store documents. According to the MS best practices for filestream, the Win32 APIs are the preferred way to access FileStream data, vs using T-SQL. However, using the Win32 APIs requires using integrated authentication to con...

How to using the loop and bulk load tasks to insert the name of the csv files being looped?

Description I have created an SSIS package imports data from hundreds of csv files on a daily bases I have used the bulk load and foreach loop container Problem I have created a column on a database table and wanted to know if it is possible to add the source file name on each row of data. ...

web-based SQL management tool

Does anyone know of a web-based management tool for SQL server 2008? preferably open-source. ...

call a web service from T-SQL in Sql Server 2008

Is there a way to call a HTTP web service from T-SQL (no SQLCLR) in Sql Server 2008? I just need to send information out, I do not need to receive anything into T-SQL. Thanks. ...

Windows 2008 server -hardware planning help

Hello all, I am setting up a website on win2008/sql2008 (64 bit) on a dedicated server, which may get 50K to 100K users/visitors. Concurrent users at any time may be 1000 (max). Users will log in 4 to 6 times a month and spend 10 minutes (maximum) on the site for minimal data entry. There will be some reporting run at night. The site h...