3,481 Topics

Member Avatar for
Member Avatar for VirendraThakre

Hi I am using two linked server Both have same tables by using sp_tables_ex 'linkedserver name' this I can see list of tables.One Emp table is available in that list but when I try select * from Openquery(linkedserver,'select * from public.Emp') then it show me error like Error message: ----------------------------------------------------------------------------------------- …

Member Avatar for drorharari
0
134
Member Avatar for potatoe

Hello there, As described in my thread's title.. Here's the situation: On this CRM I am currently developing to migrate a desktop CRM. I have planned to separate the database for my core and still use the current desktop CRM database to prevent any more file size increase the CRM …

Member Avatar for james.newell
0
84
Member Avatar for JustmeVSI

Hi guys. I'm pretty new to sql and I'm having some trouble with a store procedure. I tried to read about it by searching goggle but all the references i got to the topic contained to complex store procedures for me and my current level :P. Here is my simple …

Member Avatar for JustmeVSI
0
774
Member Avatar for krokodajl

Hi Everyone. I have problems with solving a sql question. There is an assumption: The database of naval ships that took part in World War II is under consideration. The database has the following relations: Classes(class, type, country, numGuns, bore, displacement) Ships(name, class, launched) Battles(name, date) Outcomes(ship, battle, result) Ships …

Member Avatar for MehranNZ
0
732
Member Avatar for marcel1

Please, try to help with this. I use case statement but for 2 arguments. Down here is the idea of what i want to get: select x case x when x = 'AB' and y like 'CD%' then x= 'CD' when x = 'ZZ' and y like 'CC%' then x= …

Member Avatar for teezecrost
0
171
Member Avatar for hitro456

Hi folks, I had mysql database with English+Chinese data in it...I had to migrate that database from mysql to MSSQL 2005. Now I cant view any chinese character..It shows '?' symbol in place of chinese characters. How can I set the collation in MSSQL that I can view chinese data …

0
87
Member Avatar for KRichardson1127

Hello all! I'm trying to convert one of my columns in MS SQL Server 2005 from an integer to a decimal field (ex. 59670 ---> 596.70), but I keep receiving an error message: [COLOR="Red"]Msg 8115, Level 16, State 8, Line 1 Arithmetic overflow error converting numeric to data type numeric. …

Member Avatar for sknake
0
92
Member Avatar for brookstone

Hi, This should be a simple query but I am not able to figure out how to get the result I want. I have two tables A and B and want A left Join B however, I do not want all of table A. I want to restrict table A …

Member Avatar for kplcjl
0
137
Member Avatar for kplcjl

Table1 has clustered PK A, 2 has clustered PK [A,B] and has a foreign key to table1. Both A and B are uniqueidentifiers and when table2 adds a record, B is always set to newid() so B is unique in table2. For each A value, there aren't more than 100 …

0
77
Member Avatar for sbv

Hi friends..... As when i am doing this task and found know help .............. here i am putting steps for importing data from Excel sheet into SQL Server 2003. How to Import data from excel sheet to SQL Server Note : - Sheet should be exactly same as Table in …

Member Avatar for sknake
1
230
Member Avatar for carelvos

Hi Guys, I have a problem connecting to a SQL Server from Windows 7 - this particular server I can only connect to by using the named instance from Win XP - I can connect to other servers that does not require you to connect to the named instance eg: …

Member Avatar for Ramy Mahrous
0
197
Member Avatar for end3r

Hy, I have a select like: [CODE] select case when isnull(my_table.entry,0) > 0 and my_table.edate = convert(datetime,substring('2009-09-20',1,10)) THEN COUNT(*) else 0 END as no_entries_date1 ,case when isnull(my_table.entry,0) > 0 and my_table.edate = convert(datetime,substring('2009-09-21',1,10)) THEN COUNT(*) else 0 END as no_entries_date2 ,case when isnull(my_table.entry,0) > 0 and my_table.edate = convert(datetime,substring('2009-09-22',1,10)) THEN …

Member Avatar for end3r
0
98
Member Avatar for jlenyi

** database table in visual foxpro ver.7 db2, fields: pid,fl1,fl2,fl3 ** database table in MS SQL database1 database1 fields: field1,field2,field3 Code in fox: SET DATE GERMAN uz1=ALLTRIM(db2.fl1) uz2=ALLTRIM(db2.fl2) uz3=ALLTRIM(db2.fl3) pMySQLstr="DRIVER=SQL Server;SERVER="path+"\SQLEXPRESS;"+"UID="+name+";PWD="+pwd+";Database="+database1" pMySQLhandle=sqlstringconnect(pMySQLstr) SQLSETPROP(pMySQLhandle, 'Transactions', 1) && Automatic transactions SQLEXEC(pMySQLhandle, "update database1 set field1=?uz1, field2=?uz2,field3=?uz3 where id=?pid") SQLDisconnect(pMySQLhandle) ** end sql …

Member Avatar for jlenyi
0
101
Member Avatar for VegaLA

Hi all, been working on this problem for a while now but having little success finding a satisfactory solution. I have a DTS package which contains two connections. one for SQL, the other for AS4000. I would like to pull records from the AS400 table using Account numbers stored in …

0
40
Member Avatar for sdimantova

Hi, I'm developing this query for a dashboard using System Center Config Manager Dashboard. The query needs to produce a table which shows the number of computers which have Office 2007 Standard edition in one row, and the next row should show the number of computers which do not have …

Member Avatar for sdimantova
0
166
Member Avatar for bhavna_816

I have to add a not null column in a table. I am using [code]IF NOT EXISTS(SELECT * FROM information_schema.columns WHERE column_name = 'xyz' AND table_name = 'abc') BEGIN ALTER TABLE abc WITH NOCHECK ADD xyz MONEY NOT NULL END[/code] It gives me error ALTER TABLE only allows columns to …

Member Avatar for Saranya_kamaraj
0
277
Member Avatar for sivaprakashm

while sending request parameter to this stored procedure i need to insert an department _id ,fy_id, vertical_id , while inserting .Before that i set one temp int variable and then assign it to query And checking the condition of temp variable if temp variable is 0 then could not only …

Member Avatar for urtrivedi
0
112
Member Avatar for msman88

[CODE]<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:AdNetConnectionString %>" SelectCommand="SELECT AdCampaign.ID As [ID], AdCampaign.CampaignName FROM Account INNER JOIN AdCampaign ON Account.ID = AdCampaign.AccountID WHERE (Account.EmailAddress = @EmailAddress)" DeleteCommand="DELETE FROM [AdCampaign] WHERE [ID] = @ID" > <SelectParameters> <asp:SessionParameter Name="EmailAddress" SessionField="EmailAddress" /> </SelectParameters> <DeleteParameters> <asp:Parameter Name="ID" Type="Int32" /> </DeleteParameters> </asp:SqlDataSource>[/CODE] In tge previous code. When …

0
69
Member Avatar for hmutual10

Is there a difference between regular SQL and Scalable/Pervasice SQL?

0
53
Member Avatar for TOMASO

I have been using ms sql 2005 for a while now. But recently one of my server has became too slow. I have not added neither changed anything on that server. It's a HP 380 G6 with 32GB ram and 2 processors 2.26ghz each. kindly help.

Member Avatar for pclfw
0
52
Member Avatar for Kusno

Dear all, I have a table that contains image data type and has more than 20,000 records. I want to change its file group to the new file group. I tried to change it using table designer, but everytime I wanted to save it, it occured an error with this …

Member Avatar for pclfw
0
137
Member Avatar for danieldiesel12

Hi! I´m trying to have a datagrid with some data. It includes a subquery and does only work if I define the parameter. I don´t want that. I would like to group it. The query is: [CODE] SELECT count(*)*1.0/ (select count(*) from events_may_2010 where agent = '5013' and convert(varchar,call_date,112)= convert(varchar,GETDATE(),112) …

Member Avatar for pclfw
0
99
Member Avatar for js8765

Hi, I was wondering what is the "cleanest" way of combining two datasets by taking all the values from one data set and only the values from a second data set that have an index that does not appear in the first. Both data sets have the same columns. Even …

Member Avatar for js8765
0
788
Member Avatar for end3r

Hy, I seek your help in solving the following problem: I have a select which returns columns like ( without count_same which I need to create by counting the same name): ID | NAME | no_items | count_same ----------------------------------------------------------- 1 | A | 1 | 2 2 | A | …

Member Avatar for end3r
0
196
Member Avatar for vallikasturi

Hi... I have two tables without primary keys and with a common field meterid... I can't add a primary key to any of these tables... Now i need to join both tables.. Can anyone write the query for this...plss... select * from table1,table2 where table1.meterid=table2.meterid; isn't working... The result of …

Member Avatar for bhartman21
0
722
Member Avatar for rambok4

What is the problem with the following login code? [code] Dim conn As SqlCommand = New SqlCommand("Data Source=RAHUL-034890AF0\SERVER2005;Initial Catalog=user_accounts;Integrated Security=True") conn.Prepare() Dim command As Data.SqlClient.SqlCommand = New Data.SqlClient.SqlCommand("select", conn.Connection) command.Parameters(1).Value = txtusername.Text command.Parameters(2).Value = txtpass.Text Dim i As Integer = command.ExecuteNonQuery conn.BeginExecuteNonQuery() If Page.IsValid Then Response.Redirect("~/salesbill.aspx") Else Lblerror.Text = "Username …

Member Avatar for kvprajapati
0
240
Member Avatar for sunnydays26

Hi I would like to show the data in a hierarchical manner as: bluehills > hills > south where hills comes under bluehills and south under hills in a hierarchical manner. How this is possible how can i retrieve in this manner using procedure Please help Thanks in advance MS

Member Avatar for Aussie_Here
0
51
Member Avatar for Aussie_Here

Hi I've been trying to solve the following problem for a few days but everytime I get the error msg even when the entered value doesn't conflict with the statement. Plz I need an urgent help I have the following tables: [B]booking[/B] bookingId (PK) subjectId (FK) [B]Subject[/B] subjectId (PK) termId …

Member Avatar for Aussie_Here
0
104
Member Avatar for Hardz

I am a c# and MSSql Server beginner, one of the project that i created is the library system database, I used MSSql Server as my database and c# as my interface. I have no problem to run that application coz it runs smoothly and better without any error. One …

Member Avatar for powerbox
0
102
Member Avatar for dB09

hello. i have a database with school names, their budgets and their expenses. i have to write trigger not allowing to increase expenses, but only to lower their value. if someone wants to increase it, there should be message. i know i have to remember somehow the old value and …

0
64
Member Avatar for Abemanden

Hi, i've tried several times, but haven't succed in making this: Classroom2 Name: | Date: Oliver | 12-10-10 Homer | 12-10-10 [COLOR="red"]Peter | 11-11-10[/COLOR] Classroom1 Name: | Date: James | 20-10-10 Lars | 20-10-10 [COLOR="red"]John | 11-11-10[/COLOR] How do i make a SQL statement that ONLY selects the lastest dates …

Member Avatar for Abemanden
0
147
Member Avatar for kkevinchou

I'm thinking its a malware problem, could someone help guide me through the fixing process? Thanks! Here's the Hijackthis log: Logfile of Trend Micro HijackThis v2.0.2 Scan saved at 1:07:47 AM, on 5/3/2010 Platform: Windows XP SP2 (WinNT 5.01.2600) MSIE: Internet Explorer v8.00 (8.00.6001.18702) Boot mode: Normal Running processes: C:\WINDOWS\System32\smss.exe …

Member Avatar for crunchie
0
294
Member Avatar for missbusiness

hi, im trying to divide two fields in a database like this: crterm=bal/pi but im not sure how to write it in sql. any suggestions?

Member Avatar for Brian Swan
0
102
Member Avatar for molivia03

Dear Dani web user, Can anyone help me how to generate series of date that has start and end date and pick up the data along the way. I have used Stored Procedure below but its not working [CODE] -- CREATE TEMP TABLE declare @YTDbyMonth Table ( --Period nvarchar(100) DateStart …

0
63
Member Avatar for golfbear18

Hello - We are trying to do a restore which is started manually (not an agent job) via rdp. I'm being told that the restore fails if the the rdp session shuts down. I don't think this would cause the restore to stop. I haven't seen the error logs yet, …

Member Avatar for freshfitz
0
60
Member Avatar for miweiser

Some of my tables have no key since auto-number won't ensure no duplicates are entered. Other tables have multiple fields as key because this is the only way to uniquely identify. Migration did not like certain tables or queries due to this, are keys required? Also my Forms and queries …

0
67
Member Avatar for Kusno

Dear all, I'm stucked with my XML problem. I have these stored procedures to save XML data into server hard disk. [CODE]CREATE PROCEDURE dbo.sp_XML_Employee(@Database varchar(10), @FileName Varchar(2000)) AS DECLARE @bcpCommand varchar(4000) SET @bcpCommand = 'bcp "SELECT EmployeeID, EmployeeName FROM ' + @Database + '.dbo.MasterEmployee ORDER BY EmployeeID FOR XML RAW(''Employee''), …

Member Avatar for Kusno
0
223
Member Avatar for vsmash

G'day, I'm wanting to generate non-sequential 12 character codes to use as coupon codes or gift vouchers in mssql server 2008. I wanna avoid generating a random and checking existing, but i don't know if it's possible to generate shortened guids? like maybe a nuid or a suid? any advice? …

0
61
Member Avatar for Ionelul

Hi, I have a little problem with a macro I'm working at. I need to pull data from a database and then show it in an excel sheet. Everything work fine till the moment when I want to close the recordset . Then my application freezes and I have to …

Member Avatar for vb5prgrmr
0
331
Member Avatar for raymondhsu09

Hi everyone, This is the error i am getting when i try to do SqlCommand.ExecuteNonQuery(). My application runs on multiple threads and constantly opens, executes and close connection. This error i am getting after running the application for some time. Error: System.Data.SqlClient.SqlException: A transport-level error has occurred when receiving results …

Member Avatar for raymondhsu09
0
515
Member Avatar for dwayned

Hi Guys, I am currently creating an application to track timekeeping (a clock in/out system) and I am trying to work out the best way to do this. I have a Main Form which contains buttons to ; - Log in - Out for Break - In from Break - …

Member Avatar for dwayned
0
132
Member Avatar for Ycefire

Hello, I'm using Windows 7 Ultimate 64bit. I'm on admin account and all I want is to develop my ASP.NET pages on my main system - not only on virtual machine with XP istalled. The problem is that I cannot access the database on Win 7. IIS is working, ASP.NET …

Member Avatar for Ycefire
0
217
Member Avatar for freshnyash

Hi, Hello all. I installed SQL Server 2005 on Windows 7 together with SP3. I set the surface area configuration to allow TCP/IP and named pipes. When i try to connect the machines running SQL, i fail, i cant access it. Neither can i change any settings in the surface …

Member Avatar for mikedsa
0
231
Member Avatar for Harry1S

How do I prompt the user to enter an 8 character code that I will use in an MS SQL query script?

Member Avatar for pclfw
0
63
Member Avatar for Kusno

Dear all, I have this query to generate sql row to XML Mode. [CODE]SELECT CurrencyID, CurrencyName FROM MasterCurrency ORDER BY CurrencyID FOR XML RAW ('Currency') , ELEMENTS;[/CODE] the result is : [CODE]<Currency> <CurrencyID>AUD</CurrencyID> <CurrencyName>AUSTRALIAN DOLLAR</CurrencyName> </Currency> <Currency> <CurrencyID>CHF</CurrencyID> <CurrencyName>SWISS FRANC</CurrencyName> </Currency> <Currency> <CurrencyID>EUR</CurrencyID> <CurrencyName>EUROPEAN EURO</CurrencyName> </Currency> [/CODE] I want the …

Member Avatar for Kusno
0
101
Member Avatar for bill_kearns

So the deeper I get into my first Windows Forms application the more I'm questioning myself. In the VB6 days I would distribute my apps with a password protected MS Access db (not very secure) and hope nobody hacked into it. In this app. I created my MDF in MS …

0
57
Member Avatar for Harry1S

Newbie SQL programmer. Here is my issue. I have a field, memid, varchar 30. I want to look at positions 1-9. If all are 9 positions are numeric , move those to memssn int field. Can anyone assist me? thanks

Member Avatar for campkev
0
67
Member Avatar for kau14

I Have Created Following tables 1.Test_Student(Master) table which will contain StudentId(primary key), StudentName and StudentAddress as columns. 2. Test_Subject(Master) table which will contain SubjectId(primary key) and SubjectName as columns. 3. Test_StudentSubjectTrans (Transaction) table. This will be a transaction table between Test_Student and Test_Subject. This table will contain StudentId and SubjectId …

Member Avatar for kau14
0
106
Member Avatar for guptaalok12

I have Column named 'Price' in a table.I want to update the 'Price' Column by adding 5 .But i have some Null values in 'Price' Column.Whenever i update the 'Price' Column.All Values Updated Except the Null Values Column.So how can i update the null Column.Pls Help Alok

Member Avatar for smitha86
0
123
Member Avatar for amitshrivas

Hello All i have a query on (Union all) clause i want to create a table through union clause. the code i am trying to execute is: [CODE] select * into table1 from (select * from partmst union all select * from importexcel) as mytemp [/CODE] but it shows error …

Member Avatar for Mohtshm
0
65

The End.