2,935 Topics
| |
This is my SP code SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE SP_Get_Age @name varchar(20) AS BEGIN SET NOCOUNT ON; SELECT Age FROM PersonDetails WHERE Name1 = @name; END GO This is my C# code private void callSP(string name1)//name1 comes properly in button click event { using … | |
I want to build a voucher system. I am developing an application and want users to login from a database (preferable MS SQL). I want the DB to randomly create codes for users to top up their accounts. The codes will be unique in that they will be based on … | |
While trying to connect to MSSQL Server 2012 using pymssql,I get the following error. My server name in Windows Authentication is SARATH,User Name is Sarath\SarathShanker and I did not set a password. >>> mssql_conn=pymssql.connect(host='SARATH',user='Sarath\SarathShanker',password='',database='matrix') Error: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "pymssql.pyx", line 556, … | |
hi, how to convert db table column datatype from varchar to binary(16) in sql server 2005? thanks | |
as title itself is saying what i am looking for over here. I formatted my pc and installed Sql server 2005. I detached db before formating the system and attached after formating. however after attaching i am getting Db in recovery/ readonly in object explorer. I tried to change properties … | |
Hi All, i have requirement like to Convert rows to columns in SQL server. i have retrieved data like below: MatchId SelectionName Odds 322 Home Win 1.33 322 Draw 5.00 322 Away Win 9.00 322 Under 2.5 2.40 322 Over 2.5 1.53 and want to convert like below: MatchId Home … | |
Need help! As you can see, I'm working with a crosstab report that will display the product's "Total Sales" or "Quantity Sold" on a particular year in a monthly basis. Now my problem is, I can't figure it out how I can display the monthly total sales or quantity sold … | |
Hi All, I'm a little stuck with one table's design. I have a table called tblConference_Board that will be updated approximately 3 to 4 times per year. The following is my table design: `CB_ID int (PK)` `CB_Mnemonic_ID int (FK)` `CB_Value decimal (18,10)` `CB_Year int` `CB_Quarter int` This table is loaded … | |
Hi All, I have a table that holds monthly data in it. I need to average that data into Quarterly and Annual data but I'm not sure how to go about that. For annual I tried something like: SELECT TOP (100) PERCENT b.vSeries_Type as [Description],b.vSeries_Number as [CANSIM], Year(a.IPI_Ref_Date)as [Year], avg(a.IPI_Value) … | |
hi i am new to sql i want to get some values from different tables and i have made my own logic like that "SELECT course_name, course_id FROM tbl_course WHERE course_id = (SELECT course_id FROM tbl_enrollment WHERE student_id = '" + lbl_StudentID.Text + "')" what could the correct sytax for … | |
i am trying to make this code work with no success. Can anyone help me? ` $to = $_POST["credits"]; $messaging = $_POST["message"]; $sub = $_POST["subject"]; @mysql_query("INSERT INTO `mp_creditmail` (`Id`, `message`, `subject`, `read`) ('select Id from oto_members ORDER BY RAND() Limit $to;', '$messaging', '$sub', no");` i am trying to insert several … | |
please help me. i connected two system using a cross over cable, and was able to see the remote servers in both systems but i am experiencing a connection problem to the remote computer. how do i connect to the remote sql database server? and how do i replicate between … | |
Hi All, I sort of want to get a "best practices" perspective regarding numeric values. First, I'll give my scenario: In my SSIS package, a CSV file is used for data extraction. Once extracted, a staging table is loaded with all the values from the CSV. One column, called "IPI_Value" … | |
Hi, Does anyone know how to pass table name as parameter in a cursor? ALTER PROCEDURE [dbo].[error_calculation] @tablename nvarchar(50) AS DECLARE @part_no nvarchar(50) --Current Year Cursor DECLARE db_cursorpartno CURSOR FOR select distinct part_no from @tablename ///This gives error OPEN db_cursorpartno FETCH FROM db_cursorpartno INTO @part_no | |
Can I get data from two databases (in same database server) to a c# project. How to include two edmx files? Or is there another way? Thank you in advance | |
Hi All, I'm working on filling a user variable called "EmailString" via a db connection with SSIS. I've created a script task to do this (the only way I can see how) and in it I have the following code: Public Sub Main() ' ' Add your code here ' … | |
Hi Group! I've created a stored SQL procedure that will need to be modified to lock the table, run the commands and then unlock the table. I need to do this because I want any other users/programs that will need access to "wait in line" until the procedure is finished. … | |
I have a table called `DUTY` (columns: `dutyid, dutyname, staffid`) and a table called `STAFF` (columns: `staffid, staffname`) In order to be fair, each of the staff will be auto assigned to each duty entry (record). So what should I do whenever I would like to insert a duty entry, … | |
Hi Im working with a project, simple IM for our office... I have a Table in sql with column Status, if a user opens this application, the status column changes from 0 to 1, if it closes this app, the status turn back to 0. On my form load event, … | |
CAn i use 'waitfor' in t sql in sql server 2012 to wait in terms of days? eg. Wait three says after an event to do something else? Thankx in advance | |
I am moving from database from Microsoft Access to MS SQL and I have not worked with MSSQL before, can you recommend a good place to get some initial and then follow on training in SQL and MS SQL? | |
Hello! I need some help with a stored procedure for insert. I know this might sound stupid but I'm a beginner and I know the answer is there but I just can't find it. I've searched the site but I couldn't find an answer to clear me out ...or maybe … | |
I have a table with several columns, the two relevant columns for what I need to do are invoiceNumber and stockNumber. The scenario here is that it's a table of invoice information, so each invoice can have and will most likely have multiple rows in the table which represent each … | |
Hi, Can anyone help me with my CASE statement update on a temp table. In my report I have the following case statement; 'STATUS' = CASE WHEN customer = 'BUS' AND country = 'GB' AND field_1 = 'X' THEN 'UK_BUS' WHEN customer = 'BUS' AND country <> 'GB' AND field_1 … | |
Hi Guys, I have a problem using the sqlsrv_connect function (in that it's failing!). I have been using mssql_connect on a server with an older verison of PHP where my connect string worked fine. But putting the information into the sqlsrv_connect doesn't let it connect. Here's my code that I … | |
while ( select AVG(Rate)+2 From HumanResources.EmployeePayHistory) <20 begin update HumanResources.EmployeePayHistory set rate=rate+2 From HumanResources.EmployeePayHistory if(select MAX(Rate)+2 From HumanResources.EmployeePayHistory)>127 break else continue end **I have Execueted this query but I am Not able to know what is this query working ? what is the use of this query ?? it will … | |
What is the procedure can be used in MS-SQL server 2012 in order to create a workflow as in dynamics CRM? Is there a way. Or what is the alternative? Thnakx in advance. | |
I have an assignment where i should demonstrate concurrency controls.In order to do that i should work with two sessions in the same database in ms sql server. How can i do that. | |
Hi, I want to copy records of a table say employee into the same table. For Example Table Employee contains 5 records. So i want to insert the same 5 records again into the same table Employee 20 times. I have tried the following Query (which is inserting records in … |
The End.