0
votes
1answer
21 views

updateing all foriegn key constraint in sql server?

I have a database in sql server 2008 R2 that have many table (over 200) and have many relation betweens tables. Delete rule in most of relations is No Action I need to Update all relation delete rule ...
0
votes
0answers
19 views

How can i correct the error “Connection reset” MSSQL Server 2008 connection with Java using sqljdbc4

i am trying to select some data from MSSQL Server 2008 with java using sqljdbc4.jar but it shows me these exceptions com.microsoft.sqlserver.jdbc.SQLServerException: Connection reset
0
votes
2answers
2k views

How to Encrypt SQL Server 2008 Database

I have a database which currently is using by my application. I dodn't want to change anything in my application CORE. But I want to encrypt DATA and INFORMATION in which stored or is storing in ...
0
votes
2answers
53 views

What is the best way to fetch records batch-wise from SQL Server

Scenario: we are fetching rows from SQL Server to C#.Net console application and doing action on the retrieved data from SQL Server through stored procedure; after the action is performed the new data ...
2
votes
3answers
44 views

How to join these two queries?

This query gets several AssignmentId's SELECT AS2.AssignmentId FROM dbo.AssignmentSummary AS AS2 WHERE AS2.SixweekPosition = 1 AND AS2.TeacherId = 'mggarcia' This query gets a value for only one ...
3
votes
1answer
38 views

SQL: find continuous date ranges across multiple rows?

I'm trying to get a start and end date combination for continuous spans of time worked. The spans can cross multiple rows, where the end date of the first row is the same as the end date of the next ...
-1
votes
2answers
31 views

How to handle .ndf files while restoring backup files in sql server 2008 [closed]

am trying to restore db through .bak file while restoring i met this error How to avoid this error and do successful restore, Note: against this Dababase 1. one .mdf file Ex: ...
0
votes
1answer
18 views

SQL server 2008R2 Allow Schema Compare [closed]

im trying to use http://dbdiff.codeplex.com/ to compare two of my databases unfortunetly I can only see my system databases in the database list. I tried Visual Studio's Data->Schema Compare but ...
0
votes
0answers
22 views

How to restore DB Backup from 64 bit SQL Server to 32 bit SQL Server [migrated]

i have an issue that 64 bit SQL Server DB Backup am unable to restore it into 32 bit SQL Server,for more details, Source Server(Backup Made One) Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 ...
-1
votes
2answers
34 views

How to add data from database test1 to database test2?

I have a database test1 and another one called test2. I need to add data from test2 to test1, but only if that data doesn't already exist in test1. Tell me please how do this?
0
votes
1answer
23 views

Update DATETIME values to <= GETDATE()-1

I'm looking to update existing DATETIME values to yesterdays date and previous depending on their DATE order but keep the TIME part as it is. For example assuming today's date is 2013-05-15 ...
0
votes
1answer
35 views

Pivot with a table variable

I'm unable to use a pivot the data of a table variable. Its giving following error on run-time: "Must declare the scalar variable @reportData" I have tried as mentioned below DECLARE @reportData ...
0
votes
4answers
58 views

Getting count of records in child table using select statement

I have a stored procedure in which i am trying to select all the columns of a table Table 1. There is another table which uses Table1 primary key as foreign key. I want to count number of records in ...
1
vote
1answer
77 views

How to convert between time zones in SQL Server 2008?

I am using SQL Server 2008 R2 and I wanted to know how we can convert CST time to IST time. I already have CST time in my dtDate column and want to convert it to IST format. Can somebody please help ...
0
votes
1answer
28 views

Parallel Query Execution while Sync in SQL Server

I am using Microsoft Sync Framework to sync data in N-Tier Client Server architecture. Synchronization works fine when there is low volume of data to be synchronized. However, when there is large ...
1
vote
2answers
141 views

CDC fails after attaching database to SQL Server 2008 R2 instance

We have a SQL Server database hosted on SQL Server 2008 R2 (SP 1) with CDC (change data capture) enabled. After a re-install of the SQL Server instance due to license expiration (the deployment team ...
0
votes
1answer
126 views

Assign proper fill factor option for each index

I use SQL Server and want to assign proper fill factor value for each indexes. I know below parameter for each index: Row count of each table Amount of Scan occurred for each index Amount of Seek ...
-2
votes
0answers
30 views

I have joined for four tables and i want use Combined cumulative for some columns in SQL Server?

select plitno, A, datils, 0, 0, 0 from table1 union all select critno, 0, 0, B, 0, 0 from table2 union all select klitno, 0, 0, 0, C, 0 from table3 union all select bgitno, 0, 0, 0, 0, D from ...
0
votes
1answer
37 views

System.OutOfMemoryException when trying to run a create table script generated by SQL Server Management studio

i've 8GB of ram, when i tried it on a 16GB machine the script runs fine, all it does is it creats 2 tables and fills them with data, about 12000 records for each table and 38 columns for the first ...
-1
votes
2answers
40 views

What does the third parameter in CONVERT() do?

Query Get the Joining year,Joining Month and Joining Date from employee table This is my query which I have to perform. For this I write the following script: select SUBSTRING ...
0
votes
2answers
42 views

Cannot connect to SQL Server instance from web application but can from SSMS

I've got SQL Sever 2008 R2 Express installed and am able to connect to it with SSMS using (local) and Windows Authentication. However, when attempt to connect to it from an MVC Web Application ...
0
votes
3answers
70 views

How to create dynamic SQL queries inside CURSOR

I have to dynamically create a query inside cursor DECLARE @id VARCHAR(10) declare @loc varchar(25) set @loc = '/MainItem/SubItem'; declare @querry varchar(max) DECLARE myCursor CURSOR LOCAL ...
-1
votes
1answer
29 views

Calculation of fuel

I have a table contains two fields named ME and STE with data type decimal.I want to find (ME used for last 90 Days / Total STE for last 90 days) * 24 I need to solve this using sql. How can I write ...
0
votes
1answer
13 views

Calculation Aecc in sql

I have a field named Ae in my table. I want find "total Ae consumed in last 90 days/90". How can I write a query to find this in sql. Please help me to solve this.
1
vote
1answer
62 views

inserting into temporary table

In first step i am creating structure of the table, Second step i am inserting data from one table into the 1st table, third step also i am inserting data from another table to first table, fourth ...
0
votes
1answer
30 views

How to create multiple REMOTE SQL servers easily?

I want to create 4-5 REMOTE SQL servers for a learning purposes. I want to avoid all installation, admin, troubleshooting tasks. I want all this FOR FREE. How do I do this ? The purpose behind ...
0
votes
1answer
36 views

SQL Server identity column skipping ids on insert - no errors detected in logs

I am using SQL Server 2008 to maintain a database where I have an userAcccounts table where the user details are stored while registering on the website. The userID column is an integer with identity ...
2
votes
0answers
21 views

Maximum memory setting in Sql Server [migrated]

Firstly, apologies if this is not the right forum for the question. I'm running Sql Server 2008 and a web based application, on a single dedicated server, with only 2Gb of memory available. As is ...
0
votes
0answers
35 views

Manipulating Data in Joins

Diagram: Query for join: SELECT DISTINCT c.CustomerID, c.FirstName , sh.DueDate, p.ProductID,p.ListPrice FROM SalesLT.Customer c INNER JOIN SalesLT.SalesOrderHeader sh ON c.CustomerID = ...
0
votes
0answers
49 views

Why is error 22051 from sp_send_dbmail not caught by a CATCH block?

So I have a sql stored proc: CREATE PROC sp_SendConfirmedPurchasesEMail ( @RecID INT ) AS ... msdb.dbo.sp_send_dbmail @profile_name = @ProfileName, ...
-1
votes
0answers
33 views

Deleted a file accidentally, I need to remove it's entry, I don't need it's data because it contains only indexes [migrated]

I have a C# program to deal with a big database, I need the databas not to be the buttle-nick of my program, in the database, to increase performance, I have created a filegroup with a single data ...
-2
votes
1answer
52 views

Searching an MS SQL database for a specific word [duplicate]

I've been scouring online for an example of how to do this but haven't found anything at all. All the queries I've found assume you know what table you want to search. I'm looking for a SQL query to ...
3
votes
3answers
3k views

IIF(…) not a recognized built-in function

I'm trying to use this in Microsoft SQL Server 2008 R2: SET @SomeVar = @SomeOtherVar + IIF(@SomeBool, 'value when true', 'value when false') But I get an error: IIF(...) is not a recognized ...
0
votes
0answers
53 views

Find datewise records by status for multiple records within same day

I am using sql server 2008 R2. I am having a table TblStatusMaster that have (Id, StatusName). Id is primary-key that is auto-increment and statusName can be in "Active, InActive, Screening, ...
1
vote
1answer
27 views

Is it possible to make a script for certain number of rows in Sql Server 2008?

I have a table with 100k+ rows of data. Is it possible to generate script (inserts) using MSSQL Server 2008 for only last 1000 rows of data? e.g. Tasks > Generate Scripts... is making inserts for all ...
2
votes
1answer
42 views

Not able to get the stored procedure's result in variable in sql server? [duplicate]

i have a Hierarchy of stored procedures calling one in another as below: 1 2 3 Now what i am doing is: first of all i am showing the 1st level sp . Create proc proc_test3 ( @Id ...
1
vote
1answer
26 views

Sql Server Value Method Returning only one value not multiple

I am trying to return multiple element values into rows and I am running into the below issue of it not returning all instances in rows, I have isolated the issue down to a singleton problem. I have ...
0
votes
2answers
34 views

How do I insert a default value as part of a SQL Server View definition?

I have a number of different views which use the same underlying table, but each uses a different default value for the FK. So for my attempted code: ALTER VIEW [dbo].[vwTest] AS SELECT Id, ...
1
vote
1answer
15 views

SQL Server : returning the related xml with value, nodes methods

I have a the below sample XML schema that I am querying from in SQL Server 2012. I have a table with a XML column. I want to include the snippet of xml when each row is returned. Below is the ...
0
votes
0answers
70 views

SQL Server Tables, Views and EF Entities, I am using generic columns of type string, many of which will be null. Am I wasting space?

I need to implement multiple entity types like product, clients etc that exist in a report. The attributes of these entities can all be string. Because there may be quite a number of these "entities", ...
0
votes
1answer
33 views

What does the suffix of a temporary table's name mean?

If you expand the tempdb node and go to Temporary Tables, you will notice the name of the temporary tables have "______XXXXX" appended. Where does that part refer to?Is it the memory place where the ...
0
votes
4answers
43 views

What is the syntax meaning of RAISERROR()

Hello everyone, I just created a Instead After Trigger whose syntax is given below: Create trigger tgrInsteadTrigger on copytableto Instead of Insert as Declare @store_name varchar(30); declare ...
0
votes
0answers
68 views

Display Data Year Wise + Horizontal Format

I am Using SQLServer2008. Below is my Stored Procedure DECLARE @planTable TABLE ( Year VARCHAR(20) , PlanTypeId INT ) INSERT INTO @planTable ( Year , PlanTypeId ) ( SELECT ...
0
votes
1answer
268 views

There is insufficient system memory in resource pool 'internal' to run this query

I am facing the titled error. I searched for the issue on google found manmy people facing the same issue but non of them matches my scenario. I have a simple query but there are 100,000 of ...
5
votes
3answers
54 views

Index on a column with like and where pattern?

I've came to this conclusion that Like in below cases does seek/scan But I didn't get Why does it scan in 1st case and Seek in 2nd case. I understood the 3rd case. SELECT c.contactname FROM ...
0
votes
1answer
22 views

Replication 2008 publisher to 2008r2 subscriber [closed]

Is there a way that the replication mechanism can handle such the topology, where SQL SRV 2008 is a publisher and will provide publication to 2008 r2 subscriber? Thank You in an advance!
0
votes
2answers
82 views

Difference among @@IDENTITY, SCOPE_IDENTITY, and IDENT_CURRENT

I have studied the following line on msdn. "@@IDENTITY and SCOPE_IDENTITY will return the last identity value generated in any table in the current session. However, SCOPE_IDENTITY returns the value ...
0
votes
2answers
32 views

trying to find the continued students from one year to the next using joins

I am trying to find the student record from 2006 that returned in 2007. I have a file for 2006 and a file for 2007. I have the following query but not sure if I am using the right join. Also should it ...
0
votes
1answer
47 views

sp_send_dbmail: FROM_ADDRESS

I am using SQL Server 2008 R2. When I execute sp_send_dbmail I can't change the FROM_ADDRESS from the DEFAULT ONE that our DBA specified. Why is there this parameter if it doesn't work or How do I ...
1
vote
1answer
118 views

Trigger Error: The current transaction cannot be committed and cannot support operations that write to the log file

So I am getting the following error message from SQL Server when sp_SomeProc tries to execute an invalid sql statement. I get the error: The current transaction cannot be committed and cannot ...

1 2 3 4 5 13
15 30 50 per page