Member Avatar

I have Post code column and I want to get 60, 30 and 10% for each area code that I have, but the thing is there is a between statement which makes things a bit complicated. I need 60% from the first postcode then 30% from the second and 10% from the last postcode i.e these are the people I am trying to pull from each postcode. Here is my code below: SELECT top 50000 id ,email FROM fn_getsacilist ('knowblet,saciprofiled,govdata,tobydata',25000000,10,0) WHERE idnumber>='66' and idnumber<='98' and (postcode between 2000 and 2199 or postcode between 4000 and 4099 or postcode between 7400 …

Member Avatar
0
8
Member Avatar

Hi all ! I'm using vs2008, sqlserver2008 and vb.net as language. I would like to ask, i got this line of error when i'm debugging my code **----Too many arguments to 'Public Function getDrawingNumber(PlcCode As String) As System.Data.DataSet'.----** below is my program code : Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim clsDrawNum As New DrawingNumber() Dim dsDraw As DataSet Dim PlcCode As String dsDraw = clsDrawNum.getDrawingNumber(drpPlaceOfOrig.SelectedValue, PlcCode) End Sub Public Function getDrawingNumber(ByVal PlcCode As String) As DataSet Dim ToEDCConn As New DBConnection("", "TOEDC_Conn") Dim ds As DataSet Try ds = ToEDCConn.RunSqlReturnDS("select * from Place …

Member Avatar
0
11
Member Avatar

Hi All, I have an SSIS question regarding looping through CSV files with the Foreach Loop Container. What I have: 1. A string variable named fName - Global 2. A Foreach Loop Container 2.1 User::fName mapped to the loop container with an index of 0 3. A Data Flow Task 3.1 a CSV Connection 3.2 (and this is where I'm lost) An Expression @[User::fName] but I don't know what to set the Property to for this. IF this was an Excel file I would ExcelFilePath Property but since it isn't I'm at a loss. Can anyone advise?

Member Avatar
0
4
Member Avatar

I have been searching for the answer for 2 months, but still no success. Below the setup and connection string and all checked already. Firstly my errorlog file error = 18456 Severity 14 State 11 (Login failed for user OLDPC/GUEST. Token based server access validation failed with an infrastructure error. Check for previous errors. [client 192.168.0.10]) I am using SQL Server 2008 Enterprise edition. Running on pc with XP SP3. Server 2003 installed, although running from xp. ip = 192.168.0.17 Name = OLDPC. sql server setup with windows authentication only. Database = ServerTestData client pc running xp sp3. SQL server …

Member Avatar
0
10
Member Avatar

I'm new to stored procedures and, really anything about sql beyond the basic SELECT/INSERT/etc... so this is probably just something I don't understand but my problem is that my stored procedure seems to only return the last row of the result set (i.e. if it should return 10 items it only shows the last one (number 10)). When I run the stored procedure in the query analyzer it runs without any errors but it only displays the last item; here's the procedure (this is MS SQL Server 2008R2 if that makes any difference): [CODE]USE [NISUSInvyControl] GO /****** Object: StoredProcedure [dbo].[NISUS_GetEDIDocTypes] …

Member Avatar
0
5
Member Avatar

I have a table named "Table1" Its schema with data is like this [CODE=text] Id col2 col3 col4 col5 isUnique dbUnique 1 red 3M 1995 UK 1 null 2 red 3M 1995 UK 0 null 2 red 3M 1995 UK 0 null 3 red 3M 1995 UK 0 null 4 pink A4 2002 USA 1 null 5 pink A4 2002 USA 0 null[/CODE] Now my question is that, that i want to update dbUnique column of this table, such that dbUnique should contain Id of Table1 where isUnique is 1 in all duplicate rows based on col2,col3,col4 & col5 So …

Member Avatar
0
4
Member Avatar

I am using SQL2008. I want to generate log file of each and every transaction carried out on my table. How can i do this?

Member Avatar
0
5
Member Avatar

I have a list of values extracted from a datareader in a list. Is it possible for me to run a query to extract another set of values using a datareader and then use the individual values in the list and the values in the datareader to perform some calculation, and possibly use the item values in a query itself? The code snippet is as follows: [CODE]Dim prev_ob As New List(Of Int64) . . . con = New OleDb.OleDbConnection("provider=SQLOLEDB;data source=pc;initial catalog=DB1;integrated security=SSPI") cmd = New OleDbCommand("query", con) con.Open() r = cmd.ExecuteReader While r.Read prev_ob.Add(r.Item("col1")) End While[/CODE] I will be running …

0
1
Member Avatar

hi, Am having a problem Inserting into SQL 2008 database using stored procedure from a php webpage. My Stored Procedure is: [code=text] Create PROCEDURE [dbo].[udp_AddContact_Insert] @Contact_ID int, @Client_ID int, @STD varchar(10), @Tel varchar(20), @Mobile varchar(20), @EmailAddress varchar(100), @FirstName varchar(20), @LastName varchar(20), @Title_ID int, @Position_ID int, @User_ID int, @SourceURL varchar(1000), @PositionText varchar(200), @TitleText varchar(50), @NewContact_ID int output AS BEGIN SET NOCOUNT ON IF LEN(@PositionText)>0 BEGIN INSERT INTO dbo.tblPosition (Position) VALUES (@PositionText) SET @Position_ID = @@identity END IF LEN(@TitleText)>0 BEGIN INSERT INTO dbo.tblTitle ([Client_ID], [Title]) VALUES (@Client_ID, @TitleText) SET @Title_ID = @@identity END INSERT INTO [dbo].[tblContact] ([Client_ID] ,[STD] ,[Tel] ,[Mobile] ,[EmailAddress] ,[FirstName] …

Member Avatar
0
4
Member Avatar

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 - Log out When a user presses the "log in" button the logon form appears, the user then enters their username and password. What happens next is where I would like the help. [U]Process is as follows:[/U] [LIST=1] [*]Click Logon [*]Enter Username/Password [*]Check Logon Form for errors (eg no password etc) …

Member Avatar
0
4

The End.