[Solved] stored procedure passing date parameter getting error

The problem is that you are building SQL in the proc, but you are not using the values in @startdate and @enddate, instead you are passing the string You need to grab the values of these variables when you build the string – something like: ALTER PROCEDURE [dbo].[ParkingDeatailsReport] @locid INTEGER, @startdate nvarchar(100), @enddate nvarchar(100) as … Read more

[Solved] String or binary data would be truncated when using it in a stored procedure

You are trying to insert 5 length character(‘dfdfg’) into your 1 length column [Access] [nvarchar](1). Increase the value of your column in Table type. CREATE TYPE [dbo].[AccessLevel] AS TABLE( [RoleId] [int] NULL, [Access] [nvarchar](25) NULL, [IsDelete] [bit] NULL ) GO solved String or binary data would be truncated when using it in a stored procedure

[Solved] multiply and SUM() MS SQL

@fia Maybe you should do your calculation elsewhere first for example on paper or in Excel to ensure you know exactly what you should get. It would also help you figure out the order of the calculation before writing it in SQL. According to the figures shown the values you’ve stated seems to be correct … Read more

[Solved] XML nodes with SQL

Please try the following solution. What we are doing here is called shredding, i.e. converting XML into rectangular/relational format. I am shooting from the hip because DDL and sample data population were not provided. The provided XML is not well-formed due to missing root element, but SQL Server allows to handle XML fragments. We are … Read more

[Solved] I am inserting excel sheet bulk data into a sql database table, now i need to split the table into multiple tables by using stored procedure [closed]

I assume that you want to dumb the data from bulk_data to myaccount table, business_setup table and business_info table. if so, Assumptions : – Column names with prefix myaccount_ belongs to myaccount table – Column names with prefix business_setup belongs to business_setup table – Column names with prefix business_info belongs to business_info table – complete … Read more

[Solved] VBScript using WMI to find out SQL Server version

Based on the code in the first Google search result here: Dim WMI, Col, Prod, Q Set WMI = GetObject(“WinMgmts:”) Q = “Select * FROM Win32_Product WHERE Vendor = ” & _ “‘Microsoft Corporation’ AND Name LIKE ‘SQL Server%Database Engine Services'” Set Col = WMI.ExecQuery(Q) For Each Prod in Col if left(Prod.version, 3) = “11.” … Read more