sql-server

unitialized subscription while replicating database

Getting this warning when trying to setup a transactional replication. This error occurs when setting up a subscription from sql server express using non impersonated login to the distributor. this works using sql server developer subscrption to sql server workgroup publication but not from sql express to sql workgroup. Im not sure if it...

Pivot on SQL Server 2010

I want to return the top three pets for each employee as columns instead of rows i.e. Owner_ID Pet -------------------- 1 Cat 1 Dog 1 Hamster 2 Cow 2 Sheep 3 Dog Convert it to Owner_ID Pet1 Pet2 Pet3 ------------------------------------- 1 Cat Dog Hamster ...

Using OpenRowset to connecto to Oracle from SQL Server

Hi guys, has anyone used OpenRowset to access an Oracle Database? I'm using the below statement to access Oracle: select * from openrowset('msdaora','Data Source=bidprod.boeingdb;User Id=;Password=;',' SELECT * FROM TABLE ') but I keep getting the below error. I think my problem is somewhere in my driver spec or data source spec. OLE...

Is it possible to force row level locking in SQL Server?

I can see how to turn off row level and page level locking in SQL Server, but I cannot find a way to force SQL Server to use row level locking. Is there a way to force SQL Server to use row level locking and NOT use page level locking? ...

Solution to avoid double-hop from client > web service > SQL Server

My project invoves a user connecting from client to web service, and then web service to SQL Server. The web services and SQL Server are on separate machines. Because of security requirements, we cannot used mixed mode in SQL Server, only Windows authentication. We are experiencing the "double-hop" issue between web service and SQL Serv...

Xquery nodes value

I need to get the value of AccountName in my table <rows> <Row xmlns="http://adcenter.microsoft.com/advertiser/reporting/v5/XMLSchema"&gt; <AccountName value="MA_Yellowpages - AdStore" /> </Row> </rows> I am using below thing - ;WITH XMLNAMESPACES('http://adcenter.microsoft.com/advertiser/reporting/v5/XMLSchema' AS ns) select...

Avatar image: store in database or on CDN?

Avatar image: store in database or on CDN? Ps( avatar is the users profile photo) ...

I am Trying to insert this data into SQL

I am trying to create the correct values for the tables I created. This is the code: INSERT DEPARTMENTS (Department_Id,Department_Name,Manager_Id,Location_Id) VALUES ('D0001,D0002,D0003','Think Tank,Creators,Marketers',NULL,'L0001,L0002,L0003') GO INSERT EMPLOYEES (Employee_Id,First_Name,Last_Name,Email,PhoneNumber,Hire_Date,Manager_ID...

Can the Select list in a SQL Statement use Regular Expressions

Hi all, I have a SQL statement, select ColumnName from Table And I get this result, Error 192.168.1.67 UserName 0bce6c62-1efb-416d-bce5-71c3c8247b75 An existing .... So anyway the field has a lot of stuff in it, I just want to get out the 'UserName'. Can I use a regex for that? I mean it would be kind of like this, select SUBST...

Can I set up materialised views on oracle for a SQL Server table over sqllink?

Hi, I have a table in a SQL Server database that needs to be visible to an oracle database. We have tried using a normal view over sqllink, but we are not able to create an onUpdate triggers on that view. I have read that we can create the trigger if it is a materialised view, but is unable to find any information on whether it can be ...

How to replace row value in SQL Server?

My table contains some rows like below Lcd - projector A & A products saranvana store LG - television IFB - fridge samsung - Monitor I want to replace space (special char) instead of - (hyphens) in all records ...

Querying for SQL Servers in an Inno-setup project

I'm creating a setup using Inno-setup. During the setup process, a SQL Server database has to be created. I want to give the user the ability to select an existing SQL Server instance (if one exists), where the database has to be created. So, what I want to do in the setup, is to query the network (and the local machine) for SQL Server...

How to sum data week wise in SQL 2000

Dear All How to sum data week wise in MS-SQL 2000 I have a Table "Reports" with the following columns. TotalSubmissions, ZoneID, RptMonth, RptDay, RptYear 2,1,6,1,2010 1,1,6,2,2010 1,1,6,3,2010 1,2,6,1,2010 1,2,6,2,2010 2,2,6,3,2010 1,2,6,4,2010 1,4,6,1,2010 1,4,6,3,2010 1,4,6,4,2010 I want to make a report week wise for a specifi...

insert batch record

what is the best way to insert,update batch records from code behind to ms sql? ...

SQL Server: how do I SUM column values if the name of the column contains a word?

In my SQL table: Period| Brand A small Bags| Brand A big bags| Brand D Shoes| ...| Brand X Shoes 2010 | 10 | 20 | 30 | ...| 200 How do I sum columns that contains certain words (e.g shoes) in the column names ? Expected results: Period | Sum of Bags | Sum of Shoes | .. 2010 | 30 ...

SQL: LIKE where condition specifying a letter followed by a number followed by anything else?

Hi, Is it possible to write a WHERE condition in MS SQL Server that will grab rows that: begin with a specified letter then have a decimal then anything else I basically have a table that contains postcodes and I want all postcodes that belong to Birmingham - B followed by a number. Some postcodes are in there that start B and then a...

Named Pipes Provider, error: 40 - Could not open a connection to SQL Server?

Hi In our project user using NHibernate 2.1.1 with SQL Server 2008 with .net 3.5. I am facing strange problem with SQL Server. We developed windows service, installed it and it was running fine for sometime. Unfortunately by mistake when I stopped SQL Server, NHibernate throw exception System.Data.SqlClient.SqlException: A netwo...

How to force 32bit app to use a 64bit COM dll in CreateObject?

The following code behaves differently depending on if I use the 32 or 64 bit version of wscript: Set oSQLServer = CreateObject("SQLDMO.SQLServer") For Each o in oSQLServer.ListInstalledInstances MsgBox o Next In 32 bit, it will list the instances of my 32bit server (SQL Server 2000), in 64 bit I get the contents of my 64bit serv...

Search query slow down performance due to lots of records in product table , please provide nice query in sql server to optimize given query

SELECT distinct tb_Ecomm_Product.SKU as ImageName, tb_Ecomm_Product.MainCategory, tb_Ecomm_Product.SEName, tb_Ecomm_Product.SKU, tb_Ecomm_Product.ProductID, tb_Ecomm_Product.Name AS PName, (Case When (SalePrice Is Not Null And SalePrice!=0) Then SalePrice Else ...

Performance issues with transpose and insert large, variable column data files into SQL Server

I'm currently working on a project where we have a large data warehouse which imports several GB of data on a daily basis from a number of different sources. We have a lot of files with different formats and structures all being imported into a couple of base tables which we then transpose/pivot through stored procs. This part works fi...