Questions tagged [sql-server-2008]

Use this tag for questions specific to the 2008 version of Microsoft's SQL Server.

sql-server-2008
Filter by
Sorted by
Tagged with
0 votes
1 answer
132 views

The image file is not generating properly in SQL server 2008 using xp_cmdshell

Please help me out to resolve this issue, I tried several options but unable to get success till now, any help would be greately apprecaited. I am generating one image file using xp_cmdshell on SQL ...
user1112537's user avatar
20 votes
1 answer
33k views

SQL UNION FOR XML name output column

I'm trying to generate an XML output from SQL and need to use a UNION statement and also name the output column. I had this working before when I didn't need to use a UNION statement using: select( ...
Jammer's user avatar
  • 2,400
0 votes
1 answer
70 views

It's possible to save report parameter wrote by user?

I have report where I ask user to write path to dir of files. This parameter have default value on start, but I want to allow user change it. From moment where he change it parameter wrote by user ...
WooCaSh's user avatar
  • 5,200
0 votes
2 answers
2k views

pdo dblib stored procedure insert wrong characters

i'm using microsoft sql server as database and my php code on centos server. using freetds and dblib to connect from yii framework to mssql. everything's are fine. after insert into db by Stored ...
Vahid Chakoshy's user avatar
0 votes
2 answers
7k views

BIDS and SQL Server 2008 Reporting Services install

We would like to start using SQL Server 2008 R2 Reporting Services in our company, but we are using SQL Server 2008 Enterprise Database Engine on a standalone server and have Visual Studio 2010 ...
Rick's user avatar
  • 2,308
0 votes
1 answer
49 views

Possible to update PK to a composite PK in SQL Server without destroying the table relations?

Hi I got an existing table and due circumstances I need to edit my PK to a composite PK. How can I update my current table PK PARTYID. Some info: I want PARTYID & PARTYGUID to become my ...
dg90's user avatar
  • 1,263
3 votes
1 answer
5k views

Converting float to varchar with correct decimal separator

Hi i'm living in austria and we use the , as decimal separator. It seems to be impossible to convert the float to varchar with the correct separator according to the language/collation setting? Is ...
Christoph Staudinger's user avatar
1 vote
1 answer
1k views

Unable to connect sql job agent with linked server

I want to send emails from sql server 2008 through linked server. I configured the Linked server using:-- EXEC sp_addlinkedserver N'linkedserver.com',N'SQL Server'; EXEC sp_addlinkedsrvlogin '...
dIvYaNsH sInGh's user avatar
1 vote
0 answers
2k views

Identity column without index or unique constraint

I just experienced a database breakdown due to sudden extradordinary data loading from disk. I found the issue would arise when I attempted inserting into a log table with approx. 3.5 million rows. ...
Silas Hansen's user avatar
  • 1,719
1 vote
1 answer
1k views

Reload database objects in a VS database project?

if I create a SQL Server 2008 Database Project in Visual Studio 2010, then I am able to right click the project and select Import Database Objects and Settings.... I can do that exactly one time (even ...
Core_F's user avatar
  • 3,422
1 vote
5 answers
3k views

SQL Server performance with using JOINs inside views vs writing them in sprocs?

In a database I have less than 200,000 records in a table, and in a stored procedure I am referencing a couple of views that perform several LEFT JOINs and other joins. One of the views used contains ...
ElHaix's user avatar
  • 12.9k
6 votes
3 answers
1k views

Synchronization between SQL Lite database on an android device and SQL Server Database

We are trying to synchronize between SQL Lite databases hosted on different Android devices, and SQL server database hosted on a central server. We eliminated the use of a Webservice because of a ...
Hassan Mokdad's user avatar
1 vote
2 answers
145 views

How to check Contains big string into small string?

I have SQL Server data base where i am storing city Name. Like "Delhi"; Example: I have samll word "delhi" and collection of big string is "New Delhi", "Old Delhi", "Delhi ncr". If I will make ...
Pankaj Mishra's user avatar
2 votes
1 answer
565 views

Table Insert Rate Slows AsTable Size Increases

Parsing some data and inserting it into 3 tables from .NET. Using Table Valued Parameters to pass the data as some inserts are 600,000 rows. Passing objects (not DataTables) and they are passed by ...
paparazzo's user avatar
  • 44.9k
3 votes
2 answers
223 views

How can I avoid failing an entire INSERT batch due to 1 NULL

I have a table with a primary key and a stored procedure I use to insert to that table. I have no control over the stored procedure and cannot change it. Sometimes the procedure returns many records ...
Gus's user avatar
  • 31
3 votes
2 answers
11k views

Connect to SQL SERVER 2008 (using Windows Authentication) via PHP in IIS7?

I need to connect to Sql Server 2008 using windows authentication from PHP code by passing the username and password like we do when we connect to Sql Server with SQL Authentication. I need to ...
user1123066's user avatar
0 votes
1 answer
179 views

What's the security risk of using xpath?

I'm trying to add an XML column to one of my critical tables in order to save sensitive data. I can't query over these xml records using Entity Framework, so my plan is to query over them using Stored ...
Reza Owliaei's user avatar
  • 3,323
0 votes
1 answer
39 views

Year instead of Date

I do this to get the earliest year: select top 1 tblOrders.OrderDate from tblOrders order by tblOrders.OrderDate What would I need to do to get the year instead of the date presuming OrderDate is of ...
Baz's user avatar
  • 13k
0 votes
1 answer
408 views

getting herarical data from Parent-child tables?

There are 3 data tables: productCategory It has data of basic categories. This table has two columns( categoryid, categorydescription). Sample Data 101 MENS 102 WOMENS 103 CHILDRENS 104 BABIES 105 ...
haansi's user avatar
  • 5,600
2 votes
1 answer
1k views

Filestream column in the WHERE clause locks the server

I have implemented filestream in an existing database on SQL Server 2008 r2. Now I have a very urgent problem as my site is practically down now: With a very simple table like this: CREATE TABLE [...
Durden81's user avatar
  • 1,016
0 votes
1 answer
1k views

Creating a nested OR statement using NHibernate Criteria API

So I love learning new things about NHibernate because it truly is very flexible and makes my life easy except for where i'm stuck at right now ;) . So far I haven't had to do very complex queries, ...
CSMHowitzer's user avatar
1 vote
1 answer
699 views

Is there any simple way to implement the merge query of SQL Server in Linq?

Is there any simple way to implement the merge query of SQL Server in Linq? Thanks in advance!
zs2020's user avatar
  • 54.1k
4 votes
2 answers
29k views

An error occurred during local report processing - C# Windows Form VS2010

I am trying to use SQL Server Reporting Services in Client Mode, but something is going fishy. I have two tables in database "IEPL_Attendance_DB": Employee(EmployeeID,EmployeeName) and EmployeeTimeIn(...
Azeem's user avatar
  • 2,914
14 votes
3 answers
10k views

SqlCommand.Dispose() before SqlTransaction.Commit()?

would it work to dispose a command assigned to a transaction before the transaction is committed? I tested the following code myself, and it seems to have worked fine, but this is a rather small ...
David S.'s user avatar
  • 6,016
11 votes
9 answers
61k views

SSIS issue Failed to decrypt protected XML node

I created an SSIS package which is having ftp pull files from ftp server and save to my local drive but I'm getting this issue. With same error message I was getting only warning but today the job ...
Neo's user avatar
  • 15.9k
6 votes
2 answers
13k views

using PARSENAME to find the last item in a list

I am using Parsename in SQL and would like to extract the last element in a list of items. I am using the following code. Declare @string as varchar(1000) set @string = '25.26.27.28' SELECT ...
PhilC's user avatar
  • 418
0 votes
1 answer
15k views

How to compare textbox value with the sql database value in c#?

How to compare textbox value with the sql database value in c#? im a beginner n i have to make a project. i only know how to connect sql database with the c# project. and also tell me any tutorial, ...
Ronak Keslikar's user avatar
1 vote
1 answer
236 views

Compare database on Oracle and SQL Server

I am working on a project which migrates databases from Oracle 10g to SQL Server 2008 using SSMA(SQL SERVER MIGRATION ASSISTANT). I want to know if there is a way to actually compare the data in ...
Egalitarian's user avatar
  • 2,198
0 votes
3 answers
7k views

Compare datetime in stored procedure

I have a sql 2008 database and I am creating a stored procedure that shall check if a datetime is more than 3 hours old but I don't know how to do it. Do you have some way to do it? the datetime is ...
7heViking's user avatar
  • 7,337
1 vote
2 answers
3k views

Filter based on multiple date ranges?

The user clicks on a month and then this stored procedure is executed. It checks for the total booked time and what groups have been filtered. | Job Group | Month Booked | Time (hrs) | Cleaning ...
SOLDIER-OF-FORTUNE's user avatar
0 votes
1 answer
193 views

dynamic pivot in SQL Server

I have a query that uses both pivot and unpivot at the same time and I got it working fine. The code is part of a stored procedure that gets called from a Excel Macro when user passes in the ...
rvphx's user avatar
  • 2,334
1 vote
1 answer
367 views

Stored procedure to get paged sorted results with a computed data column

I want to make a stored procedure to get paged sorted result but here's the twist. I have to add a column and fill it with computed/calculated data. Currently I have ALTER proc [dbo].[...
Vaibhav Singla's user avatar
12 votes
3 answers
17k views

Currently running query inside a stored procedure

I have a stored procedure that is currently running, and seems to hang/lock on a specific query. How can i see which query? Preferably without modifying the proc. Using DBCC Inputbuffer (65) gives ...
cederlof's user avatar
  • 7,305
0 votes
2 answers
58 views

Joining query upon first result only

I am creating a stored procedure where I would like to bring back just the first record from each match up instead every record that matches. I have written the following code so far: SELECT ...
ediblecode's user avatar
  • 11.9k
1 vote
1 answer
2k views

Create trigger from a sql file within VS2010?

I have a strange problem here, I want to create an emtpy trigger: SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TRIGGER dbo.TestTrigger ON _TestDB.dbo.test AFTER UPDATE AS BEGIN ...
Core_F's user avatar
  • 3,422
6 votes
2 answers
17k views

Insert image into database

I'm trying to insert an image into the database. CREATE TABLE ImageTable ( Id int, Name varchar(50) , Photo varbinary(max) ) INSERT INTO ImageTable (Id, Name, Photo) SELECT 10, 'John', ...
chinna_82's user avatar
  • 6,393
1 vote
1 answer
1k views

"Invalid column name" In SQL Server from OpenQuery to SSAS with flattened results

I run the following query in T-SQL with LINKED_AS being my SSAS. SELECT * FROM (SELECT * FROM OPENQUERY(LINKED_AS, 'SELECT FLATTENED PredictTimeSeries([PredictColumnName], -3, 0) FROM [...
Niklas's user avatar
  • 11
5 votes
1 answer
16k views

Exit out of WHILE @@FETCH_STATUS = 0 in db_cursor

Is there a way to exit out of the WHILE @@FETCH_STATUS = 0 while performing a db_cursor? I tried SET @@FETCH_STATUS = 1, but as i expected, an error. Help?
Control Freak's user avatar
0 votes
2 answers
2k views

Storing Symbols like ϱπΩ÷√νƞµΔϒᵨλθ→%° in SQL Server XML

I ran these quires in my SQL server select cast('<Answers> <AnswerDescription> ϱπΩ÷√νƞµΔϒᵨλθ→%° </AnswerDescription> </Answers>' as xml) select ' ϱπΩ÷√νƞµΔϒᵨλθ→%°' And ...
Nikshep's user avatar
  • 2,115
3 votes
3 answers
3k views

SQL Script in VM taking long time for execution

I have the Execute SQL Script package that contains the script to insert about 150K records. Problem in here is when I execute the package in the Virtual machine its taking 25 min's approx and the ...
M.C.Rohith's user avatar
  • 3,740
4 votes
2 answers
3k views

How can I manage SQL Server jobs using a Database project

Does Visual Studio 2010 support managing SQL Server jobs in the Database Project? I am working with a database project in Visual Studio 2010. I would like to manage my database scheduler job in my ...
Pongsathon.keng's user avatar
-1 votes
2 answers
123 views

check 2 primary key in one table

I have table psc_Pro_ProfessorPositions(ProfessorID,PositionID,StartDate,EndDate). It have 2 primary key is ProfessorID,PositionID. I want to check ProfessorID,PositionID not in table to insert.I ...
Khanh's user avatar
  • 25
17 votes
3 answers
14k views

SqlException: Syntax Error Near 'GO'

I am having trouble sending a SQL statement through a DbContext using context.Database.ExecuteSqlCommand(). I am trying to execute CREATE TABLE Phones([Id] [uniqueidentifier] NOT NULL PRIMARY KEY, ...
bdparrish's user avatar
  • 3,202
1 vote
1 answer
2k views

Execute a Stored Procedure with OUTPUT For Each Row in SELECT Statement

Is it possible to execute a stored procedure for each row in a SELECT? This only executes the first row, looking for something to execute for all rows: Declare @Loop bit = 1, @ID int, @...
Control Freak's user avatar
-1 votes
3 answers
793 views

Get first row for one group [closed]

I want to get the first row for every GV(TeacherID) GV | Class| SUM GV1| L001 | 5000 GV1| L002 | 5000 GV1| L003 | 5000 GV2| L002 | 7000 GV2| L003 | 7000 GV2| L001 | 7000 ...
Khanh's user avatar
  • 25
0 votes
3 answers
160 views

Skip field if not find data in stored procedure

Question here. I am creating a stored procedure which I want to determine if one of the columns has no data then it will skip the row. example : Table Name: Employee Employee No | Employee Name | ...
Elynn Chia's user avatar
-1 votes
1 answer
122 views

Only show items with price over average

My sql looks like this and I only want to show items with price over average SELECT COUNT(Artikelnamn) AS 'Antal Artiklar', FLOOR(SUM(Price)) AS 'Lagervärde', FLOOR(MAX(Price)) AS 'Max', ...
Filip Nilsson's user avatar
1 vote
1 answer
12k views

Return Output Param of a Stored Procedure inside another Stored Procedure

I'm trying to find out how to return the output parameter of a stored procedure when executing the stored procedure inside another stored procedure: CREATE PROCEDURE Test1 EXEC SpWithOutputID -- ...
Control Freak's user avatar
9 votes
3 answers
27k views

Using IF IsNumeric as Argument

i was wondering how to use IsNumeric in SQL, it's a bit different from VBScript, but i think i was able to get around it, ie: IF 1 = ISNUMERIC('5675754674') BEGIN ... END Would this be a way ...
Control Freak's user avatar
1 vote
1 answer
1k views

Trouble creating SQL Query to update line item amounts

I'm going to preface this question with the disclaimer that creating what I call "complex" queries isn't in my forte. Most of the time, there is a much simpler way to accomplish what I'm trying to ...
AJ Tatum's user avatar
  • 693

1
821 822
823
824 825
1076