sql-server

Display filename only in SQL Server 2005 Management Studio tab

How can I just display the filename only in the tab? Currently I'm getting the full path in the tab. ...

Bing Maps Development - Map with Markers

I really like how this site looks: http://www.microsoft.com/web/WebsiteSpark/Catalog.aspx - specifically the GIS part - the map, the green markers, and how the markers on the map our bound to the list below. Would anyone know some resources on how I can get started on developing something like this? This site is appealing and really li...

Who is accesing my sql table?

I took over someones job and need to find out from where certain tables are being read. Is there a way to do that? The more information I could get about the caller the better. I am using MS SQL Server 2000. ...

Need help locking my code for SQL Server

We want to build into our software the capability to build SQL queries freehand (currently cannot do so with our software), but need to be able to lock it down so that users cannot make any changes, only select data from certain tables. Are there any good guides for helping me to lock this down appropriately (ie, least permissions neede...

SQL Server NOLOCK and joins

Background: I have a performance-critical query I'd like to run and I don't care about dirty reads. My question is; If I'm using joins, do I have to specify the NOLOCK hint on those as well? For instance; is: SELECT * FROM table 1 a WITH (NOLOCK) INNER JOIN table2 b WITH (NOLOCK) ON a.ID = b.ID Equivilent to: SELECT * FROM table 1 ...

SQL Server ASP Schema option

In my Godaddy hosting account I have an option to set up ASP Schema with my SQL Server 2005 database. It describes in very general terms what the option is: "ASP.NET configuration schema contains elements that control how ASP.NET Web applications behave." Can someone explain to me(or provide a link) in greater detail as to what that doe...

how to convert an SQL server 2005 .mdf to SQL server CE .sdf ?

HI , I created a project where it can work with SQL server 2005. Now i want this project to be migrated to SQL server CE 3.5 which will run in low config system ( XP , 500 MHZ and RAM 488) How do i convert my .mdf to .sdf .I used third part tool lik e PrimeWork but when i am trying to load it says not compatible . any help ? ...

SQL Server to DB2 Conversion: Migration Toolkit Issues

Hi, I am trying to convert from MS SQL Server 2008 Express to DB2 9.7. I have installed IBM Migration Toolkit and successfully connected to my SQL Server database (hosted locally). I tried to extract from database, keeping all default data mappings, but when I extract, I get the following (for all tables) - anyone had a problem like...

NULL comparison, take 2

Hello all, I have a subquery, used in WHERE section: A.column <> B.column Unfortunately, it doesn't work, if either A.column or B.column is NULL. So, I converted it to: ((A.column <> B.column) OR ((A.column IS NULL) <> (B.column IS NULL))) , presuming that "Table.column IS NULL" is boolean value and I can compare 2 boolean values....

Skip some columns in SqlBulkCopy

I'm using SqlBulkCopy against two SQL Server 2008 with different sets of columns (going to move some data from prod server to dev). So want to skip some columns not yet existed / not yet removed. How can I do that? Some trick with ColumnMappings? Edit: I do next: DataTable table = new DataTable(); using (var adapter = new SqlDataAdap...

sql query not printing

Hi Guys, I am trying to run a dynamic query but for some odd reason its not running. Its not even printing. Please can anyone tell me why is the below dynamic query not printing. DECLARE @CLIENTPK_NEW AS VARCHAR(50) DECLARE @CGNEEPK AS VARCHAR(50) DECLARE @TYPE AS VARCHAR(10) SET @CLIENTPK_NEW='6EF77AAA-1A7B-4D03-A448-D1088DED4134' SE...

variables in inline table valued function

I have a table valued function that requires three parameters. If any of the passed in parameters are blank I need to assign the parameter to null. Please can anyone advise me on how/where can i put the below if conditions in the function. IF @CLIENTPK_NEW = '' BEGIN @CLIENTPK_NEW=NULL END IF @CGNEEPK= '' BEGIN @CGNEEPK=NULL E...

Adding trigger to table with cascades

I'm trying to add a simple trigger to a table- the 1st issue i came accross was that this table has text columns - so the for delete, insert, update triggers aren't going to float. 'instead of' does though. I am now up against the fact that the table has cascades set on it. Do you know if there's a way to get around that little gem or a...

My database (.MDF) doesn't seem to attach to my .\SQLExpress but i can view it in VS 2010 ?

Hi there, Can anyone help? I created a DB under APP_Data using ADD ITEM and choosing SQL Server DB and sure enough its there. I can even double click it and it opens up in VS 2010 in the Server Explorer tab. The connection that i have configured in my web.config is the following <add name="ApplicationServices" connectionString=...

Stored Procedure doesn't like utf-16

All, I have a stored procedure on SQL Server 2005 that accepts an XML argument. When I execute: exec PutResultsOnDb '<?xml version="1.0" encoding="utf-16"?><loads of Xml data>' I get the error: XML parsing: line 1, character 39, unable to switch the encoding However when I do exec PutResultsOnDb '<?xml version="1.0" encoding="utf...

Is it possible to force Business Objects 6.5 to create proper ANSI joins?

The SQL that Business Objects generates seems to be stuck in a bygone era for SQL joins -- it insists on using the old Sybase outer-join syntax (*=, etc.), which is illegal in SQL Server 2005 when running at level 90. Is there an option somewhere to make it use modern join syntax (i.e., joining using the JOIN keyword rather than using co...

Sql server bulk insert/update vs MERGE in insert or update scenario

Hi. I need to find the best way to insert or update data in database using sql server and asp.net. It is a standard scenario if data exist it is updated if not it is inserted. I know that there are many topic here about that but no one has answered what i need to know. So my problem is that there is really no problem when you update/in...

How can I determine trending stories from a collection of news data

Hi guys, I have a portal that fetches news from hundreds of resources around the web. How can I be able to use these data to determine trending stories ? Any ideas would be highly appreciated. Thanks. ...

ODBC Call Failed - Error 3151

We have an Access database migrated from Access 97 to Acces 2007 with some linked tables to an SQL Server 2008 database. We are using a File DSN in the ODBC Administrator. Connection tests work fine there. In fact, we have a main form in the Access 2007 application that shows the data always correctly. The problem appears when we exec...

Hierarchyid Problem

Hi all, I have a table with hierarchyid column. It is like: [NAME] [PATH] Ahmet / Aliye /1/ Selen /1/1/ Erdem /2/ Bilge /2/1/ Aydin /2/2/ Tomrs /2/2/2/ I want to see NAMES like: [NAMES_WITH_HIERARCHY] Ahmet Ahmet/Aliye Ahmet/Aliye/Selen Ahmet/Erdem Ahmet/Erdem/Bilge Ahmet/Erdem/Aydin Ahmet/Erdem/Aydin/Tomrs How can i do this? ...