Hi Everyone,
I'm using SQLServer2008 Express
I have a table and a script to convert the rows into columns with expected result as
PARENT_ID name01 name02 name03 name04
1 ABC DEF ABC2 DEF2
2 DEF3 null null null
However, I get the result as
PARENT_ID name01 name02 name03 ...
I’m having a problem with a linked Informix table in MS SQL Server 2008r2. When I query this table, it seems to ignore some of the criteria I’m passing to it but not others. For example if I put a condition on the rowdate field the remote query part of the execution plan does not show any WHERE clause but if I put criteria on another fie...
A SQL Server application we use (accpac) represents dates as an 8 digit decimal in ISO format (example: today's date is 20100802)
I need to add one month to this. I've found a way to do it, but there must be a better way.
The steps of my solution are:
declare @accpacDate as decimal
set @accpacDate = 20100101
declare @date1 as date
dec...
When I run a simple SELECT statement on this table I get a row back (this is correct there should only be one). Here is that SELECT statement:
select * from Lending.HMDA where BatchId = 1
Here is the proc I am executing, which returns no rows:
DECLARE @BatchStartDate datetime, @BatchEndDate datetime
SELECT @BatchStartDate = ...
Hello,
I have a SQL Server 2008 database with two tables. The first table is called Department. The second table is called Ticket. These two tables are defined as follows:
Department
----------
ID
Name
TotalTickets
Ticket
------
ID
DepartmentID
Description
AssignedTo
I'm trying to figure out a way to dynamically update the Departmen...
I have 2 tables
CREATE TABLE PODRAS_MS.tbl_FieldWorkers
(
[FWInsOnServerID] INT NOT NULL IDENTITY(1,1),
[BaseStationID] INT NOT NULL,
[RefID] INT NOT NULL,
[DisSubInsID] INT NOT NULL,
[FieldWorkerID] CHAR(7) NOT NULL,
...
To create a new database and populate it from a backup I typically do:
CREATE DATABASE MyDatabase -- I create an empty database
-- I retrieve the filepath of mdf and ldf files
DECLARE @FileData varchar(1000)
DECLARE @FileLog varchar(1000)
set @FileData = (select filename from MyDatabase.dbo.sysfiles where fileid = 1)
set @FileLog = (s...
I call asynchrounously some stored procedures with BeginExecuteNonQuery and EndExecuteNonQuery (in C#). How can I catch the (defined) exceptions of these stored procedures in the C# program? Or does the try{}catch{} also works for asynchrounous calls?
...
I am looking at writing a WinForms app and getting stumped over what seems to be simple issue.
There is a server and database (SQL Server) Open ports are HTTP, HTTPS
There is a WinForms client. It needs to connect a TCP/IP stream (possibly HTTP, SOAP, REST) to the server.
Sometimes the WinForms client goes off-line and then the WinFor...
Hi all
suppose i have the following table
CREATE TABLE #ResultTable (NettAmount money, GrossAmount money,TotalVat money)
Given a gross amount eg=250 I know that vat is at 17.5%
How Do i calculate the totalVat?
Thanks for any suggestions
...
Hello,
I have SQL Server 2008 database with two tables. The first table is called Shelf. The second table is called Product. Each Product will belong to a Shelf. Based on this, I have a table structure that looks like:
**Product**
ID (int)
ShelfID (int)
Description (text)
**Shelf**
ID (int)
AisleNumber (int)
TotalProducts (int)
When...
I am building an object from multiple datasources. Does anyone know whether this is possible in NHibernate and how. I should mention that one source is SQL the other ORACLE.
...
I work at a college a change to policy is Students windows accounts are now disabled upon creation and are only enabled upon them passing a test. Don't ask
So I can easily modify my DSADD with -disabled yes
However I need to enable them when they pass the test. I obtain the test results from a sql server so is it possible to enable the...
Hi,
I am using AD Hoc Distribution Queries to transfer Data from MS SQLServer 2008 to MS Access.
The process is started using a single SQL Statement:
INSERT INTO OpenDataSource('Microsoft.Jet.OLEDB.4.0', 'Data Source=C:\temp\target.mdb;User ID=Admin;Password=;')...testtable select * from dbo.testtable
To do that I have set the Ad H...
Can I use expressions in Sql Server Reporting services to combine all of the values of a column within a group? I'm trying to accomplish what MySQL's group_concat function does, but in the report (not in the query).
Example. I want to make this data:
Group 1 Value
Test
A
B
Test 2
C
D
Look this t...
I realized after populating the table that it contains special encoding for foreign characters. I changed it to nvarchar but how do update the records already in the table since I still see it in the table. for example
Börsenblatt
...
I want to use the Full Text Search feature of Microsoft SQL Server.
If I have a table Client which refers other tables like City, Country, Department, etc. is it better to create a separate table that would hold de-normalized data, which would then be full text indexed, or is it better to create a dummy value in every foreign table (for...
Here is some sample code:
DECLARE @sourceFile varchar(255), @testRows int
SELECT @sourceFile = @xmlInfo.value('(/SelectFile/DataSource)[1]', 'VARCHAR(255)')
EXEC sp_addlinkedserver 'SomeData', 'Excel', 'Microsoft.Jet.OLEDB.4.0', @sourceFile, '', 'Excel 8.0', ''
IF @xmlInfo.exist('/ConfigArgs/ParamsXml/ImportDealerData') = 1
...
I'm trying to write this as part of stored procedure on SQL Server 2000. I keep getting a syntax error thrown on line starting Insert into OPENROWSET(.....
Help! I can't see the syntax error!
DECLARE @vDate Varchar(25)
DECLARE @vCommand nvarchar(1000)
DECLARE @fileName varchar(500)
SET @vDate = LEFT(DATENAME(month, DATEADD(m, -...
Here is some sample code that worked fine in a 32-bit machine (SQL server 2005) and needs to be updated for a 64-bit... I know this is a common problem but have not been able to find how to fix it!
DECLARE @sourceFile varchar(255), @testRows int
SELECT @sourceFile = @xmlInfo.value('(/SelectFile/DataSource)[1]', 'VARCHAR(100)')
...